CN116048600A - Applet function development method, device, computer equipment and storage medium - Google Patents

Applet function development method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116048600A
CN116048600A CN202111279579.6A CN202111279579A CN116048600A CN 116048600 A CN116048600 A CN 116048600A CN 202111279579 A CN202111279579 A CN 202111279579A CN 116048600 A CN116048600 A CN 116048600A
Authority
CN
China
Prior art keywords
function
applet
calling
triggering instruction
target
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
CN202111279579.6A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111279579.6A priority Critical patent/CN116048600A/en
Publication of CN116048600A publication Critical patent/CN116048600A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application relates to an applet function development method, an applet function development device, a computer device and a storage medium. The method comprises the following steps: acquiring a function triggering instruction initiated by an applet; and calling an agent interface provided by the applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction. The method can shorten the development period of the small program function.

Description

Applet function development method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of applet technology, and in particular, to an applet function development method, apparatus, computer device, and storage medium.
Background
With the development of mobile internet technology, applet technology has emerged. The applet is a program built in a host application (App), which integrates an applet Software Development Kit (SDK), and a developer can run on the host App using the applet developed by the applet SDK.
Some apps provide applet base capabilities to a developer to write applet applications, for example, with applet base capabilities of app_1, after a developer writes an applet, it may be published in app_1 or app_2. As shown in fig. 1, app_1 and app_2 each integrate an applet SDK, that is, are host apps, app_1 includes applet application a, applet application B and applet application C, and app_2 includes applet application C, applet application D and applet application E. The applet application C has a self service end and exists in both App_1 and App_2, so that the applet application C can realize the function of cross-process communication. For example, the user M generates a behavior in the applet application C of app_1, uploads the behavior to the applet server, the user M logs in app_2, acquires data from the server, and synchronizes to the applet application C of app_2.
Currently, an applet developer can only realize a certain function through an Application Programming Interface (API), when an interface provided in the applet is insufficient to meet a current service scene, the host App developer can feed back the interface to the applet SDK developer for the complaint, the SDK developer and the applet developer can expand the capability of the service scene (generally, the SDK interface is added or the interface is upgraded), then the applet SDK is packaged and released, and then the host App developer upgrades the interface to complete the call of the interface.
However, the applet SDK integrated inside the host App provides limited capabilities, resulting in limited development of the end capabilities of the applet and longer development cycles.
Disclosure of Invention
In view of the above, it is desirable to provide an applet function development method, apparatus, computer device, and storage medium capable of shortening the applet function development period.
A method of applet function development, the method comprising:
acquiring a function triggering instruction initiated by an applet;
and calling an agent interface provided by an applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
In one embodiment, the incoming parameters include protocol data, and the configuration file includes each calling protocol and its corresponding native function;
determining a target native function according to the input parameters and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction, wherein the method comprises the following steps:
when each calling protocol in the configuration file has a target calling protocol matched with the protocol data, determining a native function corresponding to the target calling protocol as a target native function, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
In one embodiment, the incoming parameters further include module data associated with the protocol data;
the calling the target native function to realize the small program function corresponding to the function triggering instruction comprises the following steps:
and calling the target native function, and realizing the applet function corresponding to the function triggering instruction through the proxy module corresponding to the module data.
In one embodiment, the configuration file further includes callback functions associated with each native function;
after the calling the target native function to realize the applet function corresponding to the function triggering instruction, the method further comprises:
and calling a callback function associated with the target native function, and returning execution result related data of the applet function.
In one embodiment, a proxy interface provided by an applet software development kit is called, an incoming parameter corresponding to the function triggering instruction is received through the proxy interface, a target native function is determined according to the incoming parameter and a configuration file built in the applet software development kit, and the applet function corresponding to the function triggering instruction is realized by calling the target native function, which comprises:
and calling an agent interface provided by an applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, pulling a configuration file built in the applet software development kit, determining a target native function according to the incoming parameter and the configuration file, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
In one embodiment, the method further comprises: and when the target calling protocol matched with the protocol data does not exist in each calling protocol in the configuration file, returning error information.
An applet function development apparatus, the apparatus comprising:
the acquisition module is used for acquiring a function triggering instruction initiated by the applet;
and the calling module is used for calling an agent interface provided by the applet software development kit, receiving the input parameters corresponding to the function triggering instruction through the agent interface, determining a target native function according to the input parameters and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
acquiring a function triggering instruction initiated by an applet;
and calling an agent interface provided by an applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring a function triggering instruction initiated by an applet;
and calling an agent interface provided by an applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
A computer program product comprising a computer program which, when executed by a processor, implements:
acquiring a function triggering instruction initiated by an applet;
and calling an agent interface provided by an applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
The method, the device, the computer equipment and the storage medium for developing the functions of the small program acquire the function triggering instruction initiated by the small program; and calling an agent interface provided by the applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction. Therefore, when the applet needs to develop or expand functions, the target native function can be determined through the proxy interface provided by the software development kit and the built-in configuration file, and then the call of the corresponding function is realized through the target native function, without adding a new interface in the software development kit, thereby reducing or avoiding the manpower loss and time loss brought by the development of the applet software development kit and shortening the development period of the applet function.
Drawings
FIG. 1 is a schematic diagram of applet cross-process communication;
FIG. 2 is an application environment diagram of a method of developing applet functionality in one embodiment;
FIG. 3 is a flow chart of a method of developing a applet function in one embodiment;
FIG. 4 is a functional schematic of a applet in one embodiment;
FIG. 5 is a schematic diagram of a JS mapping table in one embodiment;
FIG. 6 is a schematic diagram illustrating a comparison of a small program development process in one embodiment;
FIG. 7 is a block diagram of a device for developing a applet function in one embodiment;
fig. 8 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The method for developing the small program function can be applied to an application environment shown in fig. 2. The application environment relates to an applet server and a host application program (App), wherein an applet Software Development Kit (SDK) is integrated in the host App, the applet server communicates with the host App through an interface provided by the applet SDK, and the function of the applet is expanded through executing Native behavior of the host App.
In one embodiment, as shown in fig. 3, an applet function development method is provided, and an example of application of the method to the host App in fig. 2 is described, including the following steps S302 to S304.
S302, acquiring a function trigger instruction initiated by the applet.
The function triggering instruction is used for triggering the realization of the applet function. For example, a function trigger instruction may be initiated by a functionality control that triggers an applet page. For example, as shown in fig. 4, when the applet a is developed, it includes canvas, map, shake, acquire mobile phone system information, make phone call, buffer, scan code, share, screen capture, cut-off board, network state, file storage, keyboard use case, web page (http) request, web page view (webview) and other functions, and when one of the function controls is triggered, the applet is considered to initiate a function trigger instruction of the corresponding function.
S304, calling a proxy interface provided by the applet software development kit, receiving an input parameter corresponding to the function trigger instruction through the proxy interface, determining a target native function according to the input parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function trigger instruction.
The proxy interface is a generic interface through which a variety of applet functions can be implemented. The incoming parameter represents a parameter associated with the applet function corresponding to the function trigger instruction, which may be used to characterize the applet function desired to be implemented. The configuration file defines the function of the small program and the calling protocol which can be realized through the native behavior of the host App, and can be jointly defined by the developer of the host App and the developer of the small program. Each calling protocol corresponds to a function, and the module definition of each different protocol function can be dynamically configured. The target native function represents a function existing in the host App for realizing an applet function corresponding to the function trigger instruction.
The input parameters corresponding to the function trigger instruction can be carried in the function trigger instruction, and the host App acquires the carried input parameters from the function trigger instruction after receiving the function trigger instruction initiated by the applet. For example, as shown in fig. 4, when the map control is triggered, the applet initiates a map function triggering instruction, where the map function triggering instruction carries an incoming parameter related to a map function, and after receiving the map function triggering instruction, the host App obtains the incoming parameter related to the map function, and determines, according to the incoming parameter related to the map function and the configuration file, an objective native function for implementing the map function.
Specifically, the incoming parameters include protocol data, the protocol data is used for indicating a calling protocol required for realizing the applet function corresponding to the function triggering instruction, after the host App obtains the protocol data, the calling protocol matched with the protocol data is queried in the configuration file, and then a target native function for realizing the applet function corresponding to the function triggering instruction is determined according to the matched calling protocol. It should be noted that, the configuration file may be updated and maintained according to actual requirements.
For example, when the applet needs to expand a certain function X, the applet developer and the host App developer can define a call protocol of the function X together, after the definition, the applet initiates a trigger instruction of the function X, the host App developer carries the call protocol, adds the call protocol and a corresponding native function for implementing the function X in a configuration file, after the configuration, when the applet initiates the trigger instruction of the function X, the host App obtains the call protocol carried by the trigger instruction of the function X, finds a native function corresponding to the call protocol in the configuration file, and then invokes the native function to implement the function X.
As shown in fig. 5, a schematic diagram of a configuration file in an embodiment is provided, where a key represents a call protocol, a js function segment represents a native function, the configuration file is specifically in a mapping table form, and each line of data corresponds to configuration information of a function. For example, the calling protocol is "loadPage://", which indicates that the corresponding function is loading the map, and the corresponding native function is:
(loadMapPage(){
custom function of function execution after/call to map
})();
The native function is used to implement the function of loading the map. In addition, the callback function can be configured in the configuration file according to actual requirements, and the callback function is used for realizing callback operation after the execution of the applet function.
In this embodiment, a proxy object may be provided for each object through a proxy mode, and the proxy object controls the reference to the original object, where the object refers to an applet, and the proxy object refers to an existing module in the host App, and through the proxy mode, the development function of the applet may be implemented through the existing module in the host App, without an interface for the applet to additionally develop the development function. After a certain module of the host App becomes a proxy object of the applet, monitoring a function trigger event inside the applet, and realizing a corresponding applet function. For example, the map module of the host App monitors map function triggering events inside the applet and implements map related functions.
In one embodiment, the applet SDK adds a proxy interface (CustomDelegate) and adds a proxy method (openModuleWithData: an andCalBack), and the host App developer sets a proxy object, and the proxy object implements the proxy method, thereby implementing the corresponding applet function.
In the method for developing the small program function, a function triggering instruction initiated by the small program is acquired; and calling an agent interface provided by the applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction. Therefore, when the applet needs to develop or expand functions, the target native function can be determined through the proxy interface provided by the software development kit and the built-in configuration file, and then the call of the corresponding function is realized through the target native function, without adding a new interface in the software development kit, thereby reducing or avoiding the manpower loss and time loss brought by the development of the applet software development kit and shortening the development period of the applet function.
In one embodiment, the incoming parameters include protocol data, and the configuration file includes each calling protocol and its corresponding native function; determining a target native function according to the input parameters and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction, wherein the method specifically comprises the following steps: when each calling protocol in the configuration file has a target calling protocol matched with the protocol data, determining a native function corresponding to the target calling protocol as a target native function, and calling the target native function to realize an applet function corresponding to the function triggering instruction.
The calling protocol is used for indicating the small program function to be realized, and the native function corresponding to the calling protocol represents the existing function for realizing the small program function in the host App. And matching in the configuration file based on the protocol data in the input parameters, and taking the call protocol matched in the configuration file as a target call protocol.
The configuration file can specifically use a mapping table form, one calling protocol corresponds to one native function, after the target calling protocol is determined, the corresponding native function can be determined as the target native function through the mapping relation, and then the target native function is called to realize the applet function.
In one embodiment, the mapping table is written using the JavaScript (simply "JS") language, which is a lightweight, interpreted or just-in-time compiled programming language with function priority, and the flexibility of JS is used to develop and debug between the applet and the host App.
As shown in fig. 5, the configuration file is a JS mapping table, where the JS mapping table is divided into three dimensions: the method comprises the steps of key, js function segment and callback, wherein the key represents a calling protocol, the js function segment represents a native function, and the callback is used for representing operation which needs to be fed back after the execution of the applet function. For example, the function corresponding to the protocol loadPage:// "is to load a map; the corresponding function of the protocol phone is call making; the corresponding function of the protocol 'getPhoneNumber://' is to acquire the mobile phone number of the user.
Specifically, when the input parameters comprise protocol data of 'loadPage://', the applet is required to open a map for inquiry or navigation, and if the host App integrates a map function, the host App calls a corresponding js function segment to open the map, so that the function required by the applet is realized. When the incoming parameters comprise protocol data of 'phone://', the applet is required to make a call, and if the host App integrates the call making function, the host App calls the corresponding js function segment to make a call, thereby realizing the function required by the applet. When the input parameters comprise the protocol data of 'getPhoneNumber://', the applet is required to acquire the user mobile phone number, and if the host App integrates the function of acquiring the user mobile phone number, the host App invokes the corresponding js function segment to acquire the user mobile phone number, thereby realizing the function required by the applet.
In one embodiment, when there is no target call protocol matching the protocol data in each call protocol in the configuration file, error information is returned. The fact that the target calling protocol matched with the protocol data does not exist in each calling protocol in the configuration file indicates that the configuration file does not have the capability of realizing the applet function corresponding to the incoming protocol data, and the error can be reported directly through the applet SDK.
In one embodiment, the incoming parameters further include module data associated with the protocol data; the step of calling the applet function corresponding to the function triggering instruction of the target native function may specifically include: and calling a target native function, and realizing an applet function corresponding to the function triggering instruction through an agent module corresponding to the module data.
The module data are used for representing agent modules which are used for realizing the applet functions corresponding to the protocol data in the host App, and different module data correspond to different agent modules. For example, for a map function, the module data corresponding to different map providers a and B are different. For example, the loadMap:// module data associated with the protocol data is represented by a mapType field, if the incoming parameter includes "loadMap:///" protocol data and its associated module data (supposing maptype=1), it means that the applet needs to open a map corresponding to maptype=1 for query or navigation, and then the host App calls the corresponding js function segment and opens the map through a map provider (e.g. map provider a) corresponding to maptype=1, thereby implementing the functions required by the applet; if the input parameters include loadMap:// protocol data and associated module data (supposing maptype=2), the applet is required to open the map corresponding to maptype=2 for query or navigation, and then the host App calls the corresponding js function segment and opens the map through the map provider (e.g. map provider B) corresponding to maptype=2, thereby realizing the functions required by the applet.
In one embodiment, the configuration file further comprises callback functions associated with each native function; after the small program function corresponding to the function triggering instruction is called, the method further comprises the following steps: and calling a callback function associated with the target native function, and returning execution result related data of the applet function.
The callback function (callback) represents a function for realizing callback operation after the execution of the applet function, and can be set according to actual requirements. As shown in fig. 5, each js function segment corresponds to a callback, for example, the callback corresponding to the map function is "mapcalback" for indicating that related data is returned after the map function is executed; callback corresponding to the calling function is null, and is used for indicating that relevant data are not required to be returned after the calling function is executed; the callback corresponding to the function of obtaining the mobile phone number of the user is 'getPhoneNumberCallBack', and is used for indicating to return related data after executing the function of obtaining the mobile phone number of the user. Wherein, the returned related data are agreed by both the applet and the host App.
After the host App determines the target native function (i.e., js function segment), the corresponding callback function is determined by the mapping relationship. The callback function may be an anonymous function, the incoming parameters may also include a callback parameter, it may take a certain time to execute the relevant capability after the host App receives the protocol data, in this process, the user may synchronously perform other operations until the execution of the relevant capability is completed, call the callback function, and return relevant data to the js function segment according to the callback parameter, and operate the subsequent steps in the js function segment.
In one embodiment, a proxy interface provided by an applet software development kit is called, an incoming parameter corresponding to a function trigger instruction is received through the proxy interface, a target native function is determined according to the incoming parameter and a configuration file built in the applet software development kit, and the step of calling the target native function to implement the applet function corresponding to the function trigger instruction specifically includes: and calling an agent interface provided by the applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, pulling a configuration file built in the applet software development kit, determining a target native function according to the incoming parameter and the configuration file, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
The configuration file is built in the applet SDK, after the host App is started, the host App can call methods such as registration, configuration environment, proxy setting and the like of the applet SDK, after the applet SDK is called, the latest configuration file is pulled from the host App server, then a target native function is determined according to the input parameters of the proxy interface and the configuration file, and then the applet function corresponding to the function triggering instruction is called by the target native function.
In the above embodiment, the applet development process is optimized, please refer to fig. 6, and the existing applet development process is shown on the left side of fig. 6, and includes the following procedures: entering applet development; the applet developer finds that some capability on the end cannot be evoked; feedback to host App developer; the host App developer tries to find an ADK related interface; if not, feeding back to the small program SDK developer; an intra-applet auditing stage; the applet SDK developer adds an interface; packaging SDK, and updating host App after version.
The development process of the applet after the optimization of the scheme is shown on the right side of fig. 6, and comprises the following procedures: entering applet development; the applet developer finds that some capability on the end cannot be evoked; call generic API (i.e. proxy interface in previous embodiments); debugging with host App successfully; and (3) finishing function development, and running an internal auditing stage of the applet.
According to the scheme, the agent interface and the configuration file are introduced into the applet SDK, so that the applet function can be realized through the original behavior of the host App, on one hand, the labor loss and the time loss caused by the development of the applet SDK in the development stage can be reduced or avoided, for example, one applet needs to be added with a one-scan function, the configuration file can be modified to add the call protocol and data related to the one-scan function, and a new interface is not required to be added and reissued in the applet SDK, so that the development period of the applet function is shortened.
On the other hand, if the applet SDK provides function interfaces such as call making and clipboard, some privacy of the user may be violated, so that the call of these function interfaces may be limited, and the present solution can reduce such limitation by implementing the applet function through the native behavior of the host App.
On the other hand, if the applet SDK has map and code scanning functions, when the host App integrates the applet SDK, basic capabilities such as map integration and code scanning are attached, if a certain applet needs map capabilities but does not need code scanning capabilities, code segments and resources related to code scanning are added after the applet SDK is integrated, so that the package size of the host App is increased, and unnecessary resource waste is caused. The method and the device realize the function of the applet through the native behavior of the host App, so that the applet SDK does not need to integrate the existing functions of the host App, for example, if the host App has a code scanning function, the applet SDK does not need to integrate the code scanning function, thereby being beneficial to reducing the package size of the host App and saving resources.
In addition, with the above embodiment, some bugs (bugs) can be repaired for online applets as well. Specifically, when a certain function of an online applet fails, if the failed function is integrated in the host App, the failed function can be repaired by the native behavior of the host App. For example, assuming that the code scanning function of the applet itself fails, the code scanning function cannot be called, and the code scanning function is integrated in the host App, at this time, a calling protocol of the code scanning function and a corresponding native function for implementing the code scanning function may be added in a configuration file of the host App, and after the configuration, when the applet triggers the code scanning function again, the host App executes the code scanning function by calling the corresponding native function in the configuration file, thereby implementing repair of the code scanning function of the applet.
It should be understood that, although the steps in the flowcharts related to the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a part of the steps in the flowcharts related to the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages performed is not necessarily sequential, but may be performed alternately or alternately with at least a part of the steps or stages in other steps or other steps.
In one embodiment, as shown in FIG. 7, there is provided an applet function development apparatus 700 comprising: an acquisition module 710 and a call module 720, wherein:
and the acquiring module 710 is configured to acquire a function triggering instruction initiated by the applet.
And the calling module 720 is used for calling the proxy interface provided by the applet software development kit, receiving the input parameters corresponding to the function triggering instruction through the proxy interface, determining the target native function according to the input parameters and the configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
In the small program function development device, acquiring a function triggering instruction initiated by a small program; and calling an agent interface provided by the applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction. Therefore, when the applet needs to develop or expand functions, the target native function can be determined through the proxy interface provided by the software development kit and the built-in configuration file, and then the call of the corresponding function is realized through the target native function, without adding a new interface in the software development kit, thereby reducing or avoiding the manpower loss and time loss brought by the development of the applet software development kit and shortening the development period of the applet function.
In one embodiment, the incoming parameters include protocol data, and the configuration file includes each calling protocol and its corresponding native function; when determining the target native function according to the input parameters and the configuration file built in the applet software development kit, the calling module 720 is specifically configured to: when each calling protocol in the configuration file has a target calling protocol matched with the protocol data, determining a native function corresponding to the target calling protocol as a target native function, and calling the target native function to realize an applet function corresponding to the function triggering instruction.
In one embodiment, the incoming parameters further include module data associated with the protocol data; the calling module 620 is specifically configured to, when calling the applet function corresponding to the function triggering instruction of the target native function: and calling a target native function, and realizing an applet function corresponding to the function triggering instruction through an agent module corresponding to the module data.
In one embodiment, the configuration file further comprises callback functions associated with each native function; the calling module 720 is further configured to, after calling the applet function corresponding to the function triggering instruction for the target native function: and calling a callback function associated with the target native function, and returning execution result related data of the applet function.
In one embodiment, the calling module 720 receives, through the proxy interface, an incoming parameter corresponding to the function triggering instruction when calling the proxy interface provided by the applet software development kit, determines a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and when calling the applet function corresponding to the function triggering instruction, is specifically configured to: and calling an agent interface provided by the applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, pulling a configuration file built in the applet software development kit, determining a target native function according to the incoming parameter and the configuration file, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
In one embodiment, the calling module 720 is further configured to: and when the target calling protocol matched with the protocol data does not exist in each calling protocol in the configuration file, returning error information.
For specific limitations of the applet function development device, reference is made to the above limitation of the applet function development method, and no further description is given here. The respective modules in the above-described applet function development apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 8. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of applet function development.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, storing a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-described method embodiments.
It should be appreciated that the terms "first," "second," and the like in the above embodiments are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Furthermore, in the description of the present application, unless otherwise indicated, the meaning of "plurality" means at least two.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples merely represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. A method of applet function development, the method comprising:
acquiring a function triggering instruction initiated by an applet;
and calling an agent interface provided by an applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
2. The method according to claim 1, wherein the incoming parameters include protocol data, and the configuration file includes each calling protocol and its corresponding native function;
determining a target native function according to the input parameters and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction, wherein the method comprises the following steps:
when each calling protocol in the configuration file has a target calling protocol matched with the protocol data, determining a native function corresponding to the target calling protocol as a target native function, and calling the target function to realize an applet function corresponding to the function triggering instruction.
3. The method according to claim 2, wherein the incoming parameters further comprise module data associated with the protocol data;
the calling the target native function to realize the small program function corresponding to the function triggering instruction comprises the following steps:
and calling the target native function, and realizing the applet function corresponding to the function triggering instruction through the proxy module corresponding to the module data.
4. The method of claim 2, wherein the configuration file further comprises callback functions associated with each of the native functions;
after the calling the target native function to realize the applet function corresponding to the function triggering instruction, the method further comprises:
and calling a callback function associated with the target native function, and returning execution result related data of the applet function.
5. The method of claim 1, wherein invoking a proxy interface provided by an applet software development kit, receiving, via the proxy interface, an incoming parameter corresponding to the function trigger instruction, determining a target native function according to the incoming parameter and a configuration file built in the applet software development kit, invoking the target native function to implement an applet function corresponding to the function trigger instruction, comprising:
and calling an agent interface provided by an applet software development kit, receiving an incoming parameter corresponding to the function triggering instruction through the agent interface, pulling a configuration file built in the applet software development kit, determining a target native function according to the incoming parameter and the configuration file, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
6. The method as recited in claim 2, further comprising: and when the target calling protocol matched with the protocol data does not exist in each calling protocol in the configuration file, returning error information.
7. An applet function development device, said device comprising:
the acquisition module is used for acquiring a function triggering instruction initiated by the applet;
and the calling module is used for calling an agent interface provided by the applet software development kit, receiving the input parameters corresponding to the function triggering instruction through the agent interface, determining a target native function according to the input parameters and a configuration file built in the applet software development kit, and calling the target native function to realize the applet function corresponding to the function triggering instruction.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202111279579.6A 2021-10-28 2021-10-28 Applet function development method, device, computer equipment and storage medium Pending CN116048600A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111279579.6A CN116048600A (en) 2021-10-28 2021-10-28 Applet function development method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111279579.6A CN116048600A (en) 2021-10-28 2021-10-28 Applet function development method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116048600A true CN116048600A (en) 2023-05-02

Family

ID=86116909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111279579.6A Pending CN116048600A (en) 2021-10-28 2021-10-28 Applet function development method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116048600A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116450535A (en) * 2023-06-20 2023-07-18 中国联合网络通信集团有限公司 Sub-application debugging method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116450535A (en) * 2023-06-20 2023-07-18 中国联合网络通信集团有限公司 Sub-application debugging method and device, computer equipment and storage medium
CN116450535B (en) * 2023-06-20 2023-08-29 中国联合网络通信集团有限公司 Sub-application debugging method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109814854B (en) Project framework generation method, device, computer equipment and storage medium
CN111078339B (en) Interface element positioning method and device, computer equipment and storage medium
US20070220242A1 (en) Update-startup apparatus and update-startup control method
CN110413259B (en) Android service framework, method and device for realizing extended service
CN110543327A (en) Service component multiplexing method and device, computer equipment and storage medium
US9519600B2 (en) Driver shimming
CN112363845A (en) Data synchronization method of system integration middling station and integration middling station system
CN112148699B (en) Log management method, device, equipment and medium
CN110018859A (en) Equipment starting method, device, computer equipment and storage medium
CN110727581A (en) Collapse positioning method and electronic equipment
CN116048600A (en) Applet function development method, device, computer equipment and storage medium
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN107239303B (en) Application program update package generation method and device and application program update method and device
CN116643778B (en) Application program optimization method and electronic equipment
CN110377367B (en) Component configuration method and device, electronic terminal and computer readable storage medium
CN114490103A (en) Operating system interface calling method and device and electronic equipment
CN108804236B (en) AIDL file sharing method and system
KR101418390B1 (en) system for remotely debugging an application programming and controlling method therefor
CN109669715A (en) application program dynamic updating method, device and storage medium
US7568197B1 (en) Method and apparatus for interposing kernel symbols
CN111177718A (en) Command execution method and device
US20040181784A1 (en) Method of converting software program for single processor to software program for multiprocessor
JP2002297402A (en) Digital device, task management method and program therefor
US20230280987A1 (en) System and method for controlling execution of call stack frames
CN113821357B (en) Socket-based cross-process communication method, medium 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