CN114356520A - Running method, device, equipment, storage medium and program product of micro application - Google Patents

Running method, device, equipment, storage medium and program product of micro application Download PDF

Info

Publication number
CN114356520A
CN114356520A CN202111651803.XA CN202111651803A CN114356520A CN 114356520 A CN114356520 A CN 114356520A CN 202111651803 A CN202111651803 A CN 202111651803A CN 114356520 A CN114356520 A CN 114356520A
Authority
CN
China
Prior art keywords
target
action
controller
trigger
micro
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111651803.XA
Other languages
Chinese (zh)
Inventor
杨俊拯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202111651803.XA priority Critical patent/CN114356520A/en
Publication of CN114356520A publication Critical patent/CN114356520A/en
Priority to PCT/CN2022/133516 priority patent/WO2023124657A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt

Landscapes

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

Abstract

The embodiment of the application discloses a running method, a running device, equipment, a storage medium and a program product of micro application, and belongs to the technical field of application. The method comprises the following steps: acquiring a target micro application script of a target micro application; responding to a target trigger event, and triggering a target trigger corresponding to the target trigger event in the target micro application script; reading event parameters corresponding to target trigger events from the first data storage areas, wherein different triggers correspond to different first data storage areas; and executing the target calling action corresponding to the target trigger based on the event parameter. And a special data storage area is provided for different triggers in the running process of the micro application, so that the data storage area can be accessed by the calling action associated with the trigger, and the data transmission purpose in the micro application is realized while the conflict problem of the data corresponding to the different triggers can be avoided.

Description

Running method, device, equipment, storage medium and program product of micro application
Technical Field
The embodiment of the application relates to the technical field of applications, in particular to a running method, a running device, running equipment, a storage medium and a program product of micro applications.
Background
With the continuous development of Application (Application) technology, more and more multifunctional and rich applications are brought to the end, and convenience is brought to the daily life of people.
Before using the application, the user first needs to download the application installation package from the application store, install the application in the terminal by parsing the application installation package, and then click on the application icon to start the application. However, as the quality of applications continues to improve, the storage space required by the applications also increases.
Disclosure of Invention
The embodiment of the application provides a running method, a running device, equipment, a storage medium and a program product of micro application. The technical scheme is as follows:
in one aspect, an embodiment of the present application provides a method for running a micro application, where the method includes:
acquiring a target micro application script of a target micro application, wherein the target micro application script is composed of at least one trigger;
responding to a target trigger event, and triggering a target trigger corresponding to the target trigger event in the target micro application script;
reading event parameters corresponding to the target trigger events from a first data storage area, wherein different triggers correspond to different first data storage areas;
and executing the target calling action corresponding to the target trigger based on the event parameter.
In another aspect, an embodiment of the present application provides an apparatus for running a micro application, where the apparatus includes:
the script acquisition module is used for acquiring a target micro application script of a target micro application, and the target micro application script is composed of at least one trigger;
the trigger module is used for responding to a target trigger event and triggering a target trigger corresponding to the target trigger event in the target micro application script;
the data reading module is used for reading the event parameters corresponding to the target trigger events from the first data storage areas, and different triggers correspond to different first data storage areas;
and the action calling module is used for executing the target calling action corresponding to the target trigger based on the event parameter.
In another aspect, an embodiment of the present application provides a computer device, which includes a processor and a memory; the memory stores at least one instruction for execution by the processor to implement a method of running a micro-application as described in the above aspect.
In another aspect, an embodiment of the present application provides a computer-readable storage medium, in which at least one program code is stored, and the program code is loaded and executed by a processor to implement the running method of the micro application according to the above aspect.
In another aspect, embodiments of the present application provide a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the running method of the micro application provided in the various alternative implementations of the above aspects.
In the embodiment of the application, in the running process of the micro application, the micro application script of the micro application is obtained, and the corresponding trigger in the micro application script is triggered based on the trigger event, so that the calling action corresponding to the trigger is executed, and the micro application function of the micro application is realized. The running of the micro application is based on the micro application script with low code quantity, so that the occupied storage space is smaller compared with the traditional application; in addition, a special data storage area is provided for different triggers in the running process of the micro application, so that the data storage area can be accessed by the trigger-related calling action, and the data conflict problem of the different triggers corresponding to data can be avoided while the aim of data transmission in the micro application is fulfilled.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a micro application software package shown in one exemplary embodiment of the present application;
FIG. 2 is a schematic diagram of a micro application script shown in an exemplary embodiment of the present application;
FIG. 3 illustrates a system architecture diagram of a micro application system provided by an exemplary embodiment of the present application;
FIG. 4 is a flowchart illustrating a method for running a micro application according to an exemplary embodiment of the present application;
FIG. 5 illustrates a schematic diagram of a trigger scope shown in an exemplary embodiment of the present application;
FIG. 6 is a flowchart illustrating a method for operating a micro application according to another exemplary embodiment of the present application;
FIG. 7 illustrates a diagram of simple action types and compound action types shown in an exemplary embodiment of the present application;
FIG. 8 is a diagram illustrating the actions of child nodes in accordance with an exemplary embodiment of the present application;
FIG. 9 illustrates a diagram of relationships between child node scopes, trigger scopes, and global scopes, shown in an exemplary embodiment of the present application;
FIG. 10 is a flowchart illustrating a method for operating a micro application according to another exemplary embodiment of the present application;
FIG. 11 illustrates a schematic diagram of a condition controller shown in an exemplary embodiment of the present application;
FIG. 12 illustrates a schematic diagram of a cycle controller shown in an exemplary embodiment of the present application;
FIG. 13 illustrates a schematic diagram of a delay controller shown in an exemplary embodiment of the present application;
FIG. 14 illustrates a schematic diagram of a condition controller shown in an exemplary embodiment of the present application;
FIG. 15 illustrates a schematic diagram of a selection controller shown in an exemplary embodiment of the present application;
FIG. 16 illustrates a schematic diagram of a parallel controller shown in an exemplary embodiment of the present application;
FIG. 17 is a block diagram illustrating an apparatus for running a micro application according to an embodiment of the present application;
fig. 18 is a block diagram illustrating a computer device according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
For convenience of understanding, terms referred to in the embodiments of the present application will be described below.
Micro application: a micro application can be seen as a collection of services for implementing a specific business logic, i.e. a micro application function of the micro application, by means of a call between the services. Unlike the traditional application which can only run on a specific operating system, the service of the micro application can be the service on different operating systems, namely the micro application supports heterogeneous operating systems, and cross-platform running can be realized.
Different from the traditional application which needs to be downloaded before being used and is bound with the device, the micro-application adopts a subscription mechanism and is bound with the user, namely, after the micro-application is subscribed by a certain device under the user account, each device under the user account can use the micro-application.
As shown in fig. 1, a micro-application software package 100 of a micro-application is composed of an application description file 110, a program file 120 (micro-application script), and an MD5 file 130, wherein the application description file 110 is used for some simple descriptions of the micro-application, including author, version information, time, etc. of the micro-application; the program file 120 is used for the most core file in the micro application software package, which is the main generation part edited by a developer through an editor and is also the scheduling object of the micro application engine; the MD5 file 130 is used for integrity checking of the micro-application software package 100.
Micro application script: the method is also called micro application definition and is used for controlling the calling relation among services in the micro application, and a script language is adopted to describe a section of general business logic. The script language can be xml, javascript, JSON, YMAL, C + +, Python, etc., or some user-defined syntax format.
As shown in fig. 2, the micro application script 11 is composed of several triggers 12, and each trigger 12 is composed of a trigger event 13, a control logic 14, and several services 15 controlled by the control logic 14. The service in the micro application script is not the service itself, but the service identification of the service. Alternatively, in this embodiment, the service 15 may also be referred to as a simple action or an action.
Different from the traditional method that the application installation package needs to be downloaded and installed before the operation of the application, for example, before the android application is operated, the apk package needs to be downloaded, the micro application only needs to download the corresponding micro application script before the operation, and in the micro application process, the micro application script is executed through the micro application engine, so that the micro application function is realized. Compared with the traditional application, the code amount of the micro application script is lower, so that the occupied storage space is smaller, and the dynamic deployment and updating are facilitated.
Service: as the minimum unit in the running process of the micro-application, is used for realizing a specific task. For example, the screen capture service is used for realizing the screen capture function of the device, and the screen projection service is used for realizing the screen projection of the display picture between the devices. Moreover, the service called in the running process of the micro application can be a service on the current device or a service on other devices. For example, in the running process of the micro application, the device screenshots of other devices can be obtained by calling the screenshot service on other devices, and the device screenshots of other devices can be displayed by calling the picture display service.
Operation (simple operation): refers to the minimum granularity action entity directly called and executed in the running process of the micro application. Simple actions include actions provided by the micro application system itself and service actions registered by the service developer. The system provides actions including: the method comprises the following steps of selecting an action by equipment, performing multiple actions, resetting an application action, traversing a list action, customizing a parameter action, setting a parameter and the like; the service action is that a service developer registers a service, and the corresponding service action is automatically generated in the micro application, such as: the method comprises the following steps of screen capturing action, camera opening action, screen throwing server opening action, screen throwing client opening action and the like. In this embodiment, in the running process of the micro application, the simple action is executed through the control logic to realize the calling of the service corresponding to the simple action, for example, in the running process of the micro application, the screen capture service on other equipment can be called by executing the screen capture action to obtain the screen capture of the equipment of the other equipment, and the picture display service can be called by executing the display action to display the screen capture of the equipment of the other equipment; it should be noted that, in the micro application, the execution of the call action essentially calls a service.
Different from the traditional application installation process, all services used in the operation process need to be installed locally in advance, and the service logic of the micro application is dynamically assembled in the operation process, so that the service in the micro application supports dynamic deployment, namely the service corresponding to the service logic is dynamically deployed to the current equipment based on the service logic executed by the current equipment in the operation process. Accordingly, when the micro application function of the same micro application is implemented by a plurality of devices, since the business logic of different devices may be different, the services deployed at different devices may also have a difference, that is, the services in the micro application have the characteristic of differential deployment.
In this embodiment of the present application, the services constituting the micro application may include a static service and a dynamic service, where the static service refers to a service provided by the host application and needs to be pre-installed in the device, and the dynamic service refers to a service supporting dynamic deployment and may be dynamically deployed in the device during the running process of the micro application.
Fig. 3 is a system architecture diagram of a micro application system provided in an exemplary embodiment of the present application. The system includes at least one computer device 210 and a server 220.
The computer device 210 is an electronic device with a micro application running function, and the electronic device may be a smart phone, a tablet computer, a personal computer, a car machine, or the like, which is not limited in this embodiment. In fig. 3, the device 210 is illustrated as including a smart phone, a tablet computer, and a car machine, but the invention is not limited thereto.
In one possible implementation, the computer device 210 is provided with a micro application engine 211, and the micro application engine 211 is used as a core for controlling the running of the micro application and includes a script management module 2111, an event bus module 2112, an application scheduling module 2113, a runtime module 2114, and a service scheduling module 2115.
The script management module 2111 is configured to manage the micro application scripts of each micro application stored in the computer device 210, and is responsible for parsing the micro application scripts to determine the triggers in the micro application scripts and the services under the triggers. Optionally, the script management module 2111 is further configured to download a corresponding micro application script when receiving a subscription operation on the micro application, and delete the micro application script corresponding to the micro application when receiving a subscription cancellation operation on the micro application.
The event bus module 2112 is used for matching with the application scheduling module 2113 and realizing micro-application scheduling based on a trigger event. In some embodiments, the event bus module 2112 has a plurality of triggers corresponding to the micro applications, and since the same trigger event may trigger a plurality of subscribed micro applications, after receiving the trigger event, the event bus module 2112 delivers the trigger event to the application scheduling module 2113 to determine the micro application that needs to be run from the plurality of micro applications. The application scheduling module 2113 may automatically determine the micro-application based on the scheduling policy, or may manually select the micro-application by the user.
The runtime module 2114 is used to execute control logic in the micro application script, such that based on the control logic interacting with the service scheduler module 2115, a service call is made by the service scheduler module 2115.
Besides the micro application engine 211, the computer device 210 is also provided with a service administration module 212, a data synchronization module 213 and a service gateway 214.
The service administration module 212 is configured to manage static services pre-installed in the device; the data synchronization module 213 is configured to synchronize states of the micro application engine 211 with other computer devices when the state of the micro application engine 211 changes (for example, a state change is caused by an event generated by a service), so as to ensure consistency of the states of the micro application engine 211 at different computer devices.
The service gateway 214 is configured to make a service call based on the service call request of the service scheduling module 2115, and specifically includes an agent management module 2141 and a lifecycle management module 2142. The agent management module 2141 is provided with different service agents, and the service agents are configured to convert the service invocation request in the unified format to obtain a request meeting the requirement of the real service format. The lifecycle management module 2142 is used to manage the lifecycle of the service, and may include a static service lifecycle management module and a dynamic service lifecycle management module.
In the running process of the micro application, the computer device 210 may perform service call through the service gateway 214 of itself, and may also perform service call through the service gateway 214 of other devices (determined by the business logic of the micro application), so that the cross-device service call may be implemented.
For services with different deployments, as shown in fig. 3, a static service module 216 and a dynamic service module 215 are further provided in the computer device 210. The static services module 216 is used to manage pre-installed static services, and the dynamic services module 215 is used to manage dynamically deployed dynamic services.
In some embodiments, the services included in the dynamic services module 215 may correspond to different operating environments, different deployment modalities, or different programming development languages. In fig. 3, the example that the dynamic service module 215 includes the android dynamic service 2151, the Web dynamic service 2152, and the container dynamic service 2153 is illustrated schematically, but the invention is not limited thereto.
The server 220 is a server, a service cluster formed by a plurality of servers, or a cloud computing center. The functions implemented by the servers in the server cluster are divided, as shown in fig. 3, the server cluster includes a user resource management server 221, a micro application store server 222, a service market server 223, and a cloud service library 224.
The user resource management server 221 includes a user management module 2211, an application management module 2212, a service management module 2213, a device management module 2214, and a security module 2215. The user management module 2211 is used for managing user accounts using the micro applications; the application management module 2212 is used for managing micro applications subscribed under different user accounts; the service management module 2213 is used for managing the called service; the device management module 2214 is configured to manage a binding relationship between a user account and a device; the security module 2215 is used for security verification during the interaction.
The micro-application store server 222 is used to provide a micro-application subscription service. When a user needs to use a micro application, the user can perform a micro application search through the micro application search engine 2221 provided by the micro application store server 222, and then select a subscription micro application from the search result.
In some embodiments, after receiving the subscription operation for the micro application, the micro application store server 222 sends the user account and the application identifier of the subscribed micro application to the user resource management server 221, and the application management module 2212 in the user resource management server 221 updates the subscription relationship between the user account and the micro application. Further, the user management module 2211 and the device management module 2214 determine other devices under the user account, and push a subscription notification to the other devices, so that the other devices download the micro application script of the micro application from the micro application store server 222. Illustratively, as shown in fig. 3, after a user "zhang san" subscribes a micro application through a smart phone, a car machine and a tablet computer that log in the user account "zhang san" receive a subscription notification pushed by the user resource management server 221, so as to download a micro application script of the micro application based on an application identifier in the notification.
The service market server 223 is a developer-oriented server for providing a service inquiry service. The developer may perform a service search through a service search engine 2231 provided by the service market server 223, apply the searched service to the developed micro application, and upload the developed micro application to the micro application store server 222 for downloading by other users.
In addition, the developer can also perform dynamic service development and upload the developed dynamic service to the cloud service library 224. Subsequent computer devices 210 can download and deploy the dynamic service from cloud services repository 224.
It should be noted that, the foregoing embodiment only illustrates an infrastructure of the micro application system, and the micro application system may further include other computer devices (such as developer devices) or servers that implement other functions, which is not limited in this embodiment.
Referring to fig. 4, a flowchart of a method for running a micro application according to an exemplary embodiment of the present application is shown, where the embodiment of the present application is described by taking the method as an example for being applied to the computer device shown in fig. 3, and the method includes:
step 401, a target micro application script of a target micro application is obtained, and the target micro application script is composed of at least one trigger.
In a possible implementation manner, when a start instruction of a target micro application is received, the computer device obtains a target micro application script corresponding to the target micro application from a micro application script stored locally, wherein the micro application script of the micro application subscribed by a currently logged user account is stored locally by the computer device.
Optionally, the start instruction may be triggered by a user by clicking a micro application icon, and may be triggered by interaction (such as voice, pan-and-pan, tapping, scene perception, and the like).
In the embodiment of the application, the micro applications are a set formed by services, and the business logic of the micro applications is realized by executing micro application scripts by the micro application engine through the computer equipment, wherein the micro application scripts of different micro applications are all executed by the same micro application engine.
The micro application script is used as a script file with low code quantity and is composed of a plurality of triggers, and each trigger is used for triggering under a specific trigger event and carrying out service calling by executing a calling action corresponding to the trigger after triggering.
Optionally, the invoking action may be a simple action or a combined action, and in the case that the invoking action is a simple action, after the trigger is triggered, the simple action may be directly executed to invoke the service; in the case where the call action is a combined action, when the trigger is triggered, a simple action needs to be performed by the controller for the call logic indicating the simple action to make a service call.
In some embodiments, the micro application script includes at least an initialization trigger for triggering the micro application to start running and an end trigger for triggering the micro application to end running. In addition to the initialization trigger and the end trigger, other triggers for implementing specific micro application functions are included in the micro application script, which is not limited in the embodiments of the present application.
Step 402, responding to the target trigger event, triggering a target trigger corresponding to the target trigger event in the target micro application script.
In the running process of the micro application, when a target trigger event is received, the computer equipment determines a target trigger triggered by the target trigger event from a target micro application script, and accordingly the target trigger is set to be in a trigger state from an un-trigger state. In the trigger state, the computer equipment executes the corresponding calling action of the trigger through the micro application engine and calls the corresponding service to realize corresponding business logic.
Optionally, the target trigger event may be an event triggered by a user, such as a tapping event, a shaking event, and the like, or an event output after a service is called, such as an event returned after a previous trigger corresponds to the service call, which is not limited in this embodiment.
Step 403, reading event parameters corresponding to the target trigger event from the first data storage area, where different triggers correspond to different first data storage areas.
In addition to executing the calling action in the running process of the micro application, the micro application also relates to a data transfer process, for example, a "screen-casting event" may carry relevant parameter information of the source device and the destination device of the screen casting, and the parameter information may be stored in a trigger action domain of a trigger corresponding to the "screen-casting event" so that a corresponding target calling action under the trigger may access the relevant parameter information.
Since the micro application includes several triggers, different triggers are triggered by different trigger events, in order to avoid collision of excessive data or long time for searching required data in the calling process, in a possible implementation manner, different first data storage areas (trigger action areas) are set for different triggers, and then the event parameter corresponding to the target trigger event can only be accessed by the target calling action corresponding to the target trigger event. Optionally, when the target call action includes multiple controllers and multiple simple actions, the target call action can only be accessed by the controller and simple action corresponding to the target trigger.
When a target trigger event is received, a target trigger corresponding to the target trigger event in the target micro application script is triggered, and simultaneously, an event parameter corresponding to the target trigger event can be stored in a trigger action (first data storage area) corresponding to the target trigger.
In some illustrative examples, the event parameter may be data carried by a target trigger event, such as information about a source device and a destination device carried by a "screen shot event".
As shown in fig. 5, a diagram illustrating the scope of a trigger according to an exemplary embodiment of the present application is shown. When a target event 503 is received, triggering a trigger 501 corresponding to the target event 503, wherein event parameters corresponding to the target event 503 can be stored in a trigger scope 510, and controllers 1 to 4 and actions 1 to 4 associated with the trigger 501 can all call the event parameters; while controller 5-controller 7, and actions 5-9 cannot invoke data in trigger scope 510; when a target event 504 is received, a trigger 502 corresponding to the target event 504 is triggered, event parameters corresponding to the target event 504 can be stored in a trigger scope 520, and the controller 5 to the controller 7 and the action 5 to the action 9 associated with the trigger 502 can all call the event parameters; and controller 1 through controller 4, and action 1 through action 4, cannot invoke data in trigger scope 520.
The method includes that a data transmission process is involved in a micro application running process, for example, for an event parameter of a screen-casting event, the event parameter is required when a calling action of a screen-casting service is executed, and the event parameter is required to be acquired correspondingly in the process of executing the calling action, so that a subsequent service calling process is performed based on the event parameter. Therefore, in one possible implementation, before executing the target call action corresponding to the target trigger, the first data storage area is accessed, and the event parameter corresponding to the target trigger event is read from the first data storage area.
And step 404, executing the target calling action corresponding to the target trigger based on the event parameter.
In one possible implementation, the computer device executes a target calling action corresponding to the target trigger based on the event parameter through a runtime module in the micro application engine to realize the calling of the target service, so as to realize the specific micro application function of the micro application.
It should be noted that the invoking action in the embodiment of the present application essentially invokes a certain service, and invokes a target service by executing a target invoking action, so as to implement a micro application function of a micro application; illustratively, the target calling action is a screen capturing action, and the process of executing the screen capturing action is a screen capturing service calling process, and the screen capturing function of the micro application is realized by calling the screen capturing service.
In the embodiment of the application, the target service called by the computer device may be a service of the current device or a service of the external device, that is, cross-device service calling may be realized, so that the micro-application function of the target micro-application is realized through interaction with the external device.
In addition, in the embodiment of the present application, since the service of the micro application supports dynamic deployment in the running process in addition to static deployment, before calling the target service, the computer device needs to determine whether the target service is already deployed locally, and dynamically deploy the target service when the target service is not deployed (for the dynamic service).
It should be noted that, when the micro application includes a plurality of triggers, the computer device repeatedly executes the above steps 402 to 404, and after triggering the end trigger, executes the control logic of the end trigger to end the running of the micro application.
In summary, in the embodiment of the present application, in the running process of the micro application, the micro application script of the micro application is obtained, and the corresponding trigger in the micro application script is triggered based on the trigger event, so as to execute the call action corresponding to the trigger, so as to implement the micro application function of the micro application. The running of the micro application is based on the micro application script with low code quantity, so that the occupied storage space is smaller compared with the traditional application; in addition, a special data storage area is provided for different triggers in the running process of the micro application, so that the data storage area can be accessed by the trigger-related calling action, and the data conflict problem of the different triggers corresponding to data can be avoided while the aim of data transmission in the micro application is fulfilled.
The data transmission process involved in the running process of the micro application also relates to the transmission process of the service return value besides the transmission process of the event parameter, for example, the 'screen capture action' returns the captured picture data, and when the 'picture display action' is executed, the captured picture data needs to be accessed; thus, in one possible implementation, a corresponding data space scope is also set for the service return value.
Referring to fig. 6, a flowchart of a method for running a micro application according to another exemplary embodiment of the present application is shown, where the embodiment of the present application is described by taking the method as an example for being applied to the computer device shown in fig. 3, and the method includes:
step 601, obtaining a target micro application script of the target micro application, wherein the target micro application script is composed of at least one trigger.
Step 602, in response to the target trigger event, triggering a target trigger corresponding to the target trigger event in the target micro application script.
Step 603, reading the event parameter corresponding to the target trigger event from the first data storage area, wherein different triggers correspond to different first data storage areas.
The embodiments of step 601 to step 603 may refer to the above embodiments, which are not described herein.
And step 604, when the target calling action comprises at least one target controller, controlling to execute at least one target simple action through the at least one target controller based on the event parameter.
The action types of the calling action comprise a simple action type and a combined action type, the simple action type calling action is formed by a single simple action, the combined action type calling action is formed by at least one controller and at least one simple action, and the controller is used for indicating calling logic of the simple action.
As shown in fig. 7, a diagram illustrating simple action types and combination action types is shown in an exemplary embodiment of the present application. When the action type of the calling action is a simple action type, triggering a trigger 1 corresponding to an event 1 when the event 1 is received, and triggering and executing the simple action 701 by the trigger 1 to call the service; when the action type of the calling action is a combined action type, when an event 2 is received, a trigger 2 corresponding to the event 2 is triggered, and the trigger 2 triggers the execution of the combined action 702, wherein the combined action 702 is composed of a controller 1-a controller 5 and actions 1-8, and the actions 1-8 are simple actions; in the process of calling action execution, the controller 1 and the controller 2 need to control the execution of the action 1; the controller 1, the controller 2 and the controller 4 control the execution action 2; the controller 1, the controller 2 and the controller 5 need to control and execute actions 3-5; controller 1 and controller 3 need to control and execute actions 6 to 8.
Since the simple action type call action only includes a single simple action and does not include a controller, in a possible implementation manner, when the call action does not include a controller, the call action can carry event parameters of a target event and execute the target simple action to call a corresponding target service, thereby implementing a micro application function of the micro application.
The simple action type calling action can only realize the calling of a single service, but in the actual application scene of the micro application, if a certain micro application function needs to be completed, the single simple action cannot be realized, and a plurality of simple actions may be required to be realized together.
It should be noted that, when the calling action is a combined action type, it is composed of several controllers and several simple actions, and it may be a "multi-branch tree structure" as shown in fig. 7; the leaf nodes of the tree are certain to be 'simple actions', the root node (the node connected with the trigger) is a controller, and the child nodes of the controller can be the controller or the simple actions; the child node of the simple action may be a simple action or may be a controller. When the micro application engine triggers the calling action through the trigger, the whole tree is sequentially traversed from the controller of the root node, different leaf nodes (simple actions) are finally traversed according to the control logic of the controller, and the simple actions are executed.
For the calling action of the combined action type, in the running process of the micro application, after the computer equipment receives a target trigger event, a target trigger corresponding to the target event is triggered, and at least one target simple action is controlled and executed by at least one target controller to realize the calling of the target service.
The data transmission process involved in the running process of the micro application also relates to the transmission process of the service return value besides the transmission process of the event parameter, for example, the 'screen capture action' returns the captured picture data, and when the 'picture display action' is executed, the captured picture data needs to be accessed; thus, in one possible implementation, a corresponding data space scope is also set for the service return value. In an exemplary example, step 604 may further include steps 604A-604C.
And step 604A, controlling and executing the target simple action located in the father node through the target controller, and acquiring target service data fed back after the target simple action located in the father node is executed.
As shown in fig. 7, in the combined action 702, actions 7 and 8 are child nodes of action 6, that is, action 6 is a parent node, in the process of executing the combined action 702, according to the scheduling logic, action 6 needs to be executed first, then action 8 and/or action 7 needs to be executed, and in the process of executing action 7 or action 8, service data fed back after action 6 may need to be executed; illustratively, when the target call action includes a simple action such as the relationship between the action 6 and the action 7, determining that the target call action includes a target simple action located in a parent node and a target simple action located in a child node; correspondingly, in the running process of the micro application, the target simple action located in the father node is controlled and executed through the target controller, and if the fed-back target service data can be obtained after the target simple action is executed, the target service data can be stored in the specific data storage area, so that the target service data can be referred when the subsequent target simple action is executed.
Step 604B, the simple actions of reading the target service data from the second data storage area, where the target service data is located in the parent node, are different and correspond to different second data storage areas.
In order to facilitate the target service data fed back by the target simple action located at the parent node to be transferred to the target simple action located at the child node, in a possible implementation, a second data storage area is provided for storing the target service data fed back after the target simple action located at the parent node is executed.
Optionally, in order to avoid data collision, different second data storage areas are set for different target simple actions located in the parent node, and the second data storage areas only allow target simple action invocation of the associated child node under the target simple action of the same parent node.
In a possible implementation manner, before executing the target simple action located in the child node, if the target simple action needs to refer to the target service data returned by the previous node in the execution process, the target service data needs to be read from the second data storage area first, and then the target simple action located in the child node is executed based on the target service data.
Optionally, in the micro application, a special symbol is provided, and the target service data is referred to from the sub-node scope (second data storage area), and the special symbol may be $, for example, "showPicture $" indicates that the display picture action refers to a picture in the sub-node scope.
Step 604C, based on the target service data, performs the target simple action at the child node.
In a possible implementation manner, after the target service data fed back by the last node (parent node) is obtained, the target simple action located in the child node may be executed by referring to the target service data, so as to implement the call of the target service corresponding to the target simple action.
As shown in fig. 8, a schematic diagram illustrating the actions of child nodes according to an exemplary embodiment of the present application is shown. After receiving the event 801, triggering a trigger 802 corresponding to the event 801, and controlling and calling a screen capturing action and a picture displaying action through a controller 1 and a controller 2 to realize a screen capturing display function, wherein the picture displaying action is a child node of the screen capturing action; in the implementation process of the screen capture display function, the controller 2 controls the execution of the screen capture action, acquires a target picture captured after the screen capture action is executed, stores the target picture in the sub-node scope 803, and calls the target picture from the sub-node scope 803 when the picture display action is executed and the target picture is transmitted as a reference for picture display. Optionally, since the action 2 is also a child node of the screen capture action, when the action 2 is executed, if the target picture is also needed, the target picture may be called from the child node scope 803.
Optionally, the data space scope of the micro application further includes, in addition to the first data storage area (trigger scope) and the second data storage area (child node scope), a third data storage area (global scope), where the third data storage area stores an operating environment parameter corresponding to the target micro application and a user-defined parameter, such as device information of the current computer device, and the third data storage area allows the calling action triggered by each trigger to access, that is, the data of the global scope can be accessed by the controller and the simple action of the micro application.
FIG. 9 is a diagram illustrating a relationship among child node scopes, trigger scopes, and global scopes, according to an exemplary embodiment of the present application. Micro application 900 includes global scope 910, trigger scope 920, and child node scope 930; running environment parameters and custom parameters of the micro applications are stored in the global scope 910, and controllers and actions associated with the trigger 901 and the trigger 902 can call data from the global scope 910; when a target event is received, triggering a trigger 901 corresponding to the target event, wherein event parameters corresponding to the target event can be stored in a trigger scope 920, and controllers 1 to 4 and actions 1 to 4 associated with the trigger 901 can all call the event parameters; while controller 5-controller 7, and actions 5-9 cannot call data in trigger scope 920; the service data fed back after performing action 6 is stored in the child node scope 930, allowing actions 7-9 to invoke the data in the child node scope 930 when executed; while action 5 cannot invoke data in child node scope 930.
In this embodiment, by dividing the global scope, the trigger scope, and the child node scope, and defining the data reference relationship or limitation between different scopes, the conflict generated by excessive data can be avoided while achieving the purpose of transferring data inside the micro application.
In order to implement more complex micro application functions, a concept of combining action types is introduced, a plurality of controllers and a plurality of simple actions are combined to form a calling action, in the actual application process, various scheduling logics exist, for example, circular scheduling, sequential scheduling, conditional scheduling and the like, in order to implement the scheduling logics, a plurality of controllers indicating different scheduling logics are defined in the embodiment, and the micro application functions of micro applications can be further enriched through the combination of different types of controllers.
Referring to fig. 10, a flowchart of a method for running a micro application according to another exemplary embodiment of the present application is shown, where the embodiment of the present application is described by taking the method as an example for being applied to the computer device shown in fig. 3, and the method includes:
step 1001, a target micro application script of a target micro application is obtained, and the target micro application script is composed of at least one trigger.
Step 1002, in response to the target trigger event, triggering a target trigger corresponding to the target trigger event in the target micro application script.
Step 1003, reading the event parameter corresponding to the target trigger event from the first data storage area, wherein different triggers correspond to different first data storage areas.
The embodiments of step 1001 and step 1003 may refer to the above embodiments, and this embodiment is not described herein again.
And 1004, when the target calling action comprises at least one target controller, determining target calling logic indicated by the target controller.
When the target call action includes at least one target controller, the target controller is used to indicate the target call logic of at least one target simple action, for example, if the target controller is a loop controller, the target controller defines a loop condition of the target simple action, and the target simple action is an action connected to the loop controller.
Step 1005, based on the event parameter and the target call logic, executing the target simple action.
In a possible implementation manner, the computer device executes a target simple action based on a target calling logic corresponding to the target controller to realize calling of a target service, so as to realize a specific application function of the micro application; and event parameters of the target event may be referenced in the course of performing the target simple action.
The target controller may be a condition controller, a cycle controller, a delay controller, a sequence controller, a selection controller, a parallel controller, and the like, and the controller type of the target controller is not limited in the embodiment of the present application.
Taking the target controller as an example of a condition controller, in an exemplary case, the steps 1004 and 1005 may be replaced with steps 1004A and 1005A.
And step 1004A, when the target calling action comprises at least one target controller, determining a target scheduling condition indicated by the target controller.
The condition controller is provided with a judgment condition, and whether the target simple action corresponding to the branch is executed or not is determined according to the judgment result of the condition.
In a possible implementation, in the case that the condition controller is included in the target call action, when the condition controller is executed, a target scheduling condition indicated by the condition controller needs to be determined, and then a target simple action that needs to be executed is determined based on the target scheduling condition.
Step 1005A, based on the target scheduling condition, determines the target simple action from the candidate simple actions, and executes the target simple action.
In one possible implementation, based on a target scheduling condition, a target simple action to be executed is determined from at least two candidate simple actions associated with the condition controller, and the target simple action is executed to call a target service.
Further, when determining the executed target simple action based on the target scheduling condition, it needs to be determined whether the event parameter meets the target scheduling condition, and when meeting the target scheduling condition, the target simple action corresponding to the branch is executed; otherwise, when the target scheduling condition is not met, the target simple action corresponding to the no branch is executed.
As shown in fig. 11, a schematic diagram of a condition controller is shown in an exemplary embodiment of the present application. The target invocation actions include conditional controller 1101, first controller 1102, second action 1104, and first action 1103; when the target call action is executed, firstly, a condition judgment result is determined based on the condition 1105 of the condition controller 1101, and when the condition judgment result indicates that the condition 1105 is satisfied, the first controller 1102 corresponding to the yes branch continues to control the execution of the second action 1104; if the condition judgment result indicates that the condition 1105 is not satisfied, the first action 1103 corresponding to no branch is executed.
Taking the target controller as a cycle controller as an example, in an exemplary case, the steps 1004 and 1005 may also be replaced by steps 1004B and 1005B.
And step 1004B, when the target calling action comprises at least one target controller, determining a target circulation condition indicated by the target controller.
Wherein the circulation controller is provided with a circulation condition, and the execution of the target simple action can be stopped only if the circulation condition is satisfied.
It should be noted that, since the loop controller can only define the loop condition, and cannot define how two or more simple actions are invoked, the loop controller only has a single child node, and the child node is scheduled in a loop.
In a possible embodiment, in the case where the loop controller is included in the target call action, when the loop controller is executed, it is necessary to determine a target loop condition indicated by the loop controller, and further determine the execution stop timing of the target simple action based on the target loop condition.
In step 1005B, when the execution state of the target simple action does not satisfy the target loop condition, the target simple action is continuously and circularly executed.
In one possible embodiment, when the target controller is a loop controller, it indicates that the target simple action associated with the target controller needs to be executed in a loop, and the target simple action is stopped only when the execution state of the target simple action meets the target loop condition.
Alternatively, the cycle controller may be divided into a number of cycle controllers, a cycle up to a success controller, and a cycle up to a failure controller based on the difference in the target cycle conditions.
Under the condition that the cycle control is a number cycle controller, when the number cycle controller is executed, the execution number of the target simple action needs to be acquired, whether the execution number reaches a number threshold indicated by a target cycle condition or not is judged, and when the execution number reaches the number threshold, the target simple action is stopped being executed; and otherwise, when the execution times do not reach the time threshold value, continuing to execute the target simple action until the execution times of the target simple action reach the time threshold value.
Under the condition that the circulation controller is a circulation-up-to-success controller, when the circulation is executed up to the success controller, the target simple action needs to be executed circularly, whether the target service corresponding to the target simple action is successfully called or not is judged, and the target simple action is stopped to be executed after the target service is successfully called; and otherwise, when the target service is not successfully called, continuing to execute the target simple action until the target service is not successfully called.
Under the condition that the circulation controller is a circulation-to-failure controller, when the circulation is executed to the circulation-to-failure controller, the target simple action needs to be executed circularly, whether the target service corresponding to the target simple action is successfully called or not is judged, and after the target service is successfully called, the target simple action is continuously executed until the target service is failed to be called; and otherwise, stopping executing the target simple action after the target service call fails.
As shown in fig. 12, a schematic diagram of a cycle controller is shown in an exemplary embodiment of the present application. When the target calling action comprises the number cycle controller 1201, the first controller 1202 and the first action 1203, in the process of executing the target calling action, the first controller 1202 needs to control the cycle to execute the first action 1203, and the execution of the first action 1203 is stopped until the execution number of the first action 1203 reaches the number threshold; when the target call action includes a loop until the controller 1204, the second controller 1205 and the second action 1206 are successful, in the process of executing the target call action, the second controller 1205 needs to control the loop to execute the second action 1206, and the execution of the second action 1206 is stopped until the second action 1206 is successfully executed; when the target call action includes a loop through the failed controller 1207, the third controller 1208, and the third action 1209, the third controller 1208 needs to control the loop through the third action 1209 during the process of executing the target call action, and the third action 1209 is stopped from being executed until the third action 1209 fails to be executed.
Taking the target controller as a delay controller as an example, in an exemplary example, the steps 1004 and 1005 may also be replaced by steps 1004C and 1005C.
And step 1004C, when the target calling action comprises at least one target controller, determining the target calling delay indicated by the target controller.
The delay controller defines a call delay, and only when the call delay is reached, the target simple action can be executed.
It should be noted that, since the delay controller can only define the call delay, and cannot define how two or more simple actions are called, the delay controller only has a single child node, and the child node is delayed by a certain time to execute.
In a possible implementation, in the case that the target call action includes a delay controller, when the delay controller is executed, it is necessary to determine the target call delay indicated by the delay controller, and then after the target call delay is extended, execute its associated target simple action.
And step 1005C, after the target calling delay is reached, executing the target simple action.
In a possible implementation manner, when the target controller is a delay controller, it indicates that a certain time is required to delay to execute its associated child node, that is, when the delay controller is executed, it needs to determine whether a target call delay is reached, if the target call delay is reached, the target simple action is executed, otherwise, if the target call delay is not reached, the target simple action is executed after waiting for reaching the target call delay.
As shown in fig. 13, a schematic diagram of a delay controller according to an exemplary embodiment of the present application is shown. The child nodes of the delay controller can be other controllers, or actions; when the target call action comprises the first delay loop controller 1301 and the first action 1302, in the process of executing the target call action, after the target call delay is required to be reached, executing the first action 1302; when the target call action includes the second delay controller 1303, the first controller 1304, and the second action 1305, the first controller 1304 controls to execute the second action 1305 after the target call delay is required to be reached in the process of executing the target call action.
Taking the target controller as an example of a sequence controller, in an exemplary example, the steps 1004 and 1005 may be replaced with steps 1004D and 1005D.
And 1004D, when the target calling action comprises at least one target controller, determining a target calling sequence corresponding to each candidate simple action indicated by the target controller.
The sequence controller is used for defining the execution sequence of a plurality of simple actions, correspondingly, the general sequence controller at least comprises two sub-nodes, namely the sequence controller is associated with at least two candidate simple actions.
In a possible embodiment, in the case where the target call action includes a sequence controller, when the sequence controller is executed, it is necessary to determine a target call order of each candidate simple action indicated by the sequence controller, and then sequentially execute the target simple action based on the target call order.
And step 1005D, sequentially determining the candidate simple actions as target simple actions based on the target calling sequence, and sequentially executing the target simple actions.
In a possible embodiment, based on the execution sequence of each candidate simple action indicated by the target calling sequence, and sequentially determining each candidate simple action as a target simple action, each target simple action is sequentially executed, that is, each candidate simple action associated with the sequence controller needs to be executed, and the same micro application function can be realized only after all candidate simple actions are executed.
Further, in the process of executing the target simple actions based on the target calling sequence, when the nth target simple action is successfully executed, the (n + 1) th target simple action can be continuously executed until each candidate simple action is successfully executed; on the contrary, when the execution of the nth target simple action fails, the subsequent target simple actions cannot be continuously executed, and the execution of the (n + 1) th target simple action is correspondingly stopped. That is, the child nodes of the sequence controller are sequentially scheduled and stop executing as long as there is a child node execution failure.
As shown in fig. 14, a schematic diagram of a condition controller is shown in an exemplary embodiment of the present application. The target calling actions comprise a sequence controller 1401, a first controller 1402, a first action 1403, a second action 1404, a second controller 1405 and a third action 1406, wherein the sequence controller 1401 defines the calling sequence among the actions as the first action 1403, the second action 1404 and the third action 1406; when executing the target calling action, firstly, the first controller 1402 controls to execute the first action 1403 preferentially based on the calling sequence indicated by the sequence controller 1401, and when the first action 1403 is executed successfully, the second action 1404 is executed continuously; when the second action 1404 is successfully performed, the second controller 1405 controls to perform a third action 1406.
Taking the target controller as an example of the selection controller, in an exemplary case, the steps 1004E and 1005E may be replaced with the steps 1004E and 1005E.
And step 1004E, when the target calling action comprises at least one target controller, determining the target calling sequence indicated by the target controller.
The selection controller can also define the execution sequence of a plurality of simple actions, correspondingly, the general selection controller at least comprises two child nodes, namely the selection controller is associated with at least two candidate simple actions; different from the sequence controller, the child nodes of the selection controller are sequentially scheduled, and the child nodes are returned when the child nodes are successfully executed; that is, the plurality of child nodes corresponding to the selection controller can all realize the same micro application function.
In a possible implementation manner, in the case that the selection controller is included in the target call action, when the selection controller is executed, it is necessary to determine a target call order of each candidate simple action indicated by the selection controller, and then sequentially execute the target simple actions based on the target call order until the target simple actions are successfully executed.
Step 1005E, executing the candidate simple actions in sequence based on the target calling sequence; and when the execution of the candidate simple action is successful, determining the candidate simple action as the target simple action, and stopping executing other candidate simple actions.
In one possible implementation mode, each candidate simple action is executed in sequence based on the execution sequence of each candidate simple action indicated by the target calling sequence, and when the candidate simple action is successfully executed, the candidate simple action is determined as the target simple action, and the execution of other candidate simple actions is stopped; otherwise, if the execution of the candidate simple actions fails, other candidate simple actions are continuously executed according to the target calling sequence.
As shown in fig. 15, a schematic diagram of a selection controller is shown in an exemplary embodiment of the present application. The target call action includes a selection controller 1501, a first controller 1502, a first action 1503, a second action 1504, a second controller 1505, and a third action 1506, and the selection controller 1501 defines the call sequence among the actions as the first action 1503-the second action 1504-the third action 1506; when the target calling action is executed, the first action 1503 is preferentially controlled to be executed by the first controller 1502 based on the calling sequence indicated by the selection controller 1501, and after the first action 1503 is successfully executed, the second action 1504 and the third action 1506 are not required to be executed; when the first action 1503 fails to execute, a second action 1504 continues to be executed; when the second action 1504 is successfully performed, the third action 1506 need not be performed; if the second action 1504 fails, the second controller 1505 controls the third action 1506 to be executed.
Taking the target controller as a parallel controller as an example, in an exemplary case, step 1005 may be replaced with step 1005F.
Step 1005F, determining each candidate simple action as a target simple action, and executing each target simple action in parallel.
The parallel controller represents that a plurality of simple actions need to be executed in parallel, correspondingly, the general parallel controller at least comprises two sub-nodes, namely the parallel controller is associated with at least two candidate simple actions.
In one possible implementation, in the case that the parallel controller is included in the target call action, when the parallel controller is executed, each candidate simple action associated with the parallel controller is determined as a target simple action, and then each target simple action is executed in parallel.
As shown in fig. 16, a schematic diagram of a parallel controller is shown in an exemplary embodiment of the present application. The target call action includes a parallel controller 1601, a first controller 1602, a first action 1603, a second action 1604, a second controller 1605, and a third action 1606; when the target call action is executed, the first action 1603, the second action 1604 and the third action 1606 are executed in parallel, that is, the first controller 1602 is triggered to control the first action 1603, the second action 1604 is triggered to be executed, and the second controller 1605 is triggered to execute the third action 1606 at the same time.
Optionally, the target call action may include a combination of several controllers, and may include different kinds of controllers, so as to implement a more complex call action. Illustratively, the target call action including various controllers may be defined in the micro application script as:
Figure BDA0003446750620000131
as can be seen from this definition, the micro-application is implemented by an xml syntax, which contains two triggers: the trigger corresponding to the event "xxx" and the trigger corresponding to the event "yyy", wherein the calling action associated with the trigger corresponding to the trigger event "xxx" is composed of a parallel controller, a selection controller and actions A to E; the trigger event "yyy" corresponds to the trigger-associated call action consisting of a conditional controller, action B and action C.
In this embodiment, control logics of various controllers included in the calling action are defined, so that a combination of a plurality of simple actions can be realized by combining various controllers to support more complicated arrangement logics of the calling action, thereby meeting application development requirements of developers in different complicated scenes.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 17, a block diagram of an apparatus for running a micro application according to an embodiment of the present application is shown. The apparatus may include:
a script obtaining module 1701 for obtaining a target micro application script of a target micro application, wherein the target micro application script is composed of at least one trigger;
a triggering module 1702, configured to trigger a target trigger corresponding to a target trigger event in the target micro application script in response to the target trigger event;
a data reading module 1703, configured to read an event parameter corresponding to the target trigger event from a first data storage area, where different triggers correspond to different first data storage areas;
and an action calling module 1704, configured to execute a target calling action corresponding to the target trigger based on the event parameter.
Optionally, the action types of the target call action include a simple action type and a combined action type, the target call action in the simple action type is composed of a single target simple action, the target call action in the combined action type is composed of at least one target controller and at least one target simple action, and the target controller is used for indicating a target call logic of the target simple action;
the action invocation module 1704 includes:
and the first action calling unit is used for controlling and executing at least one target simple action through at least one target controller when the target calling action comprises at least one target controller.
Optionally, the target call action includes a target simple action located in a parent node and a target simple action located in a child node;
the first action invoking unit is further configured to:
controlling and executing the target simple action positioned in the father node through the target controller, and acquiring target service data fed back after the target simple action positioned in the father node is executed;
reading the target service data from a second data storage area, wherein the targets at the father node have different simple actions and correspond to different second data storage areas;
and executing the target simple action positioned in the child node based on the target service data.
Optionally, the apparatus further comprises:
and the data storage module is used for storing the running environment parameters corresponding to the target micro application in a third data storage area, and the third data storage area allows the calling action triggered by each trigger to access.
Optionally, the action types of the target call action include a simple action type and a combined action type, the target call action in the simple action type is composed of a single target simple action, the target call action in the combined action type is composed of at least one target controller and at least one target simple action, and the target controller is used for indicating a target call logic of the target simple action;
the action invocation module 1704 includes:
a first determining unit, configured to determine the target call logic indicated by the target controller when the target call action includes at least one target controller;
and the second action calling unit is used for executing the target simple action based on the target calling logic.
Optionally, the target controller is a condition controller, and the condition controller is associated with at least two candidate simple actions;
the first determining unit is further configured to:
determining a target scheduling condition indicated by the target controller;
the second action invoking unit is further configured to:
and determining the target simple action from the candidate simple actions based on the target scheduling condition, and executing the target simple action.
Optionally, the target controller is a cycle controller;
the first determining unit is further configured to:
determining a target cycle condition indicated by the target controller;
the second action invoking unit is further configured to:
and when the execution state of the target simple action does not meet the target circulation condition, continuing to circularly execute the target simple action.
Optionally, the second action invoking unit is further configured to:
under the condition that the execution times of the target simple actions do not reach a time threshold value, continuing to circularly execute the target simple actions;
under the condition that the target service corresponding to the target simple action is not successfully called, continuing to circularly execute the target simple action;
and under the condition that the target service corresponding to the target simple action is not called and fails, continuing to circularly execute the target simple action.
Optionally, the target controller is a delay controller;
the first determining unit is further configured to:
determining a target calling delay indicated by the target controller;
the second action invoking unit is further configured to:
and executing the target simple action after the target calling delay is reached.
Optionally, the target controller is a sequence controller, and the sequence controller is associated with at least two candidate simple actions;
the first determining unit is further configured to:
determining a target calling sequence corresponding to each candidate simple action indicated by the target controller;
the second action invoking unit is further configured to:
and sequentially determining the candidate simple actions as the target simple actions based on the target calling sequence, and sequentially executing each target simple action.
Optionally, the second action invoking unit is further configured to:
when the nth target simple action is successfully executed, continuing to execute the (n + 1) th target simple action;
the device further comprises:
and the execution stopping module is used for stopping executing the (n + 1) th target simple action after the execution of the (n) th target simple action fails.
Optionally, the target controller is a selection controller, and the selection controller is associated with at least two candidate simple actions;
the first determining unit is further configured to:
determining a target calling sequence indicated by the target controller;
the second action invoking unit is further configured to:
sequentially executing the candidate simple actions based on the target calling sequence;
and when the candidate simple action is successfully executed, determining the candidate simple action as the target simple action, and stopping executing other candidate simple actions.
Optionally, the target controller is a parallel controller, and the parallel controller is associated with at least two of the candidate simple actions;
the second action invoking unit is further configured to:
determining each of the candidate simple actions as the target simple action, and executing each of the target simple actions in parallel.
In summary, in the embodiment of the present application, in the running process of the micro application, the micro application script of the micro application is obtained, and the corresponding trigger in the micro application script is triggered based on the trigger event, so as to execute the call action corresponding to the trigger, so as to implement the micro application function of the micro application. The running of the micro application is based on the micro application script with low code quantity, so that the occupied storage space is smaller compared with the traditional application; in addition, a special data storage area is provided for different triggers in the running process of the micro application, so that the data storage area can be accessed by the trigger-related calling action, and the data conflict problem of the different triggers corresponding to data can be avoided while the aim of data transmission in the micro application is fulfilled.
Referring to fig. 18, a block diagram of a computer device according to an exemplary embodiment of the present application is shown. The computer device 1800 may be implemented as a source device or a destination device in the various embodiments described above. Computer device 1800 may include one or more of the following components: a processor 1810, and a memory 1820.
Processor 1810 may include one or more processing cores. The processor 1810, using various interfaces and lines to connect various parts throughout the computer device 1800, performs various functions of the computer device 1800 and processes data by executing or executing instructions, programs, sets of codes or sets of instructions stored in the memory 1820 and invoking data stored in the memory 1820. Alternatively, the processor 1810 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 1810 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Neural-Network Processing Unit (NPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing contents required to be displayed by the touch display screen; the NPU is used for realizing an Artificial Intelligence (AI) function; the modem is used to handle wireless communications. It is to be understood that the modem may not be integrated into the processor 1810, and may be implemented by a single chip.
The Memory 1820 may include a Random Access Memory (RAM) or a Read-Only Memory (ROM). Optionally, the memory 1820 includes a non-transitory computer-readable medium. The memory 1820 may be used to store instructions, programs, code sets, or instruction sets. The memory 1820 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (e.g., a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like; the stored data area may store data (such as audio data, a phonebook) created according to the use of the computer device 1800, and the like.
In addition, those skilled in the art will appreciate that the configuration of computer device 1800 as illustrated in the above-described figures does not constitute a limitation of the computer device, which may include more or less components than those illustrated, or may combine certain components, or a different arrangement of components. For example, the computer device 1800 further includes a display screen, a camera assembly, a microphone, a speaker, a radio frequency circuit, an input unit, a sensor (such as an acceleration sensor, an angular velocity sensor, a light sensor, etc.), an audio circuit, a WiFi module, a power supply, a bluetooth module, etc., which are not described herein again.
The embodiment of the present application also provides a computer-readable storage medium, which stores at least one program code, and the program code is loaded and executed by a processor to implement the running method of the micro application according to the above embodiments.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the running method of the micro application provided in the various alternative implementations of the above aspects.
It should be understood that reference to "a plurality" herein means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. In addition, the step numbers described herein only exemplarily show one possible execution sequence among the steps, and in some other embodiments, the steps may also be executed out of the numbering sequence, for example, two steps with different numbers are executed simultaneously, or two steps with different numbers are executed in a reverse order to the order shown in the figure, which is not limited by the embodiment of the present application.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (17)

1. A method for running a micro-application, the method comprising:
acquiring a target micro application script of a target micro application, wherein the target micro application script is composed of at least one trigger;
responding to a target trigger event, and triggering a target trigger corresponding to the target trigger event in the target micro application script;
reading event parameters corresponding to the target trigger events from a first data storage area, wherein different triggers correspond to different first data storage areas;
and executing the target calling action corresponding to the target trigger based on the event parameter.
2. The method according to claim 1, wherein the action types of the target call action include a simple action type and a combined action type, the target call action in the simple action type is composed of a single target simple action, the target call action in the combined action type is composed of at least one target controller and at least one target simple action, and the target controller is used for indicating target call logic of the target simple action;
the executing the target calling action corresponding to the target trigger comprises the following steps:
and when the target calling action comprises at least one target controller, controlling to execute at least one target simple action through at least one target controller.
3. The method of claim 2, wherein the target call actions include target simple actions at a parent node and target simple actions at a child node;
the control of the execution of at least one target simple action through at least one target controller comprises the following steps:
controlling and executing the target simple action positioned in the father node through the target controller, and acquiring target service data fed back after the target simple action positioned in the father node is executed;
reading the target service data from a second data storage area, wherein the targets at the father node have different simple actions and correspond to different second data storage areas;
and executing the target simple action positioned in the child node based on the target service data.
4. The method of claim 1, further comprising:
and storing the running environment parameters corresponding to the target micro application in a third data storage area, wherein the third data storage area allows the calling action triggered by each trigger to access.
5. The method according to any one of claims 1 to 4, wherein the action types of the target call action include a simple action type and a combined action type, the target call action in the simple action type is composed of a single target simple action, the target call action in the combined action type is composed of at least one target controller and at least one target simple action, and the target controller is used for indicating target call logic of the target simple action;
the executing the target calling action corresponding to the target trigger comprises the following steps:
when the target calling action comprises at least one target controller, determining the target calling logic indicated by the target controller;
and executing the target simple action based on the target calling logic.
6. The method of claim 5, wherein the target controller is a conditional controller, the conditional controller being associated with at least two candidate simple actions;
the determining the target call logic indicated by the target controller comprises:
determining a target scheduling condition indicated by the target controller;
the executing the target simple action based on the target call logic includes:
and determining the target simple action from the candidate simple actions based on the target scheduling condition, and executing the target simple action.
7. The method of claim 5, wherein the target controller is a cycle controller;
the determining the target call logic indicated by the target controller comprises:
determining a target cycle condition indicated by the target controller;
the executing the target simple action based on the target call logic includes:
and when the execution state of the target simple action does not meet the target circulation condition, continuing to circularly execute the target simple action.
8. The method according to claim 7, wherein in the case that the execution state of the target simple action does not satisfy the target loop condition, continuing to execute the target simple action includes any one of:
under the condition that the execution times of the target simple actions do not reach a time threshold value, continuing to circularly execute the target simple actions;
under the condition that the target service corresponding to the target simple action is not successfully called, continuing to circularly execute the target simple action;
and under the condition that the target service corresponding to the target simple action is not called and fails, continuing to circularly execute the target simple action.
9. The method of claim 5, wherein the target controller is a time delay controller;
the determining the target call logic indicated by the target controller comprises:
determining a target calling delay indicated by the target controller;
the executing the target simple action based on the target call logic includes:
and executing the target simple action after the target calling delay is reached.
10. The method of claim 5, wherein the target controller is a sequence controller associated with at least two candidate simple actions;
the determining the target call logic indicated by the target controller comprises:
determining a target calling sequence corresponding to each candidate simple action indicated by the target controller;
the executing the target simple action based on the target call logic includes:
and sequentially determining the candidate simple actions as the target simple actions based on the target calling sequence, and sequentially executing each target simple action.
11. The method of claim 10, wherein said performing each of said target simple actions in turn comprises:
when the nth target simple action is successfully executed, continuing to execute the (n + 1) th target simple action;
the method further comprises the following steps:
and when the n target simple action fails to be executed, stopping executing the n +1 target simple action.
12. The method of claim 5, wherein the target controller is a selection controller, the selection controller being associated with at least two candidate simple actions;
the determining the target call logic indicated by the target controller comprises:
determining a target calling sequence indicated by the target controller;
the executing the target simple action based on the target call logic includes:
sequentially executing the candidate simple actions based on the target calling sequence; and when the candidate simple action is successfully executed, determining the candidate simple action as the target simple action, and stopping executing other candidate simple actions.
13. The method of claim 5, wherein the target controller is a parallel controller associated with at least two of the candidate simple actions;
the executing the target simple action based on the target call logic includes:
determining each of the candidate simple actions as the target simple action, and executing each of the target simple actions in parallel.
14. An apparatus for running a micro-application, the apparatus comprising:
the script acquisition module is used for acquiring a target micro application script of a target micro application, and the target micro application script is composed of at least one trigger;
the trigger module is used for responding to a target trigger event and triggering a target trigger corresponding to the target trigger event in the target micro application script;
the data reading module is used for reading the event parameters corresponding to the target trigger events from the first data storage areas, and different triggers correspond to different first data storage areas;
and the action calling module is used for executing the target calling action corresponding to the target trigger based on the event parameter.
15. A computer device, wherein the computer device comprises a processor and a memory; the memory stores at least one instruction for execution by the processor to implement a method of operating a micro-application according to any of claims 1 to 13.
16. A computer-readable storage medium, in which at least one program code is stored, the program code being loaded and executed by a processor to implement a method of running a micro-application according to any one of claims 1 to 13.
17. A computer program product, characterized in that the computer program product comprises computer instructions, the computer instructions being stored in a computer readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executing the computer instructions causing the computer device to perform a method of running a micro-application according to any of claims 1 to 13.
CN202111651803.XA 2021-12-30 2021-12-30 Running method, device, equipment, storage medium and program product of micro application Pending CN114356520A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111651803.XA CN114356520A (en) 2021-12-30 2021-12-30 Running method, device, equipment, storage medium and program product of micro application
PCT/CN2022/133516 WO2023124657A1 (en) 2021-12-30 2022-11-22 Micro-application running method and apparatus, device, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111651803.XA CN114356520A (en) 2021-12-30 2021-12-30 Running method, device, equipment, storage medium and program product of micro application

Publications (1)

Publication Number Publication Date
CN114356520A true CN114356520A (en) 2022-04-15

Family

ID=81103940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111651803.XA Pending CN114356520A (en) 2021-12-30 2021-12-30 Running method, device, equipment, storage medium and program product of micro application

Country Status (2)

Country Link
CN (1) CN114356520A (en)
WO (1) WO2023124657A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023124657A1 (en) * 2021-12-30 2023-07-06 Oppo广东移动通信有限公司 Micro-application running method and apparatus, device, storage medium, and program product

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8234388B2 (en) * 2005-07-29 2012-07-31 Verizon Patent And Licensing Inc. Application service invocation based on filter criteria
US7836441B2 (en) * 2006-02-13 2010-11-16 International Business Machines Corporation Administration automation in application servers
US9934027B2 (en) * 2011-09-21 2018-04-03 Actian Corporation Method and apparatus for the development, delivery and deployment of action-oriented business applications supported by a cloud based action server platform
US9313643B1 (en) * 2015-02-11 2016-04-12 Sprint Communications Company L.P. Dynamic subscriber identity module
CN105847552A (en) * 2016-03-25 2016-08-10 乐视控股(北京)有限公司 Application operation method of mobile terminal and mobile terminal
CN114356520A (en) * 2021-12-30 2022-04-15 Oppo广东移动通信有限公司 Running method, device, equipment, storage medium and program product of micro application

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023124657A1 (en) * 2021-12-30 2023-07-06 Oppo广东移动通信有限公司 Micro-application running method and apparatus, device, storage medium, and program product

Also Published As

Publication number Publication date
WO2023124657A1 (en) 2023-07-06

Similar Documents

Publication Publication Date Title
CN109032691B (en) Applet running method and device and storage medium
CN111026396B (en) Page rendering method and device, electronic equipment and storage medium
CN109597814B (en) Online rapid delivery system of background management information system
WO2023093429A1 (en) Micro-application running method and apparatus, and device, storage medium and program product
CN111198730B (en) Method, device, terminal and computer storage medium for starting sub-application program
CN112051993B (en) Method, device, medium and equipment for generating state machine template and processing task
US9158510B2 (en) System and computer program product for creating a telecommunications application
WO2023093414A1 (en) Micro-application development method and apparatus, and device, storage medium and program product
CN103530156A (en) Method and device for dynamically loading and calling program
CN110990105A (en) Interface display method and device, electronic equipment and storage medium
CN104317591A (en) OSGi (open service gateway initiative)-based web interface frame system and web business processing method thereof
CN103353845A (en) Method and device for uploading and pushing script
CN111026491A (en) Interface display method and device, electronic equipment, server and storage medium
CN114968406B (en) Plug-in management method and device, electronic equipment and storage medium
CN110971974B (en) Configuration parameter creating method, device, terminal and storage medium
WO2023124657A1 (en) Micro-application running method and apparatus, device, storage medium, and program product
CN111078325A (en) Application program running method and device, electronic equipment and storage medium
CN113448650A (en) Live broadcast function plug-in loading method, device, equipment and storage medium
Späth Pro Android with Kotlin
WO2021097683A1 (en) Android system starting method and apparatus, device, and storage medium
CN111008050A (en) Page task execution method, device, terminal and storage medium
CN113050962B (en) Mobile service upgrading method, device and terminal
CN111104183A (en) Application program running method and device, electronic equipment and storage medium
JP2006236375A (en) Web application development method, development support system, and program about development method
CN116954678A (en) Object updating method, device and computer readable storage medium

Legal Events

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