CN111782218A - Applet processing method, device, equipment and storage medium - Google Patents

Applet processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN111782218A
CN111782218A CN202010604377.3A CN202010604377A CN111782218A CN 111782218 A CN111782218 A CN 111782218A CN 202010604377 A CN202010604377 A CN 202010604377A CN 111782218 A CN111782218 A CN 111782218A
Authority
CN
China
Prior art keywords
newly added
code
running
client
added code
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.)
Granted
Application number
CN202010604377.3A
Other languages
Chinese (zh)
Other versions
CN111782218B (en
Inventor
任涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202010604377.3A priority Critical patent/CN111782218B/en
Publication of CN111782218A publication Critical patent/CN111782218A/en
Application granted granted Critical
Publication of CN111782218B publication Critical patent/CN111782218B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The application discloses a small program processing method, a small program processing device, small program processing equipment and a storage medium, and relates to the field of small programs and the field of cloud platforms. The specific implementation scheme is as follows: acquiring newly added codes, wherein the newly added codes comprise a first newly added code running on a client and a second newly added code running on a front end, and the first newly added code and the second newly added code are used for expanding the capability of an applet; correspondingly injecting the first newly added code and the second newly added code into the operating environment of the client and the operating environment of the front end respectively through an expansion interface matched with the newly added code; and binding the first newly added code and the second newly added code, and controlling the currently operated applet to execute a corresponding extended function. The method and the device have the advantages that the injection of the extension packet is realized through the extension interface, the extension of the updating function is not limited, the diversification of the extension capability of the small program can be realized, and the flexibility is realized.

Description

Applet processing method, device, equipment and storage medium
Technical Field
The embodiments of the present application relate to an applet technology in the field of computer technologies, and in particular, to an applet processing method, apparatus, device, and storage medium.
Background
With the explosive growth of the applets, more and more applets take the host application program as the open mode of the landing page, so that the number of the application programs installed in the user terminal can be effectively reduced.
At present, applets run in a WebView environment of a host application program and can normally communicate only by relying on a protocol mode agreed by a client and a front end. As shown in fig. 1, by sending an extension packet (i.e., update. js) to the client by using an update method, the client downloads the update. js, and then triggers the client to jump to the front end, and when the applet is started next time, the updated extension capability becomes effective.
However, in the development stage of the applet, the front end can only issue the extension packet in an update manner on the existing applet framework to trigger the calling operation of the client to jump to the front end, and the updated extension capability can only take effect when the applet is started next time. Therefore, in the prior art, the extended scheme for the applet capability can only update the functions on the original basis, so that the extended capability has limitation.
Disclosure of Invention
The application provides an extended applet processing method, device, equipment and storage medium for realizing the injection of an extension packet through an extension interface and not limited to an updating function.
According to a first aspect of the present application, there is provided an applet processing method applied to a client, the method including: acquiring newly added codes, wherein the newly added codes comprise a first newly added code running on a client and a second newly added code running on a front end, and the first newly added code and the second newly added code are used for expanding the capability of an applet; correspondingly injecting the first newly added code and the second newly added code into the operating environment of the client and the operating environment of the front end respectively through an expansion interface matched with the newly added code; and binding the first newly added code and the second newly added code, and controlling the currently operated applet to execute a corresponding extended function.
According to a second aspect of the present application, there is provided an applet processing method applied to a front end, the method including: injecting a second new code into the running environment of the front end by using the client through an expansion interface matched with the second new code running at the front end; after the client side injects the first newly added code into the running environment of the client side through the expansion interface matched with the first newly added code running on the client side, if notification information which is sent by the client side and used for indicating that the first newly added code and the second newly added code are successfully bound is received, an expansion communication protocol corresponding to the running second newly added code is sent to the client side and used for indicating the client side to control the currently running applet to execute a corresponding expansion function.
According to a third aspect of the present application, there is provided an applet processing apparatus comprising: the system comprises a newly added code acquisition module, a program execution module and a program execution module, wherein the newly added code acquisition module is used for acquiring newly added codes, the newly added codes comprise a first newly added code which is used for running at a client and a second newly added code which is used for running at a front end, and the first newly added code and the second newly added code are used for expanding the capability of an applet; the code injection module is used for correspondingly injecting the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through an expansion interface matched with the newly added code; and the extended function execution module is used for binding the first newly added code and the second newly added code and controlling the currently running applet to execute the corresponding extended function.
According to a fourth aspect of the present application, there is provided an applet processing apparatus comprising: the processing module is used for injecting a second new code into the running environment of the front end by using the client through an expansion interface matched with the second new code running at the front end; and the execution module is used for sending an extended communication protocol corresponding to the running second newly added code to the client to instruct the client to control the currently running applet to execute a corresponding extended function if receiving notification information which is sent by the client and used for indicating that the first newly added code and the second newly added code are successfully bound after the client injects the first newly added code into a running environment of the client through an extended interface matched with the first newly added code running on the client.
According to a fifth aspect of the present application, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect and/or the second aspect.
According to a sixth aspect of the present application, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the first and/or second aspect.
According to a seventh aspect of the present application, there is provided an applet processing method applied to a client, the method including: acquiring newly added codes, wherein the newly added codes comprise first newly added codes and second newly added codes, and the first newly added codes and the second newly added codes are used for expanding the capability of the small program; and controlling the currently running applet to execute a corresponding extended function according to the first newly added code and the second newly added code.
According to an eighth aspect of the present application, there is provided an applet processing method applied to a front end, the method including: injecting the second newly added code into a front-end operating environment through a client; and after the client side injects the first newly added code into the running environment of the client side, if notification information which is sent by the client side and used for indicating that the first newly added code and the second newly added code are successfully bound is received, the client side is instructed to control the currently running small program to execute a corresponding extended function.
According to the technology of the application, the problem that the expansion capability is limited because the function can only be updated on the original basis in the expansion scheme aiming at the small program capability is solved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a schematic diagram of an update method for applet capability extension provided by the prior art;
FIG. 2 is a diagram of an applet process scenario in which embodiments of the application may be implemented;
FIG. 3 is a schematic diagram according to a first embodiment of the present application;
FIG. 4 is a schematic view of a second embodiment of the present application;
FIG. 5 is an applet capability extension scenario diagram in which embodiments of the application may be implemented;
FIG. 6 is a schematic structural diagram of an applet processing apparatus according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of an applet processing apparatus according to another embodiment of the present application;
FIG. 8 is a schematic illustration according to a third embodiment of the present application;
FIG. 9 is a schematic illustration according to a fourth embodiment of the present application;
fig. 10 is a block diagram of an electronic device for implementing the applet processing method according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. 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 application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 2 is a small program processing scenario diagram in which an embodiment of the present application may be implemented. As shown in fig. 2, the embodiment of the present application may be applied to a cloud platform, where the cloud platform includes: server 10, client 20, and front end 30; wherein, the applet runs in the WebView environment of the host application program, the server 10 can communicate with the client 20 to provide cloud service for the client 20, and then the applet realizes the application of the capability based on the communication protocol between the client 20 and the front end 30; the small program can log in through a browser and a client. The applet and the cloud platform are combined by building an operating environment and a configuration file of the applet, so that the applet can communicate with the server 10, and the cloud platform can provide cloud service for realizing the capability of the applet and further build the applet cloud platform. The applet cloud platform comprises various cloud applications such as instant messaging, postboxes, network disks, office collaboration and the like. By combining the applet and the cloud platform, the application and the expansion of the applet can be realized.
In some optional scenarios, the server 10 is configured to issue extension packages to the client 20, where the extension packages may include an extension package for running in the running environment of the client 20 and an extension package for running in the running environment of the front end 30; the client 20 is configured to download and analyze an extension packet sent by the server 10 after receiving the extension packet, and inject the analyzed codes into the operating environment of the client 20 and the operating environment of the front end 30 through an extension interface matched with the type to which the codes belong according to the type to which the codes belong, so that different types of codes and different extension interfaces are different, and the new codes are not limited to the update type (modifying a communication protocol corresponding to the applet on the basis of the original applet) but also can be the new type (a communication protocol corresponding to the new applet); after the environments at the two ends are configured, in order to directly invoke the expansion capability of the applet, the client 20 may bind the code running in the running environment of the client 20 to the code running in the running environment of the front end 30, that is, the client 20 binds the expansion capability of the front end 30, and after the binding is successful, send the message of the binding success to the front end 30, the front end 30 sends the protocol of the invoked expansion capability to the client 20, and the client 20 invokes the corresponding applet expansion function according to the protocol; when the applet extension capability is successfully called, the front end 30 recalls the information that the extension capability is successfully called to the client 20, and the applet can take effect without restarting the extension function.
Aiming at the technical problem that the expansion capability is limited because the function can only be updated on the original basis and only one type of expansion is limited in the expansion scheme of the small program capability in the prior art, the method adds two expansion types including an updating type and a new adding type through a preset expansion socket, after the server sends the extension packet to the client, the client can determine the type of the extended code by downloading and analyzing the extension packet and marking the extension type corresponding to the code in the extension packet, then the expanded codes are loaded into the corresponding operating environments of the client and the front end respectively through the expansion sockets matched with the types of the expanded codes, then the client binds the codes in the two running environments, and then calls the applet to execute the corresponding extended function, so that the applet can take effect without restarting the extended capability.
The application provides a small program processing method, a device, equipment and a storage medium, which are applied to a small program technology in the technical field of computers so as to achieve the technical effect that the expansion scheme of the small program capability is not limited to one type of expansion, the diversification of the expansion capability of the small program can be realized, and the flexibility is realized.
According to an embodiment of the present application, there is provided an applet processing method. As shown in fig. 3, is a flowchart of an applet processing method according to an embodiment of the application. The small program processing method comprises the following steps:
s301, acquiring a new code.
The added codes comprise a first added code running on the client side and a second added code running on the front end, and the first added code and the second added code are used for expanding the capability of the applet.
The applet runs in a WebView environment of the host application program, normal communication can be realized only by a protocol mode which is agreed by the client and the front end, and the protocol between the client and the front end can be modified or newly increased aiming at the expansion of the applet. In an example, the client may obtain a new code corresponding to the protocol through the server, where the new code may be a parameter modification or a new rule performed on an original protocol, or may be a new protocol.
The execution subject of the present embodiment may be a client as shown in fig. 2. The client (native end) may be a host application program for running the applet, and the client may be installed on the terminal device. The front end may be a WLAN network architecture such as the Swan framework.
The acquired new codes are generated in pairs, namely the new codes can comprise first new codes and second new codes, the first new codes and the second new codes can realize the expansion of the applet capacity together, but the environments in which the first new codes and the second new codes operate are different, the first new codes operate at the client side, and the second new codes operate at the front end.
In some optional scenarios, the new code may not be limited to only one type, and multiple types of new codes, such as update (update) and add (new), may be issued simultaneously by the server, so that the new codes acquired by the client may be not only one pair, but may be at least two pairs, which reflects the diversification of the new code, and is not limited to the update type, and may also be the new type, or the new type and the update type are expanded together.
S302, correspondingly injecting the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through the expansion interface matched with the newly added code.
In order to realize diversification of the expansion capability, the expansion interface may be preset without being limited to the update type. The expansion interface is used for transmitting the corresponding newly added code to the corresponding operating environment, so that the expansion interface and the specific newly added code have a corresponding relationship, only the expansion interface matched with the newly added code needs to be found, and the newly added code is respectively injected or loaded into the corresponding operating environment through the expansion interface, so that the operating environment is provided for realizing the expansion capability.
The client side injects or loads the first newly added code into the running environment of the client side through the expansion interface matched with the first newly added code; and the client side injects or loads the second new code into the operating environment of the client side through the expansion interface matched with the second new code. The expansion interface matched with the first newly added code and the expansion interface matched with the second newly added code are the same type of expansion interface.
S303, binding the first newly added code and the second newly added code, and controlling the currently running applet to execute a corresponding extended function.
In order to realize the extension capability of the applet and enable the applet to normally communicate depending on the extended protocol between the client and the front end, the client binds the codes in the respective operating environments, namely the first added code and the second added code, so that the client is associated with the front end. The front end is a calling party of the protocol, namely the protocol used for calling the extension which the applet depends on; the client is a protocol implementation party, namely, the client is used for invoking the expansion capability of the applet according to the expanded protocol, so that the applet can realize the expansion function.
In this embodiment, the client acquires a first newly added code for running on the client and a second newly added code for running on the front end, and correspondingly injects the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through an expansion interface matched with the newly added codes, and then realizes the expansion function of the currently running applet by binding the first newly added code and the second newly added code. Therefore, the extension has flexibility by adding the preset extension interface (namely, the extension socket) and is not limited to the extension of the updating type, and then the first newly added code and the second newly added code are bound through the extension interface matched with the newly added code, so that the applet can be controlled to realize the extension function in the running state without restarting the applet.
On the basis of the above embodiment, the present application may also have a scenario in which the server issues the extension packet to the client, and then the client downloads and analyzes the extension packet to obtain a new code. In this scenario, how to obtain the new code may be implemented through the following specific processes:
step a1, acquiring a first extension packet through a client protocol.
And a2, acquiring a second extension packet through a front-end protocol.
And the server sends the extension packet to the client. And the extension packet is issued to the client no matter the extension packet is an update type extension packet or a newly added type extension packet. Wherein, the extension packet can include at least two, and is present in pairs. The reason is that the extension packet sent to the client is different from the extension packet sent to the front end, one is the extension packet of the front end, and the other is the extension packet of the client, but the extension packets have the same extension capability and need to be subsequently associated with the extension packet, so that the extension capability is realized.
The server can communicate through different protocols when sending the extension packet. The extension packet running at the client is a first extension packet, and the extension packet running at the front end is a second extension packet. The server sends the first extension packet to the client through a client protocol, and the client receives the first extension packet through the client protocol and is used for running in the running environment of the client; the server sends the second extension packet to the client through the front-end protocol, and the client receives the second extension packet through the client protocol and is used for running in the running environment of the front end. Therefore, the client can determine whether the extension packet belongs to the running environment running in the client or the front end according to different protocols for obtaining the extension packet, and further inject the newly added code obtained by analysis into the corresponding running environment.
Step a3, analyzing the first extension packet to obtain a first newly added code.
Step a4, analyzing the second expansion packet to obtain a second new code.
The client protocol is used for representing that a first newly added code obtained through analysis is used for running in a running environment of the client, the front-end protocol is used for representing that a second newly added code obtained through analysis is used for running in a running environment of the front end, the client is a host application program operated by an applet, and the front end is a WLAN network architecture.
The first extension packet analyzed by the client side obtains a first newly added code for running on the client side; and the second extension packet analyzed by the client side obtains a second new code for running at the front end. And the client decompresses the downloaded expansion packet to obtain a code corresponding to the expansion packet, namely a JS code, wherein the JS code contains a label of the expansion type. And issuing the newly added code to the front end and the client in a JS mode according to the label of the extension type. The running environments of the codes issued to the client and the front end are different. In one example, the client can decompress the extension packet of the front end and inject the extension packet of the client at the same time when the applet runs, so that dynamic extension can be realized.
On the basis of the above embodiments, the present application may also have a scenario that the extension type and the extension interface have a mapping relationship of a call. In the scenario, before determining the matched expansion interface, the expansion type to which the new code belongs may be determined, and then the expansion interface matched with the expansion type may be found according to the mapping relationship. The following describes in detail how to inject the first newly added code and the second newly added code into the operating environment of the client and the operating environment of the front end respectively through the expansion interface matched with the newly added code:
step b1, according to the extension type carried in the new code, calling the target extension interface matched with the extension type through the mapping relation.
The new code carries an extension type to indicate whether the new code is an added type or an updated type. The mapping relation is a calling relation between the extension type and the extension interface. In one example, the newly added code modifies a protocol between a client and a front end, which is depended by the applet, and may be a parameter in the protocol or a newly added rule in the protocol, that is, an update protocol, and the newly added code carries an extension type which is an update type; the newly added code is a newly added protocol other than the protocol between the client and the front end, which is depended on by the applet, and the extension type carried in the newly added code is the newly added type.
In order to realize the calling function of the matched extension interface, the extension type and the extension interface have a calling mapping relation, and after the extension type is determined, a target extension interface corresponding to the extension type can be found and called through the mapping relation.
Step b2, correspondingly injecting the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through the target expansion interface.
The client can correspondingly inject the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through the target expansion interface. It should be noted that the extension type is not limited to the new addition type and the update type, and correspondingly, the extension interface is also not limited to the new addition type interface and the update type interface.
In one example, the new code may include a code corresponding to the new type and a code corresponding to the update type, and the client calls different expansion interfaces according to the codes corresponding to the different types. The client side correspondingly injects the codes corresponding to the new types (namely, a first new code corresponding to the new types and a second new code corresponding to the update types) into the operating environment of the client side and the operating environment of the front end respectively through the new type interface, namely, the client side injects the first new code corresponding to the new types into the operating environment of the client side through the new type interface, and injects the second new code corresponding to the new types into the operating environment of the front end through the new type interface; the client side correspondingly injects the codes corresponding to the update types (namely, the first newly added codes corresponding to the update types and the second newly added codes corresponding to the update types) into the operating environment of the client side and the operating environment of the front end respectively through the update type interface, namely, the client side injects the first newly added codes corresponding to the update types into the operating environment of the client side through the update type interface, and injects the second newly added codes corresponding to the update types into the operating environment of the front end through the update type interface. Through the self-defining setting of the expansion interface, different expansion types can use different expansion interfaces to carry out data transmission and communication, the diversification of the expansion capability can be realized, and the limitation of the expansion capability caused by only realizing the expansion of the update type in the prior art is distinguished.
On the basis of the above embodiment, there may be a scenario where the new code is a JS code. The Javascript is a script language, and can increase interactivity of a webpage, simplify regularly repeated HTML (hypertext markup language) text and reduce downloading time; and the JavaScript can respond to the user's operation in time. In this scenario, how to inject the first newly added code and the second newly added code into the operating environment of the client and the operating environment of the front end respectively and correspondingly can be specifically realized through the following steps:
and c1, loading the second newly added code to the running environment of the front end through the target expansion interface, so that the second newly added code runs in the WebView environment.
And loading the second newly added code in the WebView environment through the target injection channel so that the second newly added code runs in the WebView environment.
Optionally, the extension type includes a new addition type and an update type; if the extension type is the new type, the called target extension interface is the new type interface; and if the extension type is the update type, calling the target extension interface as the update type interface.
An expansion socket (namely an expansion interface) is preset in the front end, and two expansion types are added, including an update type and a new type. The preset expansion socket is added, so that expansion has flexibility, then according to the rule of the preset expansion socket, the corresponding injection channel is adopted to realize the running environment that the package is issued to the front end and the running environment that the package is injected into the client when the applet runs, when the environment is ready, binding and callback are carried out, and the applet can realize expansion capability without restarting.
In one example, the process of injecting is client initiated. If the extension type is marked as an update type, the target extension interface is an update type interface, and new codes are injected through an update channel according to the update type interface; and if the extension type is marked as the new type, the target extension interface is the new type interface, and new codes are injected through a new channel according to the new type interface. The running environment for injecting the newly added code into the front end is a WebView environment, and the second newly added code runs in the WebView environment.
And c2, loading the first newly added code to the running environment of the client when the small program runs, so that the first newly added code runs in the jscore environment.
In order to realize dynamic extension, the extension capability can be enabled to take effect under the condition that the applet does not need to be restarted, and when the applet runs, the client side injects first newly added codes running in a jscore environment, so that second newly added codes can run in the jscore environment. And then binding the codes in the two running environments in the running process of the applet after the two running environments are prepared, so that the calling of the protocol is associated with the realization of the protocol, and further realizing the communication between the client and the front end through the expanded protocol, so that the applet can realize the communication of the expansion capability depending on the expanded protocol of the client and the front end.
Optionally, on the basis of the foregoing embodiment, a detailed description is given of how to bind the first newly added code and the second newly added code and control the currently running applet to execute the corresponding extended function, which may be implemented by the following specific steps:
and d1, binding the running first added code with the running second added code, and sending a notification message for indicating that the binding is successful to the front end.
After the second newly added code injected by the front end and the first newly added code injected by the client are both successful, namely the two operating environments are both prepared, the client initiates a notification to notify that the newly added codes at the two ends of the front end are bound, so that the protocol and the implementation function form a one-to-one relationship.
And d2, receiving the extended communication protocol corresponding to the second new code sent by the front end, and calling the extended capability function corresponding to the first new code according to the extended communication protocol, so that the currently running applet executes the extended function.
When the applet calls the capability currently, the front end sends the extended communication protocol to the client, the client calls the extended capability function through the extended communication protocol so that the currently running applet executes the extended function, and after the extended function of the applet takes effect, the front end calls back the realized capability to prompt the client to realize the extended capability of the applet.
In one example, a first newly added code running in a jscore environment is used for providing an extended capability function, a second newly added code running in a WebView environment is used for providing an extended communication protocol, and after a binding relationship is formed between calling of the protocol and implementation of the protocol, a hot plug mechanism is adopted in the running process of the applet under the condition that restarting of the applet is not affected, so that the dynamic extension can be timely achieved.
Optionally, on the basis of the above embodiment, how to invoke the extended capability function corresponding to the running first added code according to the extended communication protocol so that the currently running applet executes the extended function is described in detail, which may be implemented by the following specific steps:
and e1, calling the extended capability function corresponding to the first newly added code according to the extended communication protocol, so as to instruct the currently running applet to call the extended function.
And e2, if the indication information which is sent by the front end and used for indicating that the applet calls the extended function successfully is received, determining that the applet calls the extended function successfully.
According to the extended communication protocol, an extended capability function in a first newly added code running in the jscore environment is called, and the calling of the extended function can be realized by the currently running applet without restarting, so that the extended capability is realized. And after the extension capability called by the small program is realized, the front end sends indication information for indicating that the small program successfully calls the extension function to the client, so as to inform the client that the small program successfully calls the extension function.
The embodiment of the application not only can realize the extension updating method on the original basis, but also can realize the new adding method, and the extension capability can take effect without restarting the current small program.
According to the embodiment of the application, the application also provides an applet processing method. As shown in fig. 4, is a flowchart of an applet processing method according to an embodiment of the application. The small program processing method is applied to the front end and comprises the following steps:
s401, injecting a second new code into a front-end running environment by using a client through an expansion interface matched with the second new code running at the front end.
And in the process of injecting the second new code into the front-end operating environment, the client is used for realizing injection in a channel provided by the expansion interface through the expansion interface matched with the second new code. The operation environment for injecting the newly added code into the front end is the WebView environment, the operation in the WebView environment is the second newly added code, the specific injection process is the same as that in the above embodiment, and details are not repeated here.
S402, after the client side injects the first newly added code into the running environment of the client side through the expansion interface matched with the first newly added code running on the client side, if notification information sent by the client side and used for indicating that the first newly added code and the second newly added code are successfully bound is received, an expansion communication protocol corresponding to the running second newly added code is sent to the client side and used for indicating the client side to control the currently running applet to execute a corresponding expansion function.
After the second newly added code injected by the front end and the first newly added code injected by the client are both successful, namely the two operating environments are both prepared, the client initiates a notification to notify that the newly added codes at the two ends of the front end are bound, so that the protocol and the implementation function form a one-to-one relationship. The front end sends the extended communication protocol to the client after receiving the message that the client notifies that the binding is successful, the client calls the extended capability function through the extended communication protocol so that the currently running applet executes the extended function, and after the extended function of the applet takes effect, the front end calls back the capability realized by the applet so as to prompt the client that the extended capability of the applet is realized.
In one example, a first newly added code running in a jscore environment is used for providing an extended capability function, a second newly added code running in a WebView environment is used for providing an extended communication protocol, and after a binding relationship is formed between calling of the protocol and implementation of the protocol, a hot plug mechanism is adopted in the running process of the applet under the condition that restarting of the applet is not affected, so that the dynamic extension can be timely achieved.
In this embodiment, after injecting a second new code into an operating environment of a front end by using a client through an expansion interface matched with the second new code running on the front end, and after injecting the first new code into the operating environment of the client through an expansion interface matched with the first new code running on the client, if receiving notification information sent by the client to indicate that the first new code and the second new code are successfully bound, sending an extended communication protocol corresponding to the second new code running to the client to instruct the client to control a currently running applet to execute a corresponding extended function, and after adding a preset expansion interface (i.e. an expansion socket), making the extension flexible and not limited to the extension of an update type, and then binding the first new code and the second new code through the expansion interface matched with the new code, and further, the applet realizes the extended function in the running state without restarting the applet.
Optionally, after sending the extended communication protocol corresponding to the second new code to the client, the method further includes: and if the currently running small program successfully calls the extended function, sending indication information for indicating that the small program successfully calls the extended function to the client.
After the extended communication protocol corresponding to the second newly added running code is sent to the client, the client calls the extended capability function in the first newly added running code running in the jscore environment according to the extended communication protocol, so that the currently running applet can call the extended function without restarting, and the extended capability is further realized. And after the extension capability called by the small program is realized, the front end sends indication information for indicating that the small program successfully calls the extension function to the client, so as to inform the client that the small program successfully calls the extension function.
In one example, referring to fig. 5, fig. 5 is a diagram illustrating an applet capability extension scenario in which an embodiment of the application may be implemented. The front end frame (Swan) of the applet is preset with an Extension socket, and update and add types; the new code of Native end (client) of the small program is issued in js mode, runs in jscore environment and provides a run-time injection channel; after the extension packets (update, add) of the front end are issued to the Native end locally, after the code of the Native end is successfully issued, the dual-end environment is prepared at the same time, the Native end binds the front end extension capability, the front end framework calls back the event to the Native end, and the current applet calls the extension method again. Under the condition of not influencing the restart of the applet, a hot plug mechanism is adopted in the running process: timely effective and dynamic expansion.
In the embodiment of the application, the client downloads and analyzes the extension packet sent by the server, and the analyzed codes are respectively injected into the operating environment of the client and the operating environment of the front end through the extension interfaces matched with the types of the codes according to the types of the codes, so that the different types of codes and the different extension interfaces are different, and the newly added codes are not only limited to the update type (modifying the communication protocol corresponding to the applet on the basis of the original applet) but also can be the newly added type (the communication protocol corresponding to the newly added applet); after the environments at the two ends are configured, in order to directly call the expansion capability of the applet, the client can bind the code running in the running environment of the client to the code running in the running environment of the front end, namely the client binds the expansion capability of the front end, when the binding is successful, the binding success message is sent to the front end, the front end sends the protocol of the called expansion capability to the client, and the client calls the corresponding applet expansion function according to the protocol; and when the extended capability of the small program is successfully called, the front end recalls the information of the successfully called extended capability to the client, and the small program can take effect without restarting the extended function. Therefore, the method and the device can effectively avoid restarting the applet and reduce interruption of user experience; and is beneficial for small program developers to carry out online debugging.
According to the embodiment of the application, the application also provides an applet processing device. Fig. 6 is a schematic structural diagram of an applet processing apparatus according to an embodiment of the present application. The applet processing device 60 of the present application includes: a newly added code acquisition module 61, a code injection module 62 and an extended function execution module 63; the new code acquiring module 61 is configured to acquire a new code, where the new code includes a first new code for running at a client and a second new code for running at a front end, and the first new code and the second new code are used to expand the applet capability; a code injection module 62, configured to correspondingly inject the first newly added code and the second newly added code into an operating environment of the client and an operating environment of the front end through an expansion interface matched with the newly added code; and an extended function executing module 63, configured to bind the first newly added code and the second newly added code, and control the currently running applet to execute a corresponding extended function.
Optionally, the code injection module 62 is specifically configured to: calling a target expansion interface matched with the expansion type through a mapping relation according to the expansion type carried in the newly added code, wherein the mapping relation is the calling relation between the expansion type and the expansion interface; and correspondingly injecting the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through the target expansion interface.
Optionally, the newly added code is a JS code; the code injection module 62 is further specifically configured to: loading the second newly added code to a running environment of a front end through the target expansion interface, so that the second newly added code runs in a WebView environment; and loading the first added code to the running environment of the client when the small program runs, so that the first added code runs in a jscore environment.
Optionally, the extension type includes a new addition type and an update type; the device further comprises: an extension interface calling module; the extension interface calling module is used for calling the target extension interface as a new type interface when the extension type is a new type; and when the extension type is the update type, calling the target extension interface as an update type interface.
Optionally, the extended function executing module 63 is specifically configured to: binding the running first newly added code with the running second newly added code, and sending notification information for indicating successful binding to the front end; and receiving an extended communication protocol corresponding to the second newly added running code sent by the front end, and calling an extended capability function corresponding to the first newly added running code according to the extended communication protocol so that the currently running applet executes an extended function.
Optionally, the extended function executing module 63 is further specifically configured to: calling an extended capability function corresponding to the running first newly added code according to the extended communication protocol so as to indicate the currently running small program to call the extended function; and if receiving indication information which is sent by the front end and used for indicating that the applet calls the extended function successfully, determining that the applet calls the extended function successfully.
Optionally, the new code obtaining module 61 is specifically configured to: acquiring a first extension packet through a client protocol; acquiring a second extension packet through a front-end protocol; analyzing the first extension packet to obtain a first newly added code; analyzing the second extension packet to obtain a second newly added code; the client protocol is used for representing that a first newly added code obtained through analysis is used for running in a running environment of the client, the front-end protocol is used for representing that a second newly added code obtained through analysis is used for running in a running environment of the front end, the client is a host application program operated by an applet, and the front end is a WLAN network architecture.
The applet processing apparatus in the embodiment shown in fig. 6 can be used to execute the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar and will not be described herein again.
In this embodiment, the client acquires a first newly added code for running on the client and a second newly added code for running on the front end, and correspondingly injects the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through an expansion interface matched with the newly added codes, and then realizes the expansion function of the currently running applet by binding the first newly added code and the second newly added code. Therefore, the extension has flexibility by adding the preset extension interface (namely, the extension socket) and is not limited to the extension of the updating type, and then the first newly added code and the second newly added code are bound through the extension interface matched with the newly added code, so that the applet can be controlled to realize the extension function in the running state without restarting the applet.
According to the embodiment of the application, the application also provides an applet processing device. Fig. 7 is a schematic structural diagram of an applet processing apparatus according to an embodiment of the present application. The applet processing device 70 of the present application includes: a processing module 71 and an execution module 72; the processing module 71 is configured to inject a second new code into the operating environment of the front end by using the client through an expansion interface matched with the second new code running at the front end; and the execution module 72 is configured to, after the client injects the first new added code into the operating environment of the client through the expansion interface matched with the first new added code running on the client, send, to the client, an extended communication protocol corresponding to the running second new added code if receiving notification information sent by the client and used to indicate that the first new added code and the second new added code are successfully bound, so as to instruct the client to control the currently running applet to execute a corresponding extended function.
Optionally, the apparatus further comprises: a callback module; and the callback module is used for sending indication information for indicating that the applet successfully calls the extended function to the client side after the extended communication protocol corresponding to the second newly added code is sent to the client side and the currently running applet successfully calls the extended function.
The applet processing apparatus in the embodiment shown in fig. 7 may be configured to execute the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar and will not be described herein again.
In this embodiment, after injecting a second new code into an operating environment of a front end by using a client through an expansion interface matched with the second new code running on the front end, and after injecting the first new code into the operating environment of the client through an expansion interface matched with the first new code running on the client, if receiving notification information sent by the client to indicate that the first new code and the second new code are successfully bound, sending an extended communication protocol corresponding to the second new code running to the client to instruct the client to control a currently running applet to execute a corresponding extended function, and after adding a preset expansion interface (i.e. an expansion socket), making the extension flexible and not limited to the extension of an update type, and then binding the first new code and the second new code through the expansion interface matched with the new code, and further, the applet realizes the extended function in the running state without restarting the applet.
Optionally, referring to fig. 8, the present application further provides an applet process applied to a client, including: s801, acquiring a new code, wherein the new code comprises a first new code and a second new code, and the first new code and the second new code are used for expanding the capability of the applet; s802, controlling the currently running small program to execute a corresponding extended function according to the first newly added code and the second newly added code.
In the embodiment, the client side obtains the first newly added code and the second newly added code, and controls the currently running applet to execute the corresponding extended function according to the first newly added code and the second newly added code, so that the extension has flexibility, is not limited to the extension type of the newly added code, and can control the applet to realize the extended function in the running state without restarting the applet.
Optionally, referring to fig. 9, the present application further provides an applet process applied to a front end, including: s901, injecting a second newly added code for running at the front end into a running environment of the front end through the client; s902, after the client injects a first new code for running at the client into a running environment of the client, if notification information sent by the client and used for indicating that the first new code and the second new code are successfully bound is received, the client is instructed to control the currently running applet to execute a corresponding extended function, and the first new code and the second new code are used for extending the applet capability.
In this embodiment, the second added code is injected into the operating environment of the front end by the client, after the client injects the first added code into the operating environment of the client, if notification information sent by the client and used for indicating that the first added code and the second added code are successfully bound is received, the client is instructed to control the currently running applet to execute a corresponding extension function, so that extension has flexibility and is not limited to the extension type of the added code, and after the first added code and the second added code are bound, the applet realizes an extension function in an operating state without restarting the applet.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 10, it is a block diagram of an electronic device according to an applet processing method in an embodiment of the present application. 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 present application that are described and/or claimed herein.
As shown in fig. 10, the electronic apparatus includes: one or more processors 1001, memory 1002, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). Fig. 10 illustrates an example of one processor 1001.
The memory 1002 is a non-transitory computer readable storage medium provided herein. The storage stores instructions executable by at least one processor, so that the at least one processor executes the small program processing method provided by the application. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to execute the applet processing method provided in the present application.
The memory 1002, as a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the applet processing method in the embodiments of the present application (for example, the addition code acquiring module 61, the code injecting module 62, and the extended function executing module 63 shown in fig. 6, and/or the processing module 71 and the executing module 72 shown in fig. 7). The processor 1001 executes various functional applications of the server and data processing, i.e., implements the applet processing method in the above-described method embodiments, by executing non-transitory software programs, instructions, and modules stored in the memory 1002.
The memory 1002 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the electronic device of the applet processing method, and the like. Further, the memory 1002 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 1002 may optionally include memory located remotely from the processor 1001, which may be connected to the applet processing method electronics via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the applet processing method may further include: an input device 1003 and an output device 1004. The processor 1001, the memory 1002, the input device 1003, and the output device 1004 may be connected by a bus or other means, and the bus connection is exemplified in fig. 10.
The input device 1003 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus of the applet processing method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 1004 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), 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. Wherein, the input device and the output device can be a V2V communication module for receiving V2X messages from external devices or sending V2X messages to the outside world.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
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.
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 application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. 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 application shall be included in the protection scope of the present application.

Claims (22)

1. An applet processing method applied to a client, the method comprising:
acquiring newly added codes, wherein the newly added codes comprise a first newly added code running on a client and a second newly added code running on a front end, and the first newly added code and the second newly added code are used for expanding the capability of an applet;
correspondingly injecting the first newly added code and the second newly added code into the operating environment of the client and the operating environment of the front end respectively through an expansion interface matched with the newly added code;
and binding the first newly added code and the second newly added code, and controlling the currently operated applet to execute a corresponding extended function.
2. The method of claim 1, wherein the injecting the first and second new added codes into the runtime environment of the client and the runtime environment of the front end respectively through the expansion interface matched with the added code comprises:
calling a target expansion interface matched with the expansion type through a mapping relation according to the expansion type carried in the newly added code, wherein the mapping relation is the calling relation between the expansion type and the expansion interface;
and correspondingly injecting the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through the target expansion interface.
3. The method of claim 2, wherein the add code is a JS code;
the correspondingly injecting the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through the target expansion interface comprises:
loading the second newly added code to a running environment of a front end through the target expansion interface, so that the second newly added code runs in a WebView environment;
and loading the first added code to the running environment of the client when the small program runs, so that the first added code runs in a jscore environment.
4. The method of claim 2, wherein the extension types include a new addition type and an update type;
if the extension type is a new type, the called target extension interface is a new type interface;
and if the extension type is the update type, calling the target extension interface as an update type interface.
5. The method of any one of claims 2-4, wherein the binding the first and second added codes controls a currently running applet to perform corresponding extended functions, including:
binding the running first newly added code with the running second newly added code, and sending notification information for indicating successful binding to the front end;
and receiving an extended communication protocol corresponding to the second newly added running code sent by the front end, and calling an extended capability function corresponding to the first newly added running code according to the extended communication protocol so that the currently running applet executes an extended function.
6. The method of claim 5, wherein the calling the extended capability function corresponding to the running first added code according to the extended communication protocol, so that the currently running applet executes the extended function, comprises:
calling an extended capability function corresponding to the running first newly added code according to the extended communication protocol so as to indicate the currently running small program to call the extended function;
and if receiving indication information which is sent by the front end and used for indicating that the applet calls the extended function successfully, determining that the applet calls the extended function successfully.
7. The method of claim 1, wherein the obtaining a new addition code comprises:
acquiring a first extension packet through a client protocol;
acquiring a second extension packet through a front-end protocol;
analyzing the first extension packet to obtain a first newly added code;
analyzing the second extension packet to obtain a second newly added code;
the client protocol is used for representing that a first newly added code obtained through analysis is used for running in a running environment of the client, the front-end protocol is used for representing that a second newly added code obtained through analysis is used for running in a running environment of the front end, the client is a host application program operated by an applet, and the front end is a WLAN network architecture.
8. An applet processing method applied to a front end, the method comprising:
injecting a second new code into a front-end operating environment by using a client through an expansion interface matched with the second new code running at the front end;
after a client side injects a first newly added code into an operation environment of the client side through an expansion interface matched with the first newly added code running on the client side, if notification information which is sent by the client side and used for indicating that the first newly added code and the second newly added code are successfully bound is received, an expansion communication protocol corresponding to the running second newly added code is sent to the client side and used for indicating the client side to control a currently running applet to execute a corresponding expansion function.
9. The method of claim 8, wherein after sending the extended communication protocol corresponding to the second new code to the client, the method further comprises:
and if the currently running small program successfully calls the extended function, sending indication information for indicating that the small program successfully calls the extended function to the client.
10. An applet processing apparatus comprising:
the system comprises a newly added code acquisition module, a program execution module and a program execution module, wherein the newly added code acquisition module is used for acquiring newly added codes, the newly added codes comprise a first newly added code which is used for running at a client and a second newly added code which is used for running at a front end, and the first newly added code and the second newly added code are used for expanding the capability of an applet;
the code injection module is used for correspondingly injecting the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through an expansion interface matched with the newly added code;
and the extended function execution module is used for binding the first newly added code and the second newly added code and controlling the currently running applet to execute the corresponding extended function.
11. The apparatus according to claim 10, wherein the code injection module is specifically configured to:
calling a target expansion interface matched with the expansion type through a mapping relation according to the expansion type carried in the newly added code, wherein the mapping relation is the calling relation between the expansion type and the expansion interface;
and correspondingly injecting the first newly added code and the second newly added code into the running environment of the client and the running environment of the front end respectively through the target expansion interface.
12. The apparatus of claim 11, wherein the newly added code is a JS code;
the code injection module is further specifically configured to:
loading the second newly added code to a running environment of a front end through the target expansion interface, so that the second newly added code runs in a WebView environment;
and loading the first added code to the running environment of the client when the small program runs, so that the first added code runs in a jscore environment.
13. The apparatus of claim 11, wherein the extension types include a new addition type and an update type;
the device further comprises: an extension interface calling module; the extension interface calling module is used for:
when the extension type is a new type, the called target extension interface is a new type interface;
and when the extension type is the update type, calling the target extension interface as an update type interface.
14. The apparatus according to any one of claims 11 to 13, wherein the extended function execution module is specifically configured to:
binding the running first newly added code with the running second newly added code, and sending notification information for indicating successful binding to the front end;
and receiving an extended communication protocol corresponding to the second newly added running code sent by the front end, and calling an extended capability function corresponding to the first newly added running code according to the extended communication protocol so that the currently running applet executes an extended function.
15. The apparatus of claim 14, wherein the extended function execution module is further specifically configured to:
calling an extended capability function corresponding to the running first newly added code according to the extended communication protocol so as to indicate the currently running small program to call the extended function;
and if receiving indication information which is sent by the front end and used for indicating that the applet calls the extended function successfully, determining that the applet calls the extended function successfully.
16. The apparatus of claim 15, wherein the newly added code acquisition module is specifically configured to:
acquiring a first extension packet through a client protocol;
acquiring a second extension packet through a front-end protocol;
analyzing the first extension packet to obtain a first newly added code;
analyzing the second extension packet to obtain a second newly added code;
the client protocol is used for representing that a first newly added code obtained through analysis is used for running in a running environment of the client, the front-end protocol is used for representing that a second newly added code obtained through analysis is used for running in a running environment of the front end, the client is a host application program operated by an applet, and the front end is a WLAN network architecture.
17. An applet processing apparatus comprising:
the processing module is used for injecting a second new code into the running environment of the front end by using the client through an expansion interface matched with the second new code running at the front end;
and the execution module is used for sending an extended communication protocol corresponding to the running second newly added code to the client to instruct the client to control the currently running applet to execute a corresponding extended function if receiving notification information which is sent by the client and used for indicating that the first newly added code and the second newly added code are successfully bound after the client injects the first newly added code into a running environment of the client through an extended interface matched with the first newly added code running on the client.
18. The apparatus of claim 17, wherein the apparatus further comprises: a callback module;
the callback module is configured to: and after the extended communication protocol corresponding to the running second newly added code is sent to the client, if the currently running applet successfully calls the extended function, sending indication information for indicating that the applet successfully calls the extended function to the client.
19. 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-9.
20. 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-9.
21. An applet processing method applied to a client, the method comprising:
acquiring newly added codes, wherein the newly added codes comprise first newly added codes and second newly added codes, and the first newly added codes and the second newly added codes are used for expanding the capability of the small program;
and controlling the currently running applet to execute a corresponding extended function according to the first newly added code and the second newly added code.
22. An applet processing method applied to a front end, the method comprising:
injecting a second newly added code for running at the front end into a running environment of the front end through the client;
after a client side injects a first newly added code for running at the client side into a running environment of the client side, if notification information which is sent by the client side and used for indicating that the first newly added code and a second newly added code are successfully bound is received, the client side is instructed to control a currently running applet to execute a corresponding extended function, and the first newly added code and the second newly added code are used for extending the applet capability.
CN202010604377.3A 2020-06-29 2020-06-29 Applet processing method, device, equipment and storage medium Active CN111782218B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010604377.3A CN111782218B (en) 2020-06-29 2020-06-29 Applet processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010604377.3A CN111782218B (en) 2020-06-29 2020-06-29 Applet processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111782218A true CN111782218A (en) 2020-10-16
CN111782218B CN111782218B (en) 2024-03-01

Family

ID=72760252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010604377.3A Active CN111782218B (en) 2020-06-29 2020-06-29 Applet processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111782218B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433788A (en) * 2020-11-23 2021-03-02 百度在线网络技术(北京)有限公司 Applet running method and device, electronic equipment and storage medium
CN112925583A (en) * 2021-02-25 2021-06-08 北京百度网讯科技有限公司 Host application capability expansion method, device, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2423517A1 (en) * 2003-03-26 2004-09-26 Timothy G. Deboer Extensible mechanism for executing server side code
US20120102485A1 (en) * 2010-10-22 2012-04-26 Adobe Systems Incorporated Runtime Extensions
US9471299B1 (en) * 2013-03-25 2016-10-18 Amazon Technologies, Inc. Updating code within an application
CN108647028A (en) * 2018-05-09 2018-10-12 广州腾讯科技有限公司 Application information processing method and device
CN109739770A (en) * 2019-01-04 2019-05-10 百度在线网络技术(北京)有限公司 The adjustment method and device of small routine
CN110659057A (en) * 2019-09-24 2020-01-07 腾讯科技(深圳)有限公司 Application program hot updating method and device, storage medium and computer equipment
CN110865855A (en) * 2019-11-18 2020-03-06 百度在线网络技术(北京)有限公司 Applet processing method and related device
CN111026462A (en) * 2019-12-10 2020-04-17 百度在线网络技术(北京)有限公司 Applet control method, apparatus, device and medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2423517A1 (en) * 2003-03-26 2004-09-26 Timothy G. Deboer Extensible mechanism for executing server side code
US20120102485A1 (en) * 2010-10-22 2012-04-26 Adobe Systems Incorporated Runtime Extensions
US9471299B1 (en) * 2013-03-25 2016-10-18 Amazon Technologies, Inc. Updating code within an application
CN108647028A (en) * 2018-05-09 2018-10-12 广州腾讯科技有限公司 Application information processing method and device
CN109739770A (en) * 2019-01-04 2019-05-10 百度在线网络技术(北京)有限公司 The adjustment method and device of small routine
CN110659057A (en) * 2019-09-24 2020-01-07 腾讯科技(深圳)有限公司 Application program hot updating method and device, storage medium and computer equipment
CN110865855A (en) * 2019-11-18 2020-03-06 百度在线网络技术(北京)有限公司 Applet processing method and related device
CN111026462A (en) * 2019-12-10 2020-04-17 百度在线网络技术(北京)有限公司 Applet control method, apparatus, device and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433788A (en) * 2020-11-23 2021-03-02 百度在线网络技术(北京)有限公司 Applet running method and device, electronic equipment and storage medium
CN112925583A (en) * 2021-02-25 2021-06-08 北京百度网讯科技有限公司 Host application capability expansion method, device, equipment and storage medium
CN112925583B (en) * 2021-02-25 2023-10-27 北京百度网讯科技有限公司 Host application capability extension method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111782218B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
CN111767069B (en) Applet processing method, server, device and storage medium
CN110704136B (en) Method for rendering applet components, client, electronic device and storage medium
CN111625738B (en) APP target page calling method, device, equipment and storage medium
CN111475259B (en) Applet loading method and device and electronic equipment
KR102546578B1 (en) Method, device, equipment and storage medium for obtaining mini program data
CN111767090A (en) Method and device for starting small program, electronic equipment and storage medium
CN111782218B (en) Applet processing method, device, equipment and storage medium
CN111478956A (en) Deployment and preview method and device of small program package
EP4209894A1 (en) Cloud code development system, method, and apparatus, device, and storage medium
CN110659246A (en) Container-based file mounting method and device and electronic equipment
CN111913884A (en) Distributed test method, device, equipment, system and readable storage medium
CN111885114B (en) Method, device and storage medium for upgrading application program interface module in gateway
CN111782229B (en) Method and device for starting small program and electronic equipment
CN111813623B (en) Page monitoring method and device, electronic equipment and storage medium
CN110995504B (en) Micro-service node exception handling method, device and system
CN110543372B (en) Method and device for interaction between native terminal and H5 terminal of mobile terminal
KR102451678B1 (en) Method and apparatus for data processing based on smart contract, device and storage medium
CN111698243B (en) Parameter configuration method and device, electronic equipment and storage medium
CN112764746B (en) Data processing method, device, electronic equipment and storage medium
CN113254217A (en) Service message processing method and device and electronic equipment
CN112130888A (en) Method, device and equipment for updating application program and computer storage medium
JP7147123B2 (en) Source channel determination method, device, equipment, program and computer storage medium
CN111338937B (en) Method, device, equipment and medium for downloading small program intervention
CN114416578A (en) Test method and device
CN112148447B (en) Task processing method and system based on risk control and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant