Applet function development method and device, computer device and storage medium

CN116048600BActive Publication Date: 2026-09-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111279579.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-28
Publication Date
2026-09-22
Estimated Expiration
2041-10-28

AI Technical Summary

Technical Problem

[0005]然而,在宿主App内部集成的小程序SDK提供的能力有限,导致小程序的端能力开发受到限制,开发周期较长

Benefits of technology

[0034]上述小程序功能开发方法、装置、计算机设备和存储介质,获取小程序发起的功能触发指令;调用小程序软件开发工具包提供的代理接口,通过代理接口接收功能触发指令对应的传入参数,根据传入参数以及小程序软件开发工具包内置的配置文件确定目标原生函数,调用目标原生函数实现功能触发指令对应的小程序功能。据此,当小程序需要开发或扩展功能时,可以通过软件开发工具包提供的代理接口、以及内置的配置文件确定目标原生函数,继而通过目标原生函数实现相应功能的调用,而无需在软件开发工具包中增加新的接口,从而减少或避免小程序软件开发工具包发版带来的人力损耗和时间损耗,缩短小程序功能开发周期。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116048600B_ABST
    Figure CN116048600B_ABST
Patent Text Reader

Abstract

The application relates to a mini-program function development method and device, computer equipment and a storage medium. The method comprises the following steps: obtaining a function trigger instruction initiated by a mini-program; calling a proxy interface provided by a mini-program software development kit, receiving an incoming parameter corresponding to the function trigger instruction through the proxy interface, determining a target native function according to the incoming parameter and a configuration file built in the mini-program software development kit, and calling the target native function to realize a mini-program function corresponding to the function trigger instruction. The method can shorten the development cycle of the mini-program function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of mini-program technology, and in particular to a method, apparatus, computer device, and storage medium for developing mini-program functions. Background Technology

[0002] With the development of mobile internet technology, mini-program technology has emerged. A mini-program is a type of program that is built into a host application (App). The host App integrates a mini-program software development kit (SDK), and mini-programs developed by developers using the mini-program SDK can run on the host App.

[0003] Some apps provide basic mini-program capabilities to developers to create mini-program applications. For example, using the basic mini-program capabilities of App_1, a developer can create a mini-program and publish it in either App_1 or App_2. Figure 1 As shown, both App_1 and App_2 integrate the Mini Program SDK, meaning they are both host apps. App_1 includes Mini Program applications A, B, and C, while App_2 includes Mini Program applications C, D, and E. Mini Program application C has its own server, which exists in both App_1 and App_2, enabling cross-process communication. For example, user M performs an action in Mini Program application C within App_1, which is uploaded to the Mini Program server. User M then logs into App_2, retrieves the data from the server, and synchronizes it to Mini Program application C within App_2.

[0004] Currently, mini-program developers can only implement certain functions through application programming interfaces (APIs). When the interfaces provided within the mini-program are insufficient to meet the current business scenario, the developers of the host app will provide feedback on this request to the mini-program SDK developers. The SDK developers and mini-program developers will then extend the capabilities of the business scenario (usually by adding SDK interfaces or upgrading the interfaces). After the mini-program SDK is packaged and released, the host app developers will upgrade it to complete the API calls.

[0005] However, the capabilities provided by the mini-program SDK integrated within the host app are limited, which restricts the development of mini-program end-to-end capabilities and results in a longer development cycle. Summary of the Invention

[0006] Therefore, it is necessary to provide a method, apparatus, computer equipment, and storage medium for developing mini-program functions that can shorten the development cycle of mini-program functions, in response to the above-mentioned technical problems.

[0007] A method for developing mini-program functions, the method comprising:

[0008] Get the function trigger command initiated by the mini program;

[0009] The proxy interface provided by the mini-program software development kit is called to receive the input parameters corresponding to the function triggering instruction through the proxy interface. The target native function is determined according to the input parameters and the configuration file built into the mini-program software development kit, and the target native function is called to implement the mini-program function corresponding to the function triggering instruction.

[0010] In one embodiment, the input parameters include protocol data, and the configuration file includes each calling protocol and its corresponding native function;

[0011] The step of determining the target native function based on the input parameters and the configuration file built into the mini-program software development kit, and calling the target native function to implement the mini-program function corresponding to the function triggering instruction, includes:

[0012] When there is a target calling protocol in the calling protocols in the configuration file that matches the protocol data, the native function corresponding to the target calling protocol is determined as the target native function, and the target native function is called to implement the mini-program function corresponding to the function triggering instruction.

[0013] In one embodiment, the input parameters also include module data associated with the protocol data;

[0014] The step of calling the target native function to implement the mini-program function corresponding to the function triggering instruction includes:

[0015] The target native function is invoked, and the corresponding mini-program function for the function trigger instruction is implemented through the proxy module corresponding to the module data.

[0016] In one embodiment, the configuration file also includes callback functions associated with each of the native functions;

[0017] After calling the target native function to implement the mini-program function corresponding to the function trigger instruction, the method further includes:

[0018] The callback function associated with the target native function is invoked to return the execution result data of the mini-program function.

[0019] In one embodiment, a proxy interface provided by the mini-program software development kit is invoked. Through the proxy interface, input parameters corresponding to the function triggering instruction are received. Based on the input parameters and the configuration file built into the mini-program software development kit, a target native function is determined. The target native function is then invoked to implement the mini-program function corresponding to the function triggering instruction, including:

[0020] The proxy interface provided by the Mini Program Software Development Kit is invoked to receive the input parameters corresponding to the function triggering instruction through the proxy interface, and the configuration file built into the Mini Program Software Development Kit is retrieved. The target native function is determined according to the input parameters and the configuration file, and the target native function is invoked to implement the Mini Program function corresponding to the function triggering instruction.

[0021] In one embodiment, the method further includes: returning an error message when there is no target calling protocol matching the protocol data among the calling protocols in the configuration file.

[0022] A device for developing mini-program functions, the device comprising:

[0023] The acquisition module is used to acquire function trigger instructions initiated by the mini program;

[0024] The calling module is used to call the proxy interface provided by the mini-program software development kit, receive the input parameters corresponding to the function triggering instruction through the proxy interface, determine the target native function according to the input parameters and the configuration file built into the mini-program software development kit, and call the target native function to implement the mini-program function corresponding to the function triggering instruction.

[0025] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0026] Get the function trigger command initiated by the mini program;

[0027] The proxy interface provided by the mini-program software development kit is called to receive the input parameters corresponding to the function triggering instruction through the proxy interface. The target native function is determined according to the input parameters and the configuration file built into the mini-program software development kit, and the target native function is called to implement the mini-program function corresponding to the function triggering instruction.

[0028] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0029] Get the function trigger command initiated by the mini program;

[0030] The proxy interface provided by the mini-program software development kit is called to receive the input parameters corresponding to the function triggering instruction through the proxy interface. The target native function is determined according to the input parameters and the configuration file built into the mini-program software development kit, and the target native function is called to implement the mini-program function corresponding to the function triggering instruction.

[0031] A computer program product includes a computer program that, when executed by a processor, implements:

[0032] Get the function trigger command initiated by the mini program;

[0033] The proxy interface provided by the mini-program software development kit is called to receive the input parameters corresponding to the function triggering instruction through the proxy interface. The target native function is determined according to the input parameters and the configuration file built into the mini-program software development kit, and the target native function is called to implement the mini-program function corresponding to the function triggering instruction.

[0034] The aforementioned method, apparatus, computer equipment, and storage medium for developing mini-program functions acquire the function triggering instruction initiated by the mini-program; call the proxy interface provided by the mini-program software development kit (SDK), receive the input parameters corresponding to the function triggering instruction through the proxy interface, determine the target native function based on the input parameters and the built-in configuration file of the mini-program SSD, and call the target native function to implement the mini-program function corresponding to the function triggering instruction. Therefore, when a mini-program needs to develop or expand its functions, the target native function can be determined through the proxy interface provided by the SSD and the built-in configuration file, and then the corresponding function can be called through the target native function, without adding new interfaces to the SSD. This reduces or avoids the manpower and time losses caused by releasing mini-program SSDs, and shortens the mini-program function development cycle. Attached Figure Description

[0035] Figure 1 This is a diagram illustrating cross-process communication within a mini-program.

[0036] Figure 2 This is an application environment diagram of a method for developing mini-program functions in one embodiment;

[0037] Figure 3 This is a flowchart illustrating a method for developing mini-program functions in one embodiment;

[0038] Figure 4 This is a functional diagram of a mini-program in one embodiment;

[0039] Figure 5 This is a schematic diagram of a JS mapping table in one embodiment;

[0040] Figure 6 This is a comparative diagram of the mini-program development process in one embodiment;

[0041] Figure 7 This is a structural block diagram of a mini-program function development device in one embodiment;

[0042] Figure 8This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0044] The mini-program feature development method provided in this application can be applied to, for example... Figure 2 The application environment shown involves a mini-program server and a host application (App). The host App integrates a mini-program software development kit (SDK). The mini-program server communicates with the host App through the interfaces provided by the mini-program SDK and extends the functionality of the mini-program by executing the native behavior of the host App.

[0045] In one embodiment, such as Figure 3 As shown, a method for developing mini-program functions is provided, which can be applied to... Figure 2 The following steps, S302 to S304, are used as an example to illustrate the process.

[0046] S302, obtain the function trigger command initiated by the mini program.

[0047] Function trigger commands are used to trigger the implementation of mini-program functions. For example, a function trigger command can be initiated by triggering a function control on the mini-program page. For example, such as... Figure 4 As shown, when developing Mini Program A, it includes functions such as canvas, map, shake to get mobile phone system information, make phone calls, cache, scan code, share, screenshot, clipboard, network status, file storage, keyboard use cases, web page (HTTP) request, and web view. When a certain function control is triggered, it is considered that the Mini Program has initiated a function triggering instruction for the corresponding function.

[0048] S304: Call the proxy interface provided by the Mini Program Software Development Kit, receive the input parameters corresponding to the function triggering instruction through the proxy interface, determine the target native function based on the input parameters and the built-in configuration file of the Mini Program Software Development Kit, and call the target native function to implement the Mini Program function corresponding to the function triggering instruction.

[0049] The proxy interface is a general-purpose interface that enables various mini-program functionalities. Input parameters represent parameters related to the mini-program function corresponding to the function trigger command, and can be used to characterize the desired mini-program function. The configuration file defines the mini-program functions and calling protocols that can be implemented through the host app's native behavior, and can be jointly defined by the host app developers and the mini-program developers. Each calling protocol corresponds to one function, and the module definition for each different protocol function can be dynamically configured. The target native function represents an existing function in the host app used to implement the mini-program function corresponding to the function trigger command.

[0050] The input parameters corresponding to the function trigger command can be carried in the function trigger command itself. After the host App receives the function trigger command initiated by the mini program, it retrieves the input parameters carried in the function trigger command. For example, such as Figure 4 As shown, when the map control is triggered, the mini-program initiates a map function trigger command. This map function trigger command carries input parameters related to the map function. After receiving the map function trigger command, the host app obtains the input parameters related to the map function and determines the target native function to implement the map function based on the input parameters related to the map function and the configuration file.

[0051] Specifically, the input parameters include protocol data, which indicates the calling protocol required to implement the mini-program function corresponding to the function trigger command. After obtaining this protocol data, the host app queries the configuration file for the calling protocol that matches the protocol data, and then determines the target native function used to implement the mini-program function corresponding to the function trigger command based on the matched calling protocol. It should be noted that the configuration file can be updated and maintained according to actual needs.

[0052] For example, when a mini-program needs to extend a certain function X, the mini-program developer can work with the host app developer to define the calling protocol for function X. Once defined, the mini-program will carry the calling protocol when it initiates the trigger command for function X. The host app developer will add the calling protocol and its corresponding native function for implementing function X in the configuration file. After configuration, when the mini-program initiates the trigger command for function X, the host app will obtain the calling protocol carried by the trigger command for function X, find the native function corresponding to the calling protocol in the configuration file, and then call the native function to implement function X.

[0053] like Figure 5The diagram illustrates a configuration file in one embodiment. Here, `key` represents the calling protocol, `js function segment` represents the native function, and the configuration file is in the form of a mapping table, with each line of data corresponding to the configuration information of a function. For example, a calling protocol of "loadPage: / / " indicates that the corresponding function is to load a map, and its corresponding native function is:

[0054] (loadMapPage(){

[0055] / / Custom function executed after calling the map

[0056] })();

[0057] This native function is used to load the map. Additionally, callback functions can be configured in the configuration file to handle callback operations after the mini-program's functions are executed.

[0058] In this embodiment, the proxy pattern provides a proxy object for each object, which controls the reference to the original object. Here, the object refers to the mini-program, and the proxy object refers to an existing module in the host app. The proxy pattern allows the mini-program's extended functionality to be implemented through existing modules in the host app, without requiring the mini-program to develop additional interfaces for these extended functions. After a module of the host app becomes the proxy object of the mini-program, it listens for function trigger events within the mini-program and implements the corresponding mini-program functions. For example, the map module of the host app listens for map function trigger events within the mini-program and implements map-related functions.

[0059] In one embodiment, the mini-program SDK adds a proxy interface (CustomDelegate) and a proxy method (openModuleWithData:andCallBack). The host app developer sets up the proxy object, and the proxy object implements the proxy method to achieve the corresponding mini-program function.

[0060] The aforementioned method for developing mini-program features involves obtaining the feature triggering command initiated by the mini-program; calling the proxy interface provided by the mini-program software development kit (SDK); receiving the input parameters corresponding to the feature triggering command through the proxy interface; determining the target native function based on the input parameters and the built-in configuration file of the mini-program SSD; and calling the target native function to implement the mini-program function corresponding to the feature triggering command. Therefore, when a mini-program needs to develop or expand its features, the target native function can be determined through the proxy interface provided by the SSD and the built-in configuration file, and then the corresponding function can be called through the target native function, without needing to add new interfaces to the SSD. This reduces or avoids the manpower and time losses caused by releasing mini-program SSDs, and shortens the mini-program feature development cycle.

[0061] In one embodiment, the input parameters include protocol data, and the configuration file includes each calling protocol and its corresponding native function. The steps of determining the target native function based on the input parameters and the configuration file built into the mini-program software development kit, and calling the target native function to implement the mini-program function corresponding to the function triggering instruction, may specifically include: when there is a target calling protocol in the configuration file that matches the protocol data, the native function corresponding to the target calling protocol is determined as the target native function, and the target native function is called to implement the mini-program function corresponding to the function triggering instruction.

[0062] The calling protocol indicates the mini-program function to be implemented, and the native function corresponding to the calling protocol represents the existing function in the host app used to implement that mini-program function. Based on the protocol data in the input parameters, a match is made in the configuration file, and the calling protocol matched in the configuration file is used as the target calling protocol.

[0063] The configuration file can be in the form of a mapping table, where one calling protocol corresponds to one native function. After determining the target calling protocol, the corresponding native function can be determined as the target native function through the mapping relationship, and then the target native function is called to implement the function of the mini program.

[0064] In one embodiment, a mapping table is written using JavaScript (JS for short). JS is a lightweight, interpreted or just-in-time compiled programming language with a function-first approach. The flexibility of JS is used to develop and debug between the mini-program and the host App.

[0065] like Figure 5As shown, the configuration file is a JS mapping table, which is divided into three dimensions: key, JS function segment, and callback. The key represents the calling protocol, the JS function segment represents the native function, and the callback is used to indicate the feedback operation required after the mini-program function is executed. For example, the protocol "loadPage: / / " corresponds to the function of loading a map; the protocol "phone: / / " corresponds to the function of making a phone call; and the protocol "getPhoneNumber: / / " corresponds to the function of obtaining the user's phone number.

[0066] Specifically, when the input parameter includes the protocol data "loadPage: / / ", it indicates that the mini-program needs to open a map for querying or navigation. If the host app integrates map functionality, the host app calls the corresponding JavaScript function to open the map, thus achieving the functionality required by the mini-program. When the input parameter includes the protocol data "phone: / / ", it indicates that the mini-program needs to make a phone call. If the host app integrates phone call functionality, the host app calls the corresponding JavaScript function to make the call, thus achieving the functionality required by the mini-program. When the input parameter includes the protocol data "getPhoneNumber: / / ", it indicates that the mini-program needs to obtain the user's phone number. If the host app integrates the function to obtain the user's phone number, the host app calls the corresponding JavaScript function to obtain the user's phone number, thus achieving the functionality required by the mini-program.

[0067] In one embodiment, if no target calling protocol matching the protocol data exists among the calling protocols in the configuration file, an error message is returned. The absence of a target calling protocol matching the protocol data in the configuration file indicates that the configuration file lacks the capability to implement the mini-program functionality corresponding to the passed protocol data, and an error can be directly reported through the mini-program SDK.

[0068] In one embodiment, the input parameters also include module data associated with the protocol data; the step of calling the target native function to implement the mini-program function corresponding to the function triggering instruction may specifically include: calling the target native function and implementing the mini-program function corresponding to the function triggering instruction through the proxy module corresponding to the module data.

[0069] Module data is used to represent the proxy modules in the host App that implement the mini-program functions corresponding to the protocol data. Different module data correspond to different proxy modules. For example, for map functions, the module data corresponding to different map providers A and B are different. For instance, the module data associated with the loadMap: / / protocol data is represented by the mapType field. If the input parameter includes the protocol data "loadMap: / / " and its associated module data (assuming mapType=1), it means that the mini-program needs to open the map corresponding to mapType=1 for querying or navigation. Therefore, the host App calls the corresponding JS function segment and opens the map through the map provider corresponding to mapType=1 (such as map provider A), thereby realizing the function required by the mini-program. If the input parameter includes the loadMap: / / protocol data and its associated module data (assuming mapType=2), it means that the mini-program needs to open the map corresponding to mapType=2 for querying or navigation. Therefore, the host App calls the corresponding JS function segment and opens the map through the map provider corresponding to mapType=2 (such as map provider B), thereby realizing the function required by the mini-program.

[0070] In one embodiment, the configuration file also includes callback functions associated with each native function; after calling the target native function to implement the mini-program function corresponding to the function trigger instruction, the following steps are also included: calling the callback function associated with the target native function and returning the execution result data of the mini-program function.

[0071] A callback function is a function used to perform callback operations after a function in a mini-program is executed. It can be set according to actual needs. For example... Figure 5 As shown, each JavaScript function segment corresponds to a callback. For example, the callback for the map function is "mapCallBack," which indicates that relevant data should be returned after executing the map function; the callback for the phone call function is "null," which indicates that no relevant data needs to be returned after executing the phone call function; and the callback for the function to get the user's phone number is "getPhoneNumberCallBack," which indicates that relevant data should be returned after executing the function to get the user's phone number. The specific data to be returned is agreed upon by both the mini-program and the host app.

[0072] After the host app identifies the target native function (i.e., the JavaScript function segment), it determines the corresponding callback function through a mapping relationship. The callback function can be an anonymous function, and the input parameters can also include a callback parameter. After the host app receives the protocol data, executing the relevant capabilities may take some time. During this process, the user can perform other operations simultaneously until the relevant capabilities are executed. Then, the callback function is called, and relevant data is returned to the JavaScript function segment based on the callback parameter. The JavaScript function segment then performs subsequent steps.

[0073] In one embodiment, the steps of calling the proxy interface provided by the mini-program software development kit, receiving the input parameters corresponding to the function triggering instruction through the proxy interface, determining the target native function based on the input parameters and the configuration file built into the mini-program software development kit, and calling the target native function to implement the mini-program function corresponding to the function triggering instruction may specifically include: calling the proxy interface provided by the mini-program software development kit, receiving the input parameters corresponding to the function triggering instruction through the proxy interface, retrieving the configuration file built into the mini-program software development kit, determining the target native function based on the input parameters and the configuration file, and calling the target native function to implement the mini-program function corresponding to the function triggering instruction.

[0074] The configuration file is built into the Mini Program SDK. After the host App starts, the host App will call the Mini Program SDK's registration, environment configuration, and proxy settings. After calling the Mini Program SDK, it will retrieve the latest configuration file from the host App's server, determine the target native function based on the parameters passed to the proxy interface and the configuration file, and then call the target native function to implement the Mini Program function corresponding to the function triggering command.

[0075] The above embodiments have optimized the mini-program development process; please refer to [the documentation / reference]. Figure 6 The existing mini-program development process is as follows: Figure 6 As shown on the left, the process includes the following steps: entering the mini-program development stage; the mini-program developer discovers that certain capabilities on the client cannot be invoked; feedback is given to the host app developer; the host app developer attempts to find the ADK-related interfaces; if not found, feedback is given to the mini-program SDK developer; the mini-program undergoes internal review; the mini-program SDK developer adds interfaces; the host app updates after the SDK is packaged and released.

[0076] The optimized mini-program development process according to this solution is as follows: Figure 6 As shown on the right, the process includes the following steps: entering the mini-program development stage; the mini-program developer discovers that certain capabilities on the client cannot be invoked; calling the general API (i.e., the proxy interface in the previous example); successful debugging with the host App; the function development is completed, and the mini-program goes through the internal review stage.

[0077] Accordingly, this solution introduces proxy interfaces and configuration files into the mini-program SDK, enabling mini-program functions to be implemented through the native behavior of the host app. On the one hand, it can reduce or avoid the manpower and time losses caused by the release of mini-program SDK during the development phase of mini-programs. For example, if a mini-program needs to add a scan function, the call protocol and data related to the scan function can be added by modifying the configuration file, without adding new interfaces to the mini-program SDK and redeploying, thereby shortening the mini-program function development cycle.

[0078] On the other hand, if the mini-program SDK provides functional interfaces such as making phone calls and clipboard access, it may infringe on some user privacy, which would restrict the use of these functional interfaces. This solution reduces such restrictions by implementing mini-program functions through the native behavior of the host app.

[0079] On the other hand, if the mini-program SDK has map and QR code scanning functions, the host app will integrate these basic capabilities along with the SDK. If a mini-program requires map functionality but not QR code scanning, integrating the SDK will increase the amount of code and resources related to QR code scanning, thus increasing the size of the host app and causing unnecessary resource waste. This solution, however, implements mini-program functionality through the host app's native behavior, eliminating the need for the mini-program SDK to integrate existing host app features. For example, if the host app itself has QR code scanning functionality, the mini-program SDK does not need to integrate it, thereby reducing the host app's size and saving resources.

[0080] Furthermore, the above embodiments can also fix some vulnerabilities (bugs) in already launched mini-programs. Specifically, for an already launched mini-program, when a certain function of the mini-program malfunctions, if the host app integrates the malfunctioning function, the malfunctioning function can be fixed through the native behavior of the host app. For example, suppose the mini-program's built-in QR code scanning function malfunctions, preventing it from being invoked. Since the host app integrates a QR code scanning function, the QR code scanning function's calling protocol and its corresponding native function for implementing the QR code scanning function can be added to the host app's configuration file. After configuration, when the mini-program triggers the QR code scanning function again, the host app executes the QR code scanning function by calling the corresponding native function in the configuration file, thereby fixing the mini-program's QR code scanning function.

[0081] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0082] In one embodiment, such as Figure 7 As shown, a mini-program function development device 700 is provided, including: an acquisition module 710 and a calling module 720, wherein:

[0083] The acquisition module 710 is used to acquire the function triggering instructions initiated by the mini program.

[0084] Module 720 is used to call the proxy interface provided by the Mini Program Software Development Kit. It receives the input parameters corresponding to the function triggering instruction through the proxy interface, determines the target native function based on the input parameters and the built-in configuration file of the Mini Program Software Development Kit, and calls the target native function to implement the Mini Program function corresponding to the function triggering instruction.

[0085] The aforementioned mini-program function development device acquires the function trigger command initiated by the mini-program; calls the proxy interface provided by the mini-program software development kit (SDK), receives the input parameters corresponding to the function trigger command through the proxy interface, determines the target native function based on the input parameters and the built-in configuration file of the mini-program SSD, and calls the target native function to implement the mini-program function corresponding to the function trigger command. Therefore, when a mini-program needs to develop or expand its functions, it can determine the target native function through the proxy interface provided by the SSD and the built-in configuration file, and then implement the corresponding function call through the target native function, without adding new interfaces to the SSD. This reduces or avoids the manpower and time losses caused by releasing mini-program SSDs, and shortens the mini-program function development cycle.

[0086] In one embodiment, the input parameters include protocol data, and the configuration file includes each calling protocol and its corresponding native function. When the calling module 720 determines the target native function based on the input parameters and the configuration file built into the mini-program software development kit, and calls the target native function to implement the mini-program function corresponding to the function triggering instruction, it is specifically used to: when there is a target calling protocol in each calling protocol in the configuration file that matches the protocol data, determine the native function corresponding to the target calling protocol as the target native function, and call the target native function to implement the mini-program function corresponding to the function triggering instruction.

[0087] In one embodiment, the input parameters also include module data associated with the protocol data; when calling the target native function to implement the mini-program function corresponding to the function triggering instruction, the calling module 620 is specifically used to: call the target native function and implement the mini-program function corresponding to the function triggering instruction through the proxy module corresponding to the module data.

[0088] In one embodiment, the configuration file also includes callback functions associated with each native function; after the calling module 720 calls the target native function to implement the mini-program function corresponding to the function triggering instruction, it is also used to: call the callback function associated with the target native function and return the execution result related data of the mini-program function.

[0089] In one embodiment, when the calling module 720 calls the proxy interface provided by the mini-program software development kit, receives the input parameters corresponding to the function trigger instruction through the proxy interface, determines the target native function based on the input parameters and the configuration file built into the mini-program software development kit, and calls the target native function to implement the mini-program function corresponding to the function trigger instruction, it is specifically used to: call the proxy interface provided by the mini-program software development kit, receive the input parameters corresponding to the function trigger instruction through the proxy interface, retrieve the configuration file built into the mini-program software development kit, determine the target native function based on the input parameters and the configuration file, and call the target native function to implement the mini-program function corresponding to the function trigger instruction.

[0090] In one embodiment, the calling module 720 is further configured to: return an error message when there is no target calling protocol matching the protocol data in each calling protocol in the configuration file.

[0091] Specific limitations regarding the mini-program function development device can be found in the limitations on the mini-program function development method described above, and will not be repeated here. Each module in the aforementioned mini-program function development device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0092] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a small program function development method.

[0093] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0094] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0095] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0096] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.

[0097] It should be understood that the terms "first," "second," etc., used in the above embodiments are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means at least two.

[0098] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0099] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0100] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for developing mini-program functions, characterized in that, The method includes: Get the function trigger command initiated by the mini program; Call the proxy interface provided by the mini-program software development kit, and receive the input parameters corresponding to the function triggering instruction through the proxy interface. The input parameters include protocol data, which is used to indicate the calling protocol required to implement the mini-program function corresponding to the function triggering instruction. When a target calling protocol matching the protocol data exists in the calling protocols of the configuration file built into the mini-program software development kit, the native function corresponding to the target calling protocol is determined as the target native function, and the target native function is called to implement the mini-program function corresponding to the function triggering instruction; the configuration file includes mini-program functions and calling protocols implemented through the host APP, each calling protocol corresponds to a native function, and the native function is a function already existing in the host APP used to implement mini-program functions.

2. The method according to claim 1, characterized in that, The input parameters also include module data associated with the protocol data; The step of calling the target native function to implement the mini-program function corresponding to the function triggering instruction includes: The target native function is invoked, and the mini-program function corresponding to the function trigger instruction is implemented through the proxy module corresponding to the module data.

3. The method according to claim 1, characterized in that, The configuration file also includes callback functions associated with each of the native functions; After calling the target native function to implement the mini-program function corresponding to the function trigger instruction, the method further includes: The callback function associated with the target native function is invoked to return the execution result data of the mini-program function.

4. The method according to claim 1, characterized in that, The method also includes: The proxy interface provided by the Mini Program Software Development Kit is invoked to receive the input parameters corresponding to the function triggering instruction through the proxy interface, and the configuration file built into the Mini Program Software Development Kit is retrieved. The target native function is determined according to the input parameters and the configuration file, and the target native function is invoked to implement the Mini Program function corresponding to the function triggering instruction.

5. The method according to claim 1, characterized in that, Also includes: An error message is returned if no target calling protocol matching the protocol data is found in any of the calling protocols in the configuration file.

6. A device for developing mini-program functions, characterized in that, The device includes: The acquisition module is used to acquire function trigger instructions initiated by the mini program; The calling module is used to call the proxy interface provided by the Mini Program Software Development Kit (MSDK). It receives input parameters corresponding to the function triggering instruction through the proxy interface. These input parameters include protocol data, which indicates the calling protocol required to implement the Mini Program function corresponding to the function triggering instruction. When a target calling protocol matching the protocol data exists in the configuration file built into the MSDK, the native function corresponding to the target calling protocol is determined as the target native function, and the target native function is called to implement the Mini Program function corresponding to the function triggering instruction. The configuration file includes the Mini Program function implemented through the host APP and the calling protocol. Each calling protocol corresponds to a native function, which is an existing function in the host APP used to implement the Mini Program function.

7. The apparatus according to claim 6, characterized in that, The input parameters also include module data associated with the protocol data; the calling module is used to call the target native function and implement the mini-program function corresponding to the function triggering instruction through the proxy module corresponding to the module data.

8. The apparatus according to claim 6, characterized in that, The configuration file also includes callback functions associated with each of the native functions; after the calling module calls the target native function to implement the mini-program function corresponding to the function triggering instruction, it is also used to call the callback function associated with the target native function and return the execution result related data of the mini-program function.

9. The apparatus according to claim 6, characterized in that, The calling module is used to call the proxy interface provided by the mini-program software development kit, receive the input parameters corresponding to the function triggering instruction through the proxy interface, pull the configuration file built into the mini-program software development kit, determine the target native function according to the input parameters and the configuration file, and call the target native function to implement the mini-program function corresponding to the function triggering instruction.

10. The apparatus according to claim 6, characterized in that, The calling module is also used to return an error message when there is no target calling protocol that matches the protocol data in each calling protocol in the configuration file.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Calling processing method and device, and communication system

    CN108694040A

  • SDK calling method and device, computer equipment and storage medium

    CN111666116A