Applet calling method, detection method, device and system
By using cloud functions on the cloud platform to execute the backend services of mini-programs, the problem of low reliability of mini-program backend services is solved, and higher call reliability and flexibility are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2022-03-30
- Publication Date
- 2026-04-28
AI Technical Summary
The backend services of mini-programs are maintained by developers, which leads to lower reliability and accuracy, affecting the reliability and flexibility of calls.
By maintaining the backend services of the mini-program through the cloud platform, executing the backend code using cloud functions, generating the running results and displaying them on the front-end interface, the reliability and flexibility of the call are improved.
It improves the reliability and flexibility of the mini-program calling process, avoiding the low reliability problem caused by developers maintaining backend services.
Smart Images

Figure CN114924890B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to computer and cloud platform technologies, specifically cloud computing, and can be applied to applications and mini-programs. In particular, it relates to a method for invoking, detecting, a device for, and a system for mini-programs. Background Technology
[0002] A mini-program is an application that can be used without downloading or installing it; users can use mini-programs through the application.
[0003] For example, a mini-program can include two parts: a front-end interface and back-end services. The back-end services are usually deployed and maintained by the mini-program developer. After the mini-program is developed, it can be published to the mini-program app market through the mini-program publishing platform. Users can search for the corresponding mini-program in the app market through the applications downloaded on their devices, and can load and use the mini-program in their applications by clicking on it. Summary of the Invention
[0004] This disclosure provides a method, detection method, apparatus, and system for invoking and detecting mini-programs to improve their reliability.
[0005] According to a first aspect of this disclosure, a method for invoking a mini-program is provided, the method being applied to a cloud platform, comprising:
[0006] Receive a user's request to invoke the backend service of a mini-program initiated by the user's device, wherein the mini-program includes a frontend interface and the backend service;
[0007] According to the call request, the cloud function corresponding to the mini-program is obtained and executed to obtain the execution result, wherein the cloud function is used to determine the content displayed on the front-end interface;
[0008] The running results are sent to the user device, wherein the running results and the front-end interface loaded by the user device generate the display interface of the mini-program.
[0009] According to a second aspect of this disclosure, a method for detecting mini-programs is provided, the method being applied to a cloud platform, comprising:
[0010] Obtain a response message, wherein the response message is used to characterize the process information for generating and storing the running result, and the running result is generated by calling and running the cloud function of the mini program;
[0011] The running result is extracted based on the response message, and the detection result of the mini-program is determined based on the running result, wherein the detection result indicates whether the mini-program is legal.
[0012] According to a third aspect of this disclosure, a device for invoking a mini-program is provided, the device being applied to a cloud platform, comprising:
[0013] The first receiving unit is used to receive a call request initiated by a user based on a user device to call the backend service of a mini-program, wherein the mini-program includes a front-end interface and the backend service.
[0014] The running unit is used to obtain and run the cloud function corresponding to the mini-program according to the call request, and obtain the running result, wherein the cloud function is used to determine the content displayed on the front-end interface;
[0015] A sending unit is used to send the running results to the user device, wherein the running results and the front-end interface loaded by the user device generate the display interface of the mini-program.
[0016] According to a fourth aspect of this disclosure, a detection device for a mini-program is provided, the device being applied to a cloud platform, comprising:
[0017] An acquisition unit is used to acquire a response message, wherein the response message is used to characterize the process information for generating and storing the running result, and the running result is generated by calling and running the cloud function of the mini-program;
[0018] Extraction unit, used to extract the running result based on the response message;
[0019] A determining unit is used to determine the detection result of the mini-program based on the running result, wherein the detection result indicates whether the mini-program is legal.
[0020] According to a fifth aspect of this disclosure, an electronic device is provided, comprising:
[0021] At least one processor; and
[0022] A memory communicatively connected to the at least one processor; wherein,
[0023] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect or the second aspect.
[0024] According to a sixth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method according to the first or second aspect.
[0025] According to a seventh aspect of this disclosure, a computer program product is provided, the computer program product comprising: a computer program stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, the at least one processor executing the computer program causing the electronic device to perform the method described in the first aspect or the second aspect.
[0026] According to the eighth aspect of this disclosure, a mini-program invocation system is provided, comprising: a user device and a mini-program invocation device as described in the third aspect, wherein the user device is configured to initiate an invocation request to the mini-program invocation device to invoke the backend service of the mini-program, wherein the mini-program includes a frontend interface and the backend service.
[0027] According to the technical features disclosed herein, when a call request is received, the cloud function corresponding to the mini-program is called and executed from the cloud platform to obtain the running result, and the display interface is generated based on the running result and the front-end interface. This avoids the drawback of low reliability of mini-program calls caused by mini-program developers maintaining back-end services through servers. Furthermore, by realizing the call to the mini-program based on the execution of cloud functions, the flexibility and reliability of mini-program calls are improved.
[0028] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0029] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0030] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure;
[0031] Figure 2 This is a schematic diagram according to the second embodiment of the present disclosure;
[0032] Figure 3 This is a schematic diagram illustrating the principle of the method for invoking a mini-program according to an embodiment of this disclosure;
[0033] Figure 4 This is a schematic diagram according to the third embodiment of the present disclosure;
[0034] Figure 5 This is a schematic diagram according to the fourth embodiment of the present disclosure;
[0035] Figure 6 This is a schematic diagram illustrating the principle of the detection method for mini-programs according to embodiments of this disclosure;
[0036] Figure 7This is a schematic diagram according to the fifth embodiment of the present disclosure;
[0037] Figure 8 This is a schematic diagram according to the sixth embodiment of the present disclosure;
[0038] Figure 9 This is a schematic diagram according to the seventh embodiment of the present disclosure;
[0039] Figure 10 This is a schematic diagram according to the eighth embodiment of the present disclosure;
[0040] Figure 11 This is a schematic diagram according to the ninth embodiment of the present disclosure;
[0041] Figure 12 This is a block diagram of an electronic device used to implement the applet detection method and applet invocation method of the embodiments of this disclosure. Detailed Implementation
[0042] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0043] A mini-program is a sub-application feature embedded within an application (APP). Its advantage lies in the fact that users can use this sub-application feature without installing any additional software packages. For mini-program developers, the development threshold is relatively low, and they can leverage the overall traffic of their parent application, thus saving costs.
[0044] A mini-program can consist of two parts: a front-end interface and back-end services. The back-end services are usually deployed and maintained by the mini-program developer. After the mini-program is developed, it can be published to the mini-program app store through the mini-program publishing platform. Users can search for the corresponding mini-program in the app store through the applications downloaded on their devices, and can load and use the mini-program by clicking on it.
[0045] In some embodiments, a mini-program includes a front-end interface and a back-end service. Users can search for the corresponding mini-program in the app store based on their device and click on the mini-program. The application can then load the front-end interface of the mini-program from the app store. The back-end service is implemented by a server, such as the server of the mini-program developer.
[0046] Taking a shopping mini-program as an example, the application can load the front-end interface of the shopping mini-program from the application scenario based on the user's click operation. When the user adjusts the information on the front-end interface, such as adding a product to the shopping cart, the back-end service of the server is triggered, and the server generates data corresponding to "adding a product to the shopping cart" and displays it on the front-end interface.
[0047] However, since the backend services are maintained by the developers of the mini-program, there may be drawbacks such as lower accuracy and reliability of the backend services.
[0048] Through creative work, the inventors of this disclosure arrived at the inventive concept of this disclosure: the backend service is maintained by the cloud platform, and specifically maintained through cloud functions.
[0049] Based on the above inventive concept, this disclosure provides a method, detection method, device and system for calling mini-programs, which relates to computer and cloud platform technologies, specifically cloud computing, and can be applied to applications and mini-programs to improve the reliability of mini-program calls.
[0050] Figure 1 This is a schematic diagram based on the first embodiment of this disclosure, wherein the method for calling a mini-program in this embodiment is applied to a cloud platform, such as... Figure 1 As shown, the method includes:
[0051] S101: Receives a user's request to invoke the backend services of the mini-program, initiated by the user's device. The mini-program includes a frontend interface and backend services.
[0052] For example, the execution entity in this embodiment can be a mini-program calling device (hereinafter referred to as the calling device), and the calling device can be a server and processor deployed on a cloud platform, etc. This embodiment does not limit it.
[0053] Based on the above analysis, in some embodiments, an application can be downloaded on the user device. The user can call the mini-program through the application on the user device. For example, when the mini-program is a shopping mini-program, the user can make purchases based on the shopping mini-program, and when the mini-program is a weather mini-program, the user can obtain weather information based on the weather mini-program, and so on. These will not be listed one by one here.
[0054] Users can initiate a request to the calling device via touch or voice control; this embodiment does not limit the specific method.
[0055] S102: Obtain and run the cloud function corresponding to the mini-program based on the call request, and obtain the running result. The cloud function is used to determine the content displayed on the front-end interface.
[0056] Cloud functions provide the ability to run stateless, ephemeral, event-triggered code directly on a cloud platform.
[0057] For example, in this embodiment, the calling device can invoke a request to obtain a cloud function and execute the cloud function to trigger the backend code of the backend service, thereby obtaining the execution result, that is, the content to be displayed on the frontend interface. For example, the execution result can be the quantity information of the shopping cart mentioned in the above embodiment.
[0058] S103: Send the execution results to the user device. The execution results, along with the front-end interface loaded on the user device, generate the display interface of the mini-program.
[0059] For example, after the calling device executes the cloud function and obtains the result, it can send the result to the application client of the user device so that the client can refresh the front-end interface based on the result.
[0060] For example, in the above example, if the quantity in the shopping cart is 0, the result is to increment the quantity in the shopping cart by 1, that is, the quantity in the shopping cart is 1. Accordingly, a display interface is generated based on this execution result, showing that the quantity in the shopping cart is 1.
[0061] Based on the above analysis, this disclosure provides a method for invoking a mini-program. This method can be applied to a cloud platform. The method includes: receiving a user's request to invoke the backend service of the mini-program initiated by the user's device, wherein the mini-program includes a front-end interface and a back-end service; obtaining and running a cloud function corresponding to the mini-program according to the request; obtaining the execution result; wherein the cloud function is used to determine the content to be displayed on the front-end interface; sending the execution result to the user's device; wherein the execution result and the front-end interface loaded on the user's device generate the display interface of the mini-program. In this embodiment, by invoking and executing the cloud function corresponding to the mini-program from the cloud platform when the request is received, and obtaining the execution result, the technical feature of generating the display interface based on the execution result and the front-end interface avoids the drawback of low reliability of mini-program invocation caused by the mini-program developer maintaining the backend service through the server. Furthermore, by realizing the invocation of the mini-program based on the execution of the cloud function, the flexibility and reliability of mini-program invocation are improved.
[0062] Figure 2 This is a schematic diagram based on the second embodiment of the present disclosure, wherein the method for invoking a mini-program in this embodiment is applied to a cloud platform, such as... Figure 2 As shown, the method includes:
[0063] S201: Outputs configuration requirements for implementing backend services.
[0064] It should be understood that, in order to avoid tedious descriptions, the same technical features as those in the above embodiments will not be repeated in this embodiment.
[0065] Among them, the configuration requirement information can be used to implement backend services, that is, the configuration requirement information is the configuration requirement to implement backend services.
[0066] In some embodiments, the cloud platform can pre-set development template code for the mini-program and publish the development template code to a template publishing platform (or template marketplace). Since a mini-program includes a front-end interface and back-end services, the development template code can include front-end template code and back-end template code. The front-end template code can be used to generate the front-end interface, and the back-end template code can be used to implement the back-end services. The back-end template code may include configuration requirement information.
[0067] For example, cloud platforms can provide mini-program developers with a mini-program development panel (i.e., mini-program development tools). Developers can download development template code from this panel, obtaining both front-end and back-end template code. Correspondingly, developers can obtain configuration requirements information through the mini-program development panel.
[0068] S202: Receive configuration content input based on configuration requirement information, and generate a cloud function according to the configuration content. The cloud function is used to determine the content displayed on the front-end interface.
[0069] Based on the above analysis, after obtaining configuration requirements through the mini-program development panel, mini-program developers can input configuration content through the panel. Correspondingly, the cloud platform obtains the configuration content and generates cloud functions based on it.
[0070] In this embodiment, by combining the configuration content to generate cloud functions, the cloud functions can be highly associated with the implementation of backend services. This allows the backend code used to execute backend services to be triggered when the cloud function runs, thereby improving the reliability and effectiveness of calling the mini-program.
[0071] In some embodiments, the configuration requirement information includes resource configuration categories and backend template code, and S202 may include the following steps:
[0072] The first step is to obtain the resource configuration information based on the resource configuration category input, and the backend code used to implement the backend service based on the backend template code input. The configuration content includes both resource configuration information and backend code.
[0073] For example, resource configuration categories refer to the types (or categories) of configured resources. For instance, resource configuration categories include: memory size, timeout, code URI, function execution method entry point information, and runtime, etc., which will not be listed here.
[0074] For example, the cloud platform outputs resource configuration categories, such as memory size. Mini-program developers can fill in the memory size, such as 128 gigabytes (GB). Correspondingly, the cloud platform can obtain the resource configuration information, and this resource configuration information indicates that the mini-program's memory is 128GB.
[0075] Different mini-programs require different backend code. The cloud platform can output backend template code, which mini-program developers can then input into the mini-program development panel based on the functions they need to implement. Correspondingly, the cloud platform can obtain the backend code based on the mini-program development panel.
[0076] For example, such as Figure 3 As shown, the cloud platform can provide mini-program developers with a mini-program development panel. The cloud platform may include a cloud development platform (CBD), which can receive resource configuration information and backend code transmitted by the mini-program development panel. The mini-program development panel or the cloud development platform can generate a resource configuration (template.yaml) file based on the resource configuration information.
[0077] like Figure 3 As shown, the cloud platform can also include a cloud database (RDS). After obtaining the backend code, the cloud development platform can store the backend code in the cloud database. Each mini-program developer has a user identifier to distinguish different mini-program developers, and mini-programs can also have identifiers to distinguish different mini-programs. Therefore, the mini-program developer's identifier, the mini-program's identifier, and information about the mini-program's cloud functions can also be stored in the cloud database.
[0078] The second step: Generate cloud functions based on resource configuration information and backend code.
[0079] For example, combining the above analysis and Figure 3 As shown, the cloud platform may also include a Function Compute Platform (CFC). The cloud development platform transmits resource configuration information and backend code to the Function Compute Platform, which then generates cloud functions based on the resource configuration information and backend code.
[0080] In this embodiment, cloud functions are generated by combining resource configuration information and backend code. This is equivalent to generating cloud functions from two dimensions: resources and the implementation of backend services, so that cloud functions have high reliability and accuracy.
[0081] S203: Receive a user's request to invoke the backend services of the mini-program, initiated by the user's device. The mini-program includes a frontend interface and backend services.
[0082] In some embodiments, such as Figure 3 As shown, the cloud platform can publish development template code to the template marketplace, and the cloud platform can also pre-divide the mini-program's page into multiple components based on functions, such as buttons, tables, header banners, and carousel sections, and publish each component to the component marketplace (or component platform).
[0083] Correspondingly, mini-program developers can download components from the component market through the mini-program development panel to implement the front-end interface of the mini-program, and develop the mini-program front-end interface based on the front-end template code and the downloaded components.
[0084] like Figure 3 As shown, mini-program developers can transmit the front-end interface to the mini-program publishing platform, which will then review the interface to see if it meets the publishing requirements. If it does, the mini-program publishing platform can publish the mini-program to the mini-program market (such as an app store).
[0085] Accordingly, based on the above analysis, when a user needs to use a mini-program, they can search for the mini-program in the mini-program marketplace through the application, and load the front-end interface of the mini-program in the application by clicking on the mini-program (i.e., opening the mini-program), and then initiate a call request to the cloud platform (specifically the function computing platform in the cloud platform), which is to call the back-end service of the mini-program.
[0086] S204: Obtain resource configuration information for cloud functions and backend services based on the call request.
[0087] For example, the call request carries the identifier of the mini-program, and the cloud platform can obtain cloud function and resource configuration information based on the identifier to improve the efficiency and reliability of obtaining cloud function and resource configuration information.
[0088] In some embodiments, combining the above analysis and Figure 3 As shown, after generating cloud functions, the Function Compute platform can store them in the Object Storage Platform (BOS). Correspondingly, when the Function Compute platform receives a call request, it can retrieve the cloud function from the Object Storage Platform and obtain resource configuration information from the cloud database.
[0089] S205: Based on the cloud function and resource configuration information, execute the backend code used to implement the backend service and obtain the running result. The running result, along with the frontend interface loaded on the user's device, generates the display interface of the mini-program.
[0090] In this embodiment, cloud functions can be used to determine the content displayed on the front-end interface, and resource configuration information is related to the resources used to implement back-end services. Therefore, by combining cloud functions and resource configuration information to determine the running result, the running result can have high accuracy and reliability.
[0091] In some embodiments, the resource configuration information includes the path information of the backend code; S205 may include the following steps:
[0092] First step: Obtain the backend code based on the path information.
[0093] The second step: Run the cloud function to execute the backend code and obtain the results.
[0094] For example, based on the above analysis, resource configuration categories can include code paths. Correspondingly, resource configuration information can include backend code path information (i.e., the specific content of the code path). The Function Compute platform can retrieve backend code from the cloud database based on the path information and run cloud functions to trigger the execution of the backend code, thereby obtaining the execution results.
[0095] In this embodiment, obtaining the backend code through path information can improve the efficiency and reliability of obtaining the backend code, thereby improving the efficiency and accuracy of obtaining the running results.
[0096] In some embodiments, the resource configuration information may also include function execution method entry information; the second step may include: running the cloud function to execute the backend code according to the function execution method entry information and obtain the running result.
[0097] In this embodiment, by combining the entry information of the function execution method to obtain the running result, asynchronous callback of the call request can be realized. When there are multiple call requests, the call request can be automatically expanded or shrunk, thereby meeting the call requests in multi-user scenarios, improving the flexibility and effectiveness of calling the mini-program, and meeting the mini-program usage needs of each user.
[0098] Figure 4 This is a schematic diagram based on the third embodiment of the present disclosure, wherein the applet detection method of the present disclosure is applied to a cloud platform, such as... Figure 4 As shown, the method includes:
[0099] S401: Obtain the response message. The response message is used to characterize the process information for generating and storing the execution result, which is generated by calling and running the mini-program's cloud function.
[0100] For example, the execution subject of the mini-program detection method in this embodiment can be a mini-program detection device (hereinafter referred to as the detection device). The detection device can be the same as the calling device or a different device than the calling device. This embodiment does not limit the device.
[0101] Similarly, to avoid tedious descriptions, the same technical features as those in the above embodiments will not be repeated in this embodiment.
[0102] S402: Extract the execution results based on the response message, and determine the detection result of the mini-program based on the execution results. The detection result indicates whether the mini-program is legitimate.
[0103] For example, if the detection results include violent images, the detection results indicate that the mini-program is illegitimate.
[0104] Based on the above analysis, in this embodiment, by extracting the running results according to the process information representing the generation and storage of running results, and the running results being the technical characteristics generated by the cloud function that calls and runs the mini-program, the backend service of the mini-program in related technologies is avoided, which is maintained by the mini-program developer. The mini-program detection platform cannot accurately detect whether the mini-program is legal, thus improving the detection coverage, accuracy and efficiency of mini-program detection.
[0105] Figure 5 This is a schematic diagram based on the fourth embodiment of the present disclosure, wherein the applet detection method of the present disclosure is applied to a cloud platform, such as... Figure 5 As shown, the method includes:
[0106] S501: Receives a user's request to invoke the backend services of the mini-program, initiated by the user's device. The mini-program includes a frontend interface and backend services.
[0107] Similarly, to avoid tedious descriptions, the same technical features as those in the above embodiments will not be repeated in this embodiment.
[0108] S502: Obtain and execute the cloud function corresponding to the mini-program based on the call request, and obtain the execution result. The cloud function is used to determine the content displayed on the front-end interface, and the execution result, along with the front-end interface loaded on the user's device, generates the mini-program's display interface.
[0109] S503: Generate a response message based on the process information for generating and storing the execution results.
[0110] For example, combining the above analysis and Figure 6 As shown, the Function Compute platform executes cloud functions, obtains the results, and stores them in the object storage platform. The Function Compute platform can also generate response messages and transmit them to the message queue in the cloud platform.
[0111] The response message may include: the identifier of the mini-program developer, the identifier of the user, the identifier of the mini-program, and the storage path of the running results stored in the object storage platform, etc., which will not be listed here.
[0112] S504: Based on the response message, determine the storage path for storing the execution results, and determine the repository for storing the execution results based on the storage path.
[0113] S505: Extract the execution results from the repository and determine the detection result of the mini-program based on the execution results. The detection result indicates whether the mini-program is legitimate.
[0114] For example, combining the above analysis and Figure 6 As shown, the cloud platform may also include a notification module, which can consume response messages from the message queue. For example, the notification module can subscribe to messages in the message queue, and when there are response messages in the message queue, the notification module can consume the response messages from the message queue.
[0115] And such as Figure 6 As shown, the cloud platform can also include a detection module, and the notification module can notify the detection module to detect the running results. For example, the notification module can transmit the storage path to the detection module, or it can transmit a response message to the detection module. Taking the transmission of a response message as an example, the detection module extracts the running results from the object storage platform based on the response message and detects the running results to determine whether the mini-program is legitimate.
[0116] The detection results include text, images, and links, which will not be listed here. Taking images as an example, the detection module can detect whether the image contains violent content. If so, it generates a detection result indicating that the mini-program is illegal.
[0117] In some embodiments, the execution results can be deleted after the detection results are obtained. For example, after the detection module obtains the detection results, the execution results stored in the object storage platform can be deleted to free up storage space on the object storage platform.
[0118] S506: If the detection result indicates that the mini-program is invalid, output a prompt message. The prompt message is used to suggest that the mini-program be deleted.
[0119] For example, combining the above analysis and Figure 6As shown, the detection module can transmit a prompt message to the notification module. Correspondingly, after receiving the prompt message, the notification module can transmit it to the mini-program marketplace, so that the marketplace can remove the mini-program based on the prompt message.
[0120] Figure 7 This is a schematic diagram based on the fifth embodiment of the present disclosure, wherein the applet invocation device of the present disclosure is applied to a cloud platform, such as... Figure 7 As shown, the mini-program calling device 700 includes:
[0121] The first receiving unit 701 is used to receive a call request initiated by a user based on a user device to call the backend service of a mini-program, wherein the mini-program includes a front-end interface and a backend service.
[0122] The execution unit 702 is used to obtain and run the cloud function corresponding to the mini program according to the call request, and obtain the execution result. The cloud function is used to determine the content displayed on the front-end interface.
[0123] The sending unit 703 is used to send the running results to the user device, wherein the running results and the front-end interface loaded by the user device generate the display interface of the mini program.
[0124] Figure 8 This is a schematic diagram based on the sixth embodiment of the present disclosure, wherein the applet invocation device of the present disclosure is applied to a cloud platform, such as... Figure 8 As shown, the mini-program invocation device 800 includes:
[0125] The first receiving unit 801 is used to receive a call request initiated by a user based on a user device to call the backend service of a mini-program, wherein the mini-program includes a front-end interface and a backend service.
[0126] Output unit 802 is used to output configuration requirement information for implementing backend services.
[0127] The second receiving unit 803 is used to receive configuration content input based on configuration requirement information.
[0128] Generation unit 804 is used to generate cloud functions based on the configuration content.
[0129] In some embodiments, the configuration requirement information includes resource configuration categories and backend template code; the second receiving unit is used to obtain resource configuration information based on the resource configuration categories and backend code for implementing backend services based on the backend template code, wherein the configuration content includes resource configuration information and backend code.
[0130] Generation unit 804 is used to generate cloud functions based on resource configuration information and backend code.
[0131] The execution unit 805 is used to obtain and run the cloud function corresponding to the mini program according to the call request, and obtain the execution result. The cloud function is used to determine the content displayed on the front-end interface.
[0132] Combination Figure 8 It is understood that, in some embodiments, the operating unit 805 includes:
[0133] The acquisition sub-unit 8051 is used to obtain resource configuration information of cloud functions and backend services based on the call request.
[0134] The execution subunit 8052 is used to execute the backend code used to implement the backend service based on the cloud function and resource configuration information, and obtain the running results.
[0135] In some embodiments, the resource configuration information includes path information for the backend code; the execution subunit 8052 includes:
[0136] The acquisition module is used to obtain the backend code based on the path information.
[0137] The execution module is used to run cloud functions to execute backend code and obtain the results.
[0138] In some embodiments, the resource configuration information also includes function execution method entry information; the execution module is used to run the cloud function according to the function execution method entry information, so as to execute the backend code by running the cloud function and obtain the running result.
[0139] In some embodiments, the call request carries the identifier of the mini-program; the running unit 805 is used to obtain and run the cloud function corresponding to the mini-program according to the identifier, and obtain the running result.
[0140] The sending unit 806 is used to send the running results to the user device, wherein the running results and the front-end interface loaded by the user device generate the display interface of the mini program.
[0141] Figure 9 This is a schematic diagram based on the seventh embodiment of the present disclosure, wherein the detection device for the applet in this embodiment is applied to a cloud platform, such as... Figure 9 As shown, the detection device 900 for the mini-program includes:
[0142] The acquisition unit 901 is used to acquire response messages, wherein the response messages are used to characterize the process information for generating and storing the running results, and the running results are generated by calling and running the cloud function of the mini program.
[0143] Extraction unit 902 is used to extract the running results based on the response message.
[0144] The determining unit 903 is used to determine the detection result of the mini-program based on the running results, wherein the detection result indicates whether the mini-program is legal.
[0145] Figure 10 This is a schematic diagram based on the eighth embodiment of the present disclosure, wherein the detection device for the applet in this embodiment is applied to a cloud platform, such as... Figure 10 As shown, the detection device 1000 for the mini-program includes:
[0146] The acquisition unit 1001 is used to acquire response messages, wherein the response messages are used to characterize the process information for generating and storing the running results, and the running results are generated by calling and running the cloud function of the mini program.
[0147] Combination Figure 10 It is understood that, in some embodiments, the acquisition unit 1001 includes:
[0148] The receiving subunit 10011 is used to receive a call request initiated by the user based on the user device to call the backend service of the mini program, wherein the mini program includes a front-end interface and a backend service.
[0149] The running subunit 10012 is used to obtain and run the cloud function corresponding to the mini program according to the call request, and obtain the running result. The cloud function is used to determine the content displayed on the front-end interface.
[0150] The generation subunit 10013 is used to generate a response message based on the process information of generating and storing the running results.
[0151] Extraction unit 1002 is used to extract the running results based on the response message.
[0152] Combination Figure 10 It is understood that, in some embodiments, the extraction unit 1002 includes:
[0153] The first determining subunit 10021 is used to determine the storage path for storing the running results based on the process information for storing the running results.
[0154] The second determining subunit 10022 is used to determine the repository for storing the running results based on the storage path.
[0155] Extract subunit 10023, used to extract the execution results from the repository.
[0156] The determining unit 1003 is used to determine the detection result of the mini-program based on the running result, wherein the detection result indicates whether the mini-program is legal.
[0157] Deletion unit 1004 is used to delete the execution results from the repository.
[0158] Output unit 1005 is used to output a prompt message if the detection result indicates that the mini-program is invalid.
[0159] The notification message is used to prompt the user to delete the mini-program.
[0160] In some embodiments, the cloud function is generated based on configuration content, which is obtained based on the output configuration requirement information for implementing the backend service.
[0161] In some embodiments, the cloud function is generated from resource configuration information and backend code used to implement the backend service. The resource configuration information is obtained based on resource configuration categories; the backend code is obtained based on backend template code; and the configuration requirement information includes the resource configuration categories and the backend template code.
[0162] According to another aspect of the present disclosure, the present disclosure also provides a mini-program invocation system, including: a user device and a mini-program invocation device as described in any of the above embodiments, wherein the user device is used to initiate an invocation request to the mini-program invocation device to invoke the backend service of the mini-program, wherein the mini-program includes a front-end interface and a backend service.
[0163] Figure 11 This is a schematic diagram based on the ninth embodiment of the present disclosure, as shown below. Figure 11 As shown, the electronic device 1100 in this disclosure may include a processor 1101 and a memory 1102.
[0164] Memory 1102 is used to store programs. Memory 1102 may include volatile memory, such as random-access memory (RAM), such as static random-access memory (SRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.; memory may also include non-volatile memory, such as flash memory. Memory 1102 is used to store computer programs (such as application programs, functional modules, etc. that implement the above methods), computer instructions, etc. The computer programs, computer instructions, etc., can be partitioned and stored in one or more memories 1102. Furthermore, the computer programs, computer instructions, data, etc., can be accessed by processor 1101.
[0165] The aforementioned computer programs and instructions can be stored in one or more partitions of memory 1102. Furthermore, the aforementioned computer programs and instructions can be invoked by processor 1101.
[0166] The processor 1101 is configured to execute the computer program stored in the memory 1102 to implement the various steps in the methods described in the above embodiments.
[0167] For details, please refer to the relevant descriptions in the preceding method embodiments.
[0168] The processor 1101 and the memory 1102 can be independent structures or integrated structures. When the processor 1101 and the memory 1102 are independent structures, the memory 1102 and the processor 1101 can be coupled together via bus 1103.
[0169] The electronic device in this embodiment can execute the technical solution in the above method. Its specific implementation process and technical principle are the same, and will not be repeated here.
[0170] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0171] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0172] According to embodiments of this disclosure, this disclosure also provides a computer program product comprising: a computer program stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program causing the electronic device to perform the scheme provided in any of the above embodiments.
[0173] Figure 12 A schematic block diagram of an example electronic device 1200 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0174] like Figure 12As shown, device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1202 or a computer program loaded from storage unit 1208 into random access memory (RAM) 1203. The RAM 1203 may also store various programs and data required for the operation of device 1200. The computing unit 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.
[0175] Multiple components in device 1200 are connected to I / O interface 1205, including: input unit 1206, such as keyboard, mouse, etc.; output unit 1207, such as various types of monitors, speakers, etc.; storage unit 1208, such as disk, optical disk, etc.; and communication unit 1209, such as network card, modem, wireless transceiver, etc. Communication unit 1209 allows device 1200 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0176] The computing unit 1201 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1201 performs the various methods and processes described above, such as applet detection methods and applet invocation methods. For example, in some embodiments, the applet detection methods and applet invocation methods can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of the computer program can be loaded and / or installed on device 1200 via ROM 1202 and / or communication unit 1209. When the computer program is loaded into RAM 1203 and executed by the computing unit 1201, one or more steps of the applet detection methods and applet invocation methods described above can be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured by any other suitable means (e.g., by means of firmware) to execute the applet detection method and the applet invocation method.
[0177] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0178] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0179] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0180] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0181] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0182] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0183] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0184] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for invoking a mini-program, the method being applied to a cloud platform, comprising: The system receives a call request from a user's application on the user's device to invoke the backend service of a mini-program, wherein the mini-program includes a frontend interface and the backend service; the call request carries the identifier of the mini-program. According to the call request, the cloud function corresponding to the mini-program is obtained and executed, which triggers the backend code of the backend service to obtain the running result. The cloud function is used to determine the content displayed on the frontend interface. The running results are sent to the user device, wherein the running results and the front-end interface loaded by the user device generate the display interface of the mini program; The step of obtaining and running the cloud function corresponding to the mini-program based on the call request, and obtaining the running result, includes: Based on the identifier, obtain and run the resource configuration information of the cloud function and the backend service corresponding to the mini-program; the resource configuration information includes the path information of the backend code and the entry point information of the function execution method; The backend code is obtained based on the path information; The cloud function is executed according to the function execution method entry information, so as to execute the backend code by running the cloud function and obtain the execution result; After obtaining and running the cloud function corresponding to the mini-program based on the call request and obtaining the running result, the method further includes: generating a response message based on the process information of generating and storing the running result; Based on the response message, determine the storage path used to store the execution results, and based on the storage path, determine the repository used to store the execution results; The execution results are extracted from the repository, and the detection result of the mini-program is determined based on the execution results; the detection result indicates whether the mini-program is legal. If the detection result indicates that the mini-program is invalid, a prompt message will be output; the prompt message is used to suggest that the mini-program be deleted.
2. The method according to claim 1, wherein, Before obtaining and running the cloud function corresponding to the mini-program according to the call request, the method further includes: Output the configuration requirements for implementing the backend service; Receive configuration content input based on the configuration requirement information, and generate the cloud function according to the configuration content.
3. The method according to claim 2, wherein, The configuration requirements information includes resource configuration categories and backend template code; The step of receiving configuration content input based on the configuration requirement information and generating the cloud function according to the configuration content includes: Obtain resource configuration information based on the resource configuration category input, and obtain backend code for implementing the backend service based on the backend template code input, wherein the configuration content includes the resource configuration information and the backend code; The cloud function is generated based on the resource configuration information and the backend code.
4. The method according to claim 1, wherein, After determining the detection result of the mini-program based on the running results, the method further includes: Delete the results of the operation from the repository.
5. A device for launching a mini-program, the device being applied to a cloud platform, comprising: The first receiving unit is configured to receive a call request initiated by a user based on an application on a user device to call the backend service of a mini-program, wherein the mini-program includes a front-end interface and the backend service; the call request carries the identifier of the mini-program. The running unit is used to obtain and run the cloud function corresponding to the mini-program according to the call request, trigger the backend code of the backend service, and obtain the running result. The cloud function is used to determine the content displayed on the frontend interface. A sending unit is used to send the running results to the user device, wherein the running results and the front-end interface loaded by the user device generate the display interface of the mini-program; The running unit is specifically used to obtain and run the resource configuration information of the cloud function and the backend service corresponding to the mini-program according to the identifier; the resource configuration information includes the path information of the backend code and the entry information of the function execution method; obtain the backend code according to the path information; run the cloud function according to the function execution method entry information, so as to execute the backend code by running the cloud function and obtain the running result; The device further includes: an acquisition unit, used to generate a response message based on the process information of generating and storing the running result after acquiring and running the cloud function corresponding to the mini-program according to the call request and obtaining the running result; The extraction unit is used to determine the storage path for storing the execution results based on the response message, and to determine the repository for storing the execution results based on the storage path; and to extract the execution results from the repository. The determination unit is used to determine the detection result of the mini-program based on the running results; wherein, the detection result indicates whether the mini-program is legal; if the detection result indicates that the mini-program is illegal, a prompt message is output; wherein, the prompt message is used to prompt the mini-program to be deleted.
6. The apparatus according to claim 5, wherein, The device further includes: The output unit is used to output the configuration requirements information for implementing the backend service; The second receiving unit is used to receive configuration content input based on the configuration requirement information; The generation unit is used to generate the cloud function based on the configuration content.
7. The apparatus according to claim 6, wherein, The configuration requirement information includes resource configuration categories and backend template code; the second receiving unit is used to obtain resource configuration information input based on the resource configuration categories and backend code input based on the backend template code for implementing the backend service, wherein the configuration content includes the resource configuration information and the backend code; The generation unit is used to generate the cloud function based on the resource configuration information and the backend code.
8. The apparatus according to claim 5, wherein, The device further includes: The deletion unit is used to delete the running results from the repository.
9. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-4.
11. A computer program product comprising a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-4.
12. A system for invoking a mini-program, comprising: The user equipment and the mini-program invocation device as described in any one of claims 5-8, wherein the user equipment is configured to initiate an invocation request to the mini-program invocation device to invoke the backend service of the mini-program, wherein the mini-program includes a frontend interface and the backend service.
Citation Information
Patent Citations
Voice changing processing method, apparatus and device, and readable storage medium
CN111968626A
Applet control method and system, server and terminal equipment
CN112269607A
Internet of Things data anomaly detection method and system based on server-free architecture
CN113687989A
Small program code detection method, device and system
CN114153511A