WO2023093414A1 - 微应用的开发方法、装置、设备、存储介质及程序产品 - Google Patents

微应用的开发方法、装置、设备、存储介质及程序产品 Download PDF

Info

Publication number
WO2023093414A1
WO2023093414A1 PCT/CN2022/127027 CN2022127027W WO2023093414A1 WO 2023093414 A1 WO2023093414 A1 WO 2023093414A1 CN 2022127027 W CN2022127027 W CN 2022127027W WO 2023093414 A1 WO2023093414 A1 WO 2023093414A1
Authority
WO
WIPO (PCT)
Prior art keywords
micro
service
trigger
target
application
Prior art date
Application number
PCT/CN2022/127027
Other languages
English (en)
French (fr)
Inventor
杨俊拯
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2023093414A1 publication Critical patent/WO2023093414A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04842Selection of displayed objects or displayed text elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop

Definitions

  • the embodiments of the present application relate to the field of application technology, and in particular to a micro-application development method, device, equipment, storage medium, and program product.
  • Embodiments of the present application provide a micro-application development method, device, device, storage medium, and program product. Described technical scheme is as follows:
  • the embodiment of the present application provides a micro-application development method, the method includes:
  • the editable elements include logic elements and service elements, the logic elements are used to implement logic control, the service elements are used to implement service calls, and the An editing operation refers to an operation of combining said editable elements;
  • the business logic structure is obtained by combining the editable elements, and the trigger is used to execute the business logic represented by the business logic structure based on a trigger event;
  • a micro-application is generated based on the business logic structure corresponding to at least one trigger.
  • the embodiment of the present application provides a micro-application development device, the device includes:
  • the interface display module is used to display the micro-application editing interface
  • a receiving module configured to receive editing operations on editable elements in the micro-app editing interface, where the editable elements include logical elements and service elements, the logical elements are used to implement logic control, and the service elements are used to implement Service call, the editing operation refers to the operation of combining the editable elements;
  • a structure display module configured to display a business logic structure corresponding to a trigger in the micro-application editing interface, the business logic structure is obtained by combining the editable elements, and the trigger is used to execute the business logic based on a trigger event Business logic of structural representation;
  • a generating module configured to generate a micro-application based on the business logic structure corresponding to at least one trigger.
  • an embodiment of the present application provides a computer device, the computer device includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the following: The development method of the micro application described in the above aspects.
  • an embodiment of the present application provides a computer-readable storage medium, where at least one piece of program code is stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to implement the above aspects.
  • the development method of micro application is described in detail below.
  • an embodiment of the present application provides a computer program product, where the computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the micro-application development method provided in various optional implementation manners of the above aspects.
  • Fig. 1 is a schematic diagram of a micro-application script shown in an exemplary embodiment of the present application
  • FIG. 2 shows a system architecture diagram of a micro-application system provided by an exemplary embodiment of the present application
  • FIG. 3 shows a flowchart of a micro-application development method provided by an exemplary embodiment of the present application
  • Fig. 4 is a schematic structural diagram of a micro-application editor shown in an exemplary embodiment of the present application
  • FIG. 5 is a flow chart of a logic element addition process shown in an exemplary embodiment of the present application.
  • Fig. 6 is a schematic interface diagram of a logical element adding process shown in an exemplary embodiment of the present application.
  • FIG. 7 is a flowchart of a service element adding process shown in an exemplary embodiment of the present application.
  • Fig. 8 is a schematic interface diagram of a service element adding process shown in an exemplary embodiment of the present application.
  • FIG. 9 is a flowchart of a drag legality detection process shown in an exemplary embodiment of the present application.
  • Fig. 10 is an implementation schematic diagram of a business logic structure update process shown in an exemplary embodiment of the present application.
  • Fig. 11 is a schematic interface diagram of a trigger creation process shown in an exemplary embodiment of the present application.
  • Fig. 12 is a schematic interface diagram of a trigger switching process shown in an exemplary embodiment of the present application.
  • Fig. 13 is a flowchart of a micro-application script generation process shown in an exemplary embodiment of the present application
  • Fig. 14 is an implementation diagram of a micro-application script generation process shown in an exemplary embodiment of the present application.
  • Fig. 15 is a schematic diagram of a micro-application submission setting interface shown in an exemplary embodiment of the present application.
  • FIG. 16 shows a structural block diagram of a micro-application development device provided by an embodiment of the present application.
  • Fig. 17 shows a structural block diagram of a computer device provided by an exemplary embodiment of the present application.
  • Micro-applications can be regarded as a collection of services, which are used to implement specific business logic through calls between services, that is, the application functions of micro-applications. Unlike traditional applications that can only run on a specific operating system, the services of micro-apps can be services on different operating systems, that is, micro-apps support heterogeneous operating systems and can run across platforms.
  • micro-apps adopt a subscription mechanism and are bound to users. This microapp can be used.
  • Micro-application script also known as micro-application definition, it is used to control the calling relationship between services in micro-applications, and uses scripting language to describe a general business logic. Wherein, the scripting language may be xml, javascript and so on.
  • micro-application script 11 is composed of several triggers 12 , and each trigger 12 is composed of trigger event 13 , control logic 14 and several services 15 controlled by control logic 14 .
  • the service in the micro-application script is not the service itself, but the service identifier of the service.
  • micro-application script is executed by the micro-application engine to realize the application function.
  • micro-application scripts have a lower code volume, so they occupy less storage space and are conducive to dynamic deployment and updates.
  • the screen capture service is used to realize the screen capture function of the device
  • the screen projection service is used to realize the screen projection of the display screen between devices, and so on.
  • the service invoked during the running of the micro-application may be a service on the current device or a service on other devices. For example, during the running of the micro-app, you can obtain the device screenshots of other devices by calling the screenshot service on other devices, and display the device screenshots of other devices by calling the image display service.
  • the services in the micro-application support dynamic deployment, that is, during the running process Based on the business logic executed by the current device, the service corresponding to the business logic is dynamically deployed to the current device.
  • the application function of the same micro-application is implemented by multiple devices, since the business logic of different devices may be different, the services deployed on different devices may also be different, that is, the services in the micro-application have the characteristics of differential deployment.
  • the services constituting the micro-application may include static services and dynamic services, wherein the static services refer to the services provided by the host application and need to be pre-installed in the device, while the dynamic services refer to the services that support dynamic deployment. It can be dynamically deployed in the device during the running of the micro application.
  • Fig. 2 shows a system architecture diagram of a micro-application system provided by an exemplary embodiment of the present application.
  • the system includes user equipment 210 , server 220 and developer equipment 230 .
  • the user 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, etc., which is not limited in this embodiment.
  • the user equipment 210 includes a smart phone, a tablet computer, and a car machine as an example for illustration, but this is not limited thereto.
  • the user equipment 210 is provided with a micro-application engine 211, and the micro-application engine 211 serves as the core for controlling the operation of the micro-application, including a script management module 2111, an event bus module 2112, an application scheduling module 2113, a runtime Module 2114 and service scheduling module 2115.
  • the script management module 2111 is used to manage the micro-application scripts of each micro-application stored in the user equipment 210, and is responsible for analyzing the micro-application scripts, so as to determine the triggers in the micro-application scripts and the services under the triggers.
  • the script management module 2111 is further configured to download the corresponding micro-application script when receiving a micro-application subscription operation, and delete the micro-application script corresponding to the micro-application when receiving a micro-application subscription cancellation operation.
  • the event bus module 2112 is used to cooperate with the application scheduling module 2113 to implement micro-application scheduling based on trigger events.
  • triggers corresponding to multiple micro-applications are mounted under the event bus module 2112. Since the same trigger event may trigger multiple subscribing micro-applications, after the event bus module 2112 receives the trigger event, the The application scheduling module 2113 determines the micro-applications that need to be run from several micro-applications. Wherein, the application scheduling module 2113 can automatically determine the micro-application based on the scheduling strategy, or allow the user to manually select the micro-application.
  • the runtime module 2114 is used to execute the control logic in the micro-application script, so as to interact with the service scheduling module 2115 based on the control logic, and the service scheduling module 2115 makes a service call.
  • the user equipment 210 is also provided with a service management module 212 , a data synchronization module 213 and a service gateway 214 .
  • the service management module 212 is used to manage the pre-installed static services in the device;
  • the data synchronization module 213 is used to update the status to other computer devices when the state of the micro-application engine 211 changes (for example, an event generated by the service causes a state change). Synchronization ensures the state consistency of the micro-application engine 211 on different computer devices.
  • the service gateway 214 is configured to perform service invocation based on the service invocation request of the service scheduling module 2115 , and specifically includes an agent management module 2141 and a lifecycle management module 2142 .
  • the proxy management module 2141 is provided with different service proxies, and the service proxies are used to convert service invocation requests in a unified format to obtain requests that meet the requirements 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.
  • the user equipment 210 can not only perform service calls through its own service gateway 214, but also can perform service calls through the service gateway 214 of other devices (determined by the business logic of the micro-application), that is, cross-device service call.
  • a static service module 216 and a dynamic service module 215 are also provided in the user equipment 210 .
  • the static service module 216 is used to manage pre-installed static services
  • the dynamic service module 215 is used to manage dynamically deployed dynamic services.
  • the services contained in the dynamic service module 215 may correspond to different operating environments, different deployment forms or different programming development languages.
  • the dynamic service module 215 includes the Android dynamic service 2151 , the Web dynamic service 2152 and the container dynamic service 2153 as an example for schematic illustration, but this is not limited thereto.
  • the server 220 is a server, a service cluster composed of several servers, or a cloud computing center. According to the functions realized by each server in the server cluster, as shown in FIG. 2 , 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 .
  • User management module 2211 is used to manage user accounts using micro-apps; application management module 2212 is used to manage micro-apps subscribed under different user accounts; service management module 2213 is used to manage invoked services; device management module 2214 is used to manage the binding relationship between the user account and the device; the security module 2215 is used to perform security verification during the interaction process.
  • the micro application store server 222 is used to provide micro application subscription services. When a user needs to use a micro-app, he can search for the micro-app through the micro-app search engine 2221 provided by the micro-app store server 222, and then choose to subscribe to the micro-app from the search results.
  • the micro application store server 222 After the micro application store server 222 receives the subscription operation to the micro application, it sends the user account and the application identification of the subscribed micro application to the user resource management server 221, and the application management in the user resource management server 221 Module 2212 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 subscription notifications to other devices, so that other devices download micro-app scripts of micro-apps from the micro-app store server 222 .
  • the service market server 223 is a server for developers to provide service inquiry services.
  • the developer device 230 can search for services through the service search engine 2231 provided by the service market server 223, and apply the searched services (including dynamic services and static services) to the developed micro-applications, and then upload the developed micro-applications to the micro-app store server 222 for other users to download and use.
  • developers can also develop services and upload the developed services to the cloud service library 224 .
  • Subsequent user equipment 210 can download and deploy the service from cloud service library 224 .
  • the developer device 230 is an electronic device used by a developer.
  • a micro-application editor ie, a client
  • the developer can use the micro-application editor to develop a micro-application; in another possible implementation, The developer device 230 can access the web version of the micro application editor, so as to perform micro application development through the web version of the micro application editor.
  • the micro-application editor provided by the embodiment of the present application has a service search function.
  • the service search function the developer device 230 can query the service that meets the demand from the service market server 223, so as to add the service to the developed micro-application.
  • micro-application editor provided by the embodiment of this application is a visual editor. Developers can realize business logic editing by dragging editable elements (logic elements or service elements) displayed in the interface, and then the micro-application The application editor generates micro-application codes based on the edited business logic.
  • developers can develop micro-apps or services through the developer device 230, wherein the developed micro-apps will be submitted to the micro-app store server 2221, and can be downloaded by the user device 210 after passing the review Use; the developed service will be submitted to the cloud service library 224 and be used by other developers after passing the review.
  • micro-application system may also include other computer devices or servers that implement other functions, which is not limited by this embodiment.
  • FIG. 3 shows a flow chart of a micro-application development method provided by an exemplary embodiment of the present application.
  • the embodiment of the present application applies this method to the computer equipment shown in FIG. 2 (which can be user equipment or development or equipment) as an example, the method includes:
  • Step 301 displaying a micro-application editing interface.
  • the micro application editor displays the micro application editing interface; or, when accessing the web version of the micro application editor, the computer device displays the micro application through the browser Editing interface.
  • the micro-application editing interface in the embodiment of the present application is a visual editing interface, which contains editable elements. During the micro-application development process, editing of business logic can be realized by dragging editable elements.
  • Step 302 Receive an editing operation on editable elements in the micro-app editing interface.
  • Editable elements include logical elements and service elements.
  • Logical elements are used to implement logic control, and service elements are used to implement service calls.
  • Editing operations refer to editable elements Perform combined operations.
  • the editing operation can be a gesture operation, such as a click operation, a long press operation, a drag operation, a double-click operation, etc. on an editable element; it can be a voice-triggered voice control operation, such as a voice instruction to Combine specific editable elements (the name of the editable element is included in the voice); it can be a visual control operation triggered by the human eye, such as determining the selected editable element by tracking the eyeball movement trajectory, and moving the editable element for combination ; It may even be a combination of at least two operation modes, such as combining gesture operation and voice operation to implement editing operations on editable elements, which is not limited in this embodiment of the present application.
  • the editing operation on the editable element is taken as an example for illustration, but it is not limited thereto.
  • the editable elements in the micro-application editing interface include logic elements for the user to implement logic control, and A service element used to implement a service call.
  • users can logically combine logical elements and service elements to realize business logic editing.
  • micro application development does not require developers to have a code programming foundation, and the development process has a higher degree of visualization. While lowering the threshold for micro application development, there are Helps improve the development efficiency of micro applications.
  • the editable element is displayed in the micro-app editing interface in the form of a draggable control.
  • the draggable control can be a draggable button, and the element name of the editable element is displayed on the draggable button , the embodiment of the present application does not limit the specific expression form of the editable element.
  • step 303 the business logic structure corresponding to the trigger is displayed in the micro-application editing interface.
  • the business logic structure is obtained by combining editable elements, and the trigger is used to execute the business logic represented by the business logic structure based on the trigger event.
  • the micro-application is composed of multiple triggers. For each trigger in the micro-application, when the trigger is triggered by a corresponding trigger event, the micro-application engine executes the control logic under the trigger, In this way, the service under the trigger is called to realize the business logic corresponding to the trigger.
  • the trigger event may be generated by user interaction, such as a voice trigger event, a shake event, a tap event, etc., or the trigger event may also be a service output event after calling the service. Not limited.
  • the development process of the micro application is the development process of each trigger.
  • the computer device displays the business logic corresponding to the current trigger in the form of a business logic structure.
  • the business logic structure is a tree structure, a building block structure, etc., which is not limited in this embodiment.
  • the above-mentioned steps 302 and 303 are the development process of a single trigger in the micro-application.
  • the computer device executes the above-mentioned steps 302 and 303 repeatedly, so as to complete the development of each trigger.
  • Step 304 generating a micro-application based on the business logic structure corresponding to at least one trigger.
  • the computer device After the development of each trigger in the micro-application is completed, the computer device generates the application code of the micro-application based on the business logic structure corresponding to each trigger. In a possible implementation manner, the computer device converts the business logic structure into a script language, so as to obtain a micro-application script corresponding to the micro-application. Compared with traditional application installation packages, micro-app scripts, as a script file with low code volume, are conducive to dynamic deployment and dynamic update.
  • the computer device when the computer device develops the micro application through the locally installed micro application editor, the computer device generates the application code through the micro application editor; when the computer device develops the micro application through the web version micro application editor, the computer The device then generates the application code through the server.
  • the developed micro-app will be uploaded to the micro-app store server, and the micro-app will be audited by the micro-app store server (it can be manually audited or machine audited), and the micro-app will be uploaded after passing the audit. Micro-apps are uploaded to the micro-app store for other users to download and use.
  • the micro-application editor is composed of a UI module 41 , a code generation module 42 , an element generation module 43 , a preview module 44 and a cloud service module 45 .
  • the UI module 41 is responsible for the display of various UI elements in the micro-application editing interface
  • the code generation module 42 is responsible for coding the visualized business logic structure
  • the element generation module 43 is responsible for generating logical elements and service elements
  • the preview module 44 is responsible for realizing the development In the process, the execution effect of local business logic is previewed
  • the cloud service module 45 is responsible for interacting with the service market server 46 (for service search) and the micro application store server 47 (for submitting micro applications).
  • the editable elements are used to form the business logic structure corresponding to the trigger in the micro-application, and then based on the corresponding
  • the business logic structure generates micro-applications to realize micro-application development.
  • the micro-app editing interface includes a logic selection area, a service selection area, and an editing area;
  • Receive editing operations on editable elements in the micro-app editing interface including:
  • the business logic structure corresponding to the trigger is displayed in the micro application editing interface, including:
  • the business logic structure corresponding to the trigger is displayed in the editing area.
  • the logic selection area contains at least one type selection control, and different type selection controls correspond to different types of control logic;
  • Receives the first drag operation on a logical element in a logical selection area including:
  • At least one candidate logic element belonging to the target type is displayed in the logic selection area, where the target type is the type of control logic corresponding to the target type selection control;
  • a first drag operation on a target logical element among the candidate logical elements is received.
  • the method further includes:
  • the service selection area includes a service search control
  • Receives a second drag operation on a service element in the service selection area including:
  • At least one candidate service element is displayed in the service selection area, and the candidate service element is obtained from the server based on the service search term;
  • a second drag operation on the target service element among the candidate service elements is received.
  • the method further includes:
  • the method further includes:
  • an editable element into the position of the target element if the position of the target element is legal including:
  • the node type corresponding to the editable element matches the child node type, it is determined that the position of the target element is legal, and the editable element is inserted into the position of the target element.
  • the method further includes:
  • an invalid prompt is displayed, and the invalid prompt is used to indicate that the editing operation on the editable element is invalid.
  • the micro-application editing interface includes a trigger area, and the trigger area is used to display at least one created trigger;
  • the method Before receiving a drag operation on an editable element in the micro-app editing interface, the method further includes:
  • a trigger setting interface is displayed, and the trigger setting interface is used to set a trigger event of the trigger;
  • the method also includes:
  • the business logic structure displayed in the micro-app editing interface is switched.
  • a micro-application is generated based on at least one business logic structure corresponding to the trigger, including:
  • the node codes corresponding to each node are obtained;
  • the trigger codes corresponding to each trigger are merged to obtain a micro-application script of the micro-application.
  • the micro-app editing interface includes a preview area and a preview control
  • Methods also include:
  • the method further includes:
  • a logic selection area, a service selection area, and an editing area are set in the micro-application editing interface, wherein the logic selection area displays candidate logic elements for developers to select and use, and the service selection area displays candidate service elements for use. The developer chooses to use it, and the editing area is used to display the edited business logic structure.
  • the computer device receives the first drag operation on the logic element in the logic selection area, and receives the second drag operation on the service element in the service selection area.
  • adding a logic element in the business logic structure through a drag operation may include the following steps.
  • Step 501 in response to a trigger operation on the target type selection control, display at least one candidate logic element belonging to the target type in the logic selection area, where the target type is the type of control logic corresponding to the target type selection control.
  • logical elements are divided into multiple types in advance, and the logical selection area displays type selection controls corresponding to different types of logical elements.
  • logical elements may be divided into general types, variable types, business types, and mathematical operation types.
  • logic elements of general type are used to realize general control logic, such as conditional logic, loop logic, waiting logic, random logic, combination logic, etc.
  • logic elements of variable type are used to realize variable control (including variable definition, variable addition and deletion, and modification, etc.)
  • the variables can include simple variables, list variables, Map variables, etc.
  • business-type logic elements are used to implement business-related logic, such as device selection logic
  • mathematical operation type logic elements are used to use mathematical functions Realize basic mathematical operations, such as addition, subtraction, multiplication, and division logic, trigonometric function logic, and so on.
  • the user can first select the target type selection control from the logic selection area.
  • the computer device determines the candidate logic elements belonging to the object type corresponding to the object type selection control, and displays the candidate logic elements in the logic selection area.
  • the candidate logic elements may be displayed in the logic selection area in the form of draggable components.
  • a logic selection area 62 is set in the micro-application editing interface 61, and several type selection controls 621 are displayed in the logic selection area 62 (in the figure, four type selection controls are taken as an example for illustration) sexual description).
  • the logical selection area 62 displays several candidate logical elements 622 belonging to the "general type”.
  • Step 502 receiving a first drag operation on a target logical element among candidate logical elements.
  • the computer device determines that the target logic element needs to be added to the business logic.
  • Step 503 displaying a logic setting interface corresponding to the target logic element, where the logic setting interface is used to set logic parameters of the target logic element.
  • the computer device Define, determine at least one logic parameter that needs to be set when adding the target logic element, and then display a logic setting interface for setting the logic parameter.
  • the number and types of logic parameters required to be set by different logic elements are different.
  • the logic parameters to be set include at least one condition parameter; for waiting logic elements, the logic parameters to be set include the waiting time; for random logic elements, the logic parameters to be set include random range parameters, etc. etc.; for the device selection logic element, the logical parameters to be set include the device selection range, device type or device identification, etc., and the embodiment of the present application does not limit the specific types of the logical parameters.
  • the upper layer of the editing interface 61 displays a logic setting interface 64 for setting the waiting time.
  • Step 504 acquire the set logic parameters through the logic setting interface.
  • the computer device acquires the logic parameters set in the logic setting interface, and adds the target logic element into the business logic structure.
  • the candidate logic element 622 is added to the business logic structure 631 of the editing area 63 .
  • adding a service element in the business logic structure through a drag operation may include the following steps.
  • Step 701 in response to a trigger operation on the service search control, at least one candidate service element is displayed in the service selection area, and the candidate service element is obtained from the server based on the service search term.
  • the type of control logic in the business logic is relatively limited, but the services controlled by the control logic are various.
  • a service search control is set in the service selection area, and developers can input service search words through the service search control, so that the service The marketplace server searches for matching services based on the service search term.
  • the candidate service element searched by the service market server may be a service element corresponding to a static service, or may be a service element corresponding to a dynamic service.
  • the candidate service element may be a specific service implementation, or a service collection composed of several service implementations with the same function.
  • the candidate service element can be a static service in instant messaging application A, or it can be composed of a static payment service in instant messaging application A, a static payment service in payment application B, and a dynamic payment service.
  • candidate service elements may be displayed in the service selection area in the form of draggable components.
  • the service market server stores the service definition corresponding to each service element, the service definition includes information such as service name, service description, etc., and the service market server can search the service definition based on the service search term to determine the Candidate service elements that match the service search term.
  • a service selection area 65 is set in the micro-application editing interface 61 , and a service search control 651 is displayed in the service selection area 65 .
  • the computer device performs a service query through the service market server, and displays several candidate service elements 652 obtained from the query.
  • Step 702 receiving a second drag operation on the target service element among the candidate service elements.
  • the computer device determines that the target service element needs to be added to the business logic.
  • Step 703 displaying a service setting interface corresponding to the target service element, where the service setting interface is used to set service parameters of the target service element.
  • the computer device when receiving a drag operation on the target service element, determine at least one service parameter that needs to be set when adding the target service element, and then display a service setting interface for setting the service parameter.
  • the number and types of service parameters required to be set by different service elements are different.
  • the required service parameters include source device, destination parameters, and media type parameters (including audio, video, and control);
  • required service parameters include gesture types, etc.
  • the embodiment of this application does not limit specific service parameters.
  • the service parameters include service input parameters and service invocation mode
  • the service invocation mode may include synchronous invocation and asynchronous invocation, wherein, for a synchronous invocation service, the output of the current service will be used as the input of the subsequent service, and for an asynchronous invocation service , the service output event of the current service will be used as the trigger event of the trigger.
  • the upper layer of the editing interface 61 displays a service setting interface 66, which is used to set service input parameters and service calls Way.
  • Step 704 obtain the set service parameters through the service setting interface.
  • the computer device obtains the service parameters set in the service setting interface, and adds the target service element to the business logic structure.
  • the micro-application editing interface further includes a preview area and a preview control.
  • the computer device When receiving a selection operation on the target element in the business logic structure, in response to the trigger operation on the preview control, the computer device generates a preview code corresponding to the target element, and displays the execution effect of the target element in the preview area by executing the preview code.
  • the preview code is generated by a preview code generation module and executed by a preview code runtime module, and the preview code runtime module is used to convert the preview code into an animation for display.
  • a preview area 69 is set in the micro-application editing interface 61. After the user selects an element (service element and/or logical element) in the editing area 63 and clicks the preview control, the preview area 69 is Shows the execution animation of the selected element.
  • the micro-application editor provides a verification function, through which the micro-application editor can verify the legality of the editing position of the editable element, so as to improve the legality of the drag operation . As shown in FIG. 9 , after receiving the editing operation on the editable element, the following steps may also be included.
  • Step 901 based on the target editing position of the editable element, determine the target element position of the editable element in the business logic structure.
  • the target editing position refers to a drag end position of a drag operation performed on an editable element.
  • the computer device determines the target element position of the editable element based on the relative positional relationship between the target drag position and existing elements in the business logic structure.
  • the editable element is added to the business logic structure as a node, and the target element position is used to represent the parent-child node relationship between the editable element and the existing element.
  • the computer device checks the legality of the target element position based on the target element position and the element features of the editable element. If the target element position is legal (that is, the editable element is displayed at the target element position is legal), then execute step 902, and if the target location is illegal, then execute step 903.
  • Step 902 if the position of the target element is legal, insert the editable element into the position of the target element.
  • both the service element and the logical element include respective corresponding node definitions, and the node definitions include:
  • Node key (key), name and description, where the key is a unique identifier, and the name and description are used to indicate the meaning of the element;
  • this attribute corresponds to the service input parameter of the service, and can be used to indicate the type and candidate value of the attribute;
  • Type which is used to indicate the node type (ie element type) of the current node, and subsequently control the position supported by the node based on the type;
  • the child nodes and the child node types of each child node are used to indicate the node types supported by the child nodes of the current node when it serves as the parent node.
  • the node of the service element (camera service) is defined as follows:
  • the computer device determines the sub-node type of the sub-node corresponding to the position of the target element, and checks whether the node type corresponding to the editable element matches the type of the sub-node. If the two match, it is determined that the position of the target element is legal; if the two do not match, it is determined that the position of the target element is illegal.
  • the target element position corresponds to the child node type of the child node, and is obtained from the node definition of the target element position corresponding to the parent node.
  • the computer device inserts the editable element into the position of the target element.
  • the computer device obtains the node definition of "Logic 3" based on the target element position of "Service 4". Since in the node definition, the child node type of the child node includes “service”, and the node type corresponding to "service 4" is "service”, the computer device determines that "service 4" is legal when the target element is located, and puts " Service 4" is inserted at the target element position in the business logic structure.
  • step 903 when the position of the target element is illegal, an invalid prompt is displayed, and the invalid prompt is used to indicate that the editing operation on the editable element is invalid.
  • the computer device when the editing operation is a drag operation, when the position of the target element is invalid, the computer device will not insert the editable element into the position of the target element, and display an invalid prompt to inform the user of the current drag operation on the editable element invalid.
  • the invalid prompt may be in the form of text, pop-up window, animation, etc., which is not limited in this embodiment.
  • the computer device checks the legality of the editing operation based on the target element position and element definition indicated by the editing operation, so as to avoid business logic abnormalities caused by improper editing positions of the editable elements and affect the normal operation of the micro-application. Helps improve the accuracy of the business logic editing process.
  • the micro-application editing interface further includes a trigger area, in which at least one created trigger is displayed, and the user can create a trigger, delete a trigger, and switch a trigger through the trigger area.
  • the computer device in response to a trigger creation operation in the trigger area, displays a trigger setting interface, where the trigger setting interface is used to set a triggering event of the trigger. After obtaining the set trigger event through the trigger setting interface, the computer device sets the corresponding trigger.
  • the trigger creation operation may be a click operation on the trigger creation control in the trigger area, or a click operation on a new trigger option in the menu option (for example, by right-clicking the mouse in the trigger area to call out), This embodiment does not limit it.
  • the trigger event may be registered in the server in advance, and the computer device may obtain the registered trigger event from the server, and specify the trigger event for the created trigger.
  • event parameters corresponding to the trigger event can also be set.
  • the event parameters set for the context-aware time may include location parameters (eg, home, office, etc.).
  • additional conditions can also be added as the triggering condition of the trigger. For example, when the trigger event is a shake event, an additional foreground application condition can be added, that is, when a shake event is detected and a specified application is running in the foreground, a corresponding trigger is triggered.
  • the computer device clears the editing area, so that the user can edit the business logic of the newly added trigger in the editing area.
  • a trigger area 67 is set in the micro-app editing interface 61 , and the trigger area 67 includes a trigger identification 671 of a created trigger and a trigger creation control 672 .
  • the computer device displays the trigger setting interface 68, so that the user can set a trigger event for the newly added trigger 3 .
  • the computer device clears the editing area 63 so that the user can edit the business logic of the trigger 3 .
  • the user may need to switch back and forth between multiple triggers.
  • the computer device in response to the trigger switching operation in the trigger area, switches the Business logic structure.
  • the editing area 63 currently displays the business logic structure corresponding to the trigger 1.
  • the editing area 63 switches to display the business logic structure corresponding to the trigger 2. logical structure.
  • the process may include the following steps:
  • Step 1301 traversing each trigger in the micro-application.
  • the computer device traverses each trigger, and performs the following steps 1302 to 1304 on each trigger.
  • Step 1302 for each trigger in the micro-application, traverse each node in the business logic structure corresponding to the trigger.
  • the computer device traverses the triggers corresponding to each node (corresponding to the element) in the business logic structure, and determines the parent-child node relationship between the nodes.
  • trigger 1 by traversing the first business logic structure 1401 corresponding to trigger 1, the computer device determines that both service 1 and service 2 are child nodes corresponding to logic 1, and service 3 and logic 3 is a child node of logic 2, and service 4 and service 5 are both child nodes of logic 3.
  • the computer device determines that service 6 and service 7 are child nodes corresponding to logic 3.
  • Step 1303 based on the mapping relationship between nodes and codes, obtain the node codes corresponding to each node.
  • the mapping relationship between nodes and codes is predefined, and when the business logic structure is converted into code form, the computer device maps the attributes of the nodes according to the mapping relationship , to get the node code.
  • the node itself is mapped as a node node in the xml, and the attribute of the node is mapped as an attribute (attribute) in the xml.
  • Step 1304 generating a trigger code corresponding to the trigger based on the node code corresponding to each node.
  • the computer device nests the node codes based on the parent-child relationship between the nodes to obtain the trigger code corresponding to the current trigger.
  • the node code corresponding to the child node is nested in the node code corresponding to its parent node.
  • Step 1305 merging the trigger codes corresponding to each trigger to obtain the micro-application script of the micro-application.
  • the computer device After obtaining the trigger codes corresponding to each trigger, the computer device further merges the trigger codes of each trigger to obtain the micro-application script of the micro-application. During subsequent running of the micro-application, the computer device parses the micro-application script through the micro-application engine.
  • the computer device merges the trigger codes of trigger 1 and trigger 2 to obtain a micro-app script 1403 in xml format.
  • the micro-application editor supports automatically adding interactive functions for the micro-application.
  • the interactive function includes at least one of sharing and sharing. kind.
  • the computer device in response to a trigger operation on the submission control in the micro-application editing interface, displays a submission setting interface, where the submission setting interface is used to set basic application information and interaction information of the micro-application.
  • the basic application information may include an application name, an application icon, an application description, etc.
  • the interaction information is used to indicate a specific interaction mode of the micro-application.
  • the computer device determines target interaction information of the micro-application.
  • the target interaction information includes at least one of the micro-app sharing method and the sharing method
  • the sharing (sharing) method may include touch sharing (sharing), link sharing (sharing) or QR code sharing ( at least one of the shared).
  • a sharing method selection control 1502 is set in the submission setting interface 1501 , and the user can set the sharing method of the micro-app before submitting the micro-app.
  • the computer device packages and uploads the micro-application and target interaction information to the server.
  • the micro-app manager can share or share the micro-apps with other devices or users based on the target interaction information, and then realize cross-device linkage with the help of micro-apps.
  • FIG. 16 shows a structural block diagram of a micro-application development device provided by an embodiment of the present application.
  • the device can include:
  • Interface display module 1601 configured to display the micro-application editing interface
  • the receiving module 1602 is configured to receive editing operations on editable elements in the micro-app editing interface, the editable elements include logic elements and service elements, the logic elements are used to implement logic control, and the service elements are used to Realize service invocation, the editing operation refers to the operation of combining the editable elements;
  • a structure display module 1603, configured to display the business logic structure corresponding to the trigger in the micro-app editing interface, the business logic structure is obtained by combining the editable elements, and the trigger is used to execute the business based on the trigger event Business logic represented by logical structure;
  • a generating module 1604 configured to generate a micro-application based on the business logic structure corresponding to at least one trigger.
  • the micro-app editing interface includes a logic selection area, a service selection area, and an editing area;
  • the receiving module 1602 includes:
  • the first receiving unit is configured to receive a first drag operation on the logical element in the logical selection area, where the first drag operation refers to the operation of dragging the logical element from the logical selection area to the editing area;
  • the second receiving unit is configured to receive a second drag operation on the service element in the service selection area, the second drag operation refers to dragging the service element from the service selection area to the Edit area operations;
  • the structure display module 1603 is used for:
  • the business logic structure corresponding to the trigger is displayed in the editing area.
  • the logic selection area includes at least one type selection control, and different type selection controls correspond to different types of control logic;
  • the first receiving unit is used for:
  • At least one candidate logic element belonging to the target type is displayed in the logic selection area, and the target type is the type of control logic corresponding to the target type selection control;
  • a first drag operation on a target logical element among the candidate logical elements is received.
  • the device also includes:
  • the logic parameter setting module is used to display the logic setting interface corresponding to the target logic element, and the logic setting interface is used to set the logic parameters of the target logic element; and obtain the set logic parameters through the logic setting interface.
  • the service selection area includes a service search control
  • the second receiving unit is used for:
  • At least one candidate service element is displayed in the service selection area, and the candidate service element is obtained from a server based on a service search term;
  • a second drag operation on a target service element among the candidate service elements is received.
  • the device also includes:
  • the service parameter setting module is used to display the service setting interface corresponding to the target service element, and the service setting interface is used to set the service parameter of the target service element;
  • the set service parameters are acquired through the service setting interface.
  • the device also includes:
  • a position determining module configured to determine the target element position of the editable element in the business logic structure based on the target editing position of the editable element
  • An insertion module configured to insert the editable element into the position of the target element when the position of the target element is legal.
  • the plug-in module includes:
  • a node type determining unit configured to determine the type of the child node corresponding to the position of the target element
  • An inserting unit configured to determine that the position of the target element is legal when the node type corresponding to the editable element matches the type of the child node, and insert the editable element into the position of the target element.
  • the device also includes:
  • a prompt module configured to display an invalid prompt when the position of the target element is illegal, and the invalid prompt is used to indicate that the editing operation on the editable element is invalid.
  • the micro-app editing interface includes a trigger area, and the trigger area is used to display at least one created trigger;
  • the device also includes:
  • a trigger setting module configured to display a trigger setting interface in response to a trigger creation operation in the trigger area, and the trigger setting interface is used to set the trigger event of the trigger; through the trigger setting The interface acquires the set trigger event, and sets the trigger.
  • the device also includes:
  • a switching module configured to switch the business logic structure displayed in the micro-application editing interface in response to a trigger switching operation in the trigger area.
  • the generating module 1604 is configured to:
  • the trigger codes corresponding to each of the triggers are combined to obtain the micro-application script of the micro-application.
  • the micro-app editing interface includes a preview area and a preview control
  • the device also includes:
  • a preview module configured to receive a selection operation on a target element in the business logic structure; generate a preview code corresponding to the target element in response to a trigger operation on the preview control; execute the preview code in the preview The area shows how the target element performs.
  • the device also includes:
  • a submission module configured to display a submission setting interface in response to a trigger operation on the submission control in the micro-application editing interface; in response to an interaction mode selection operation in the submission setting interface, determine the target interaction information of the micro-application; The micro-application and the target interaction information are packaged and uploaded to the server.
  • the editable elements are used to form the business logic structure corresponding to the trigger in the micro-application, and then based on the corresponding
  • the business logic structure generates micro-applications to realize micro-application development.
  • FIG. 17 shows a structural block diagram of a computer device provided by an exemplary embodiment of the present application.
  • the computer device 1700 may be implemented as the developer device in each of the foregoing embodiments.
  • Computer device 1700 may include one or more of the following components: processor 1710 and memory 1720 .
  • Processor 1710 may include one or more processing cores.
  • the processor 1710 uses various interfaces and lines to connect various parts of the entire computer device 1700, and executes by running or executing instructions, programs, code sets or instruction sets stored in the memory 1720, and calling data stored in the memory 1720.
  • the processor 1710 may adopt at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware.
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 1710 can integrate one or more of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a neural network processor (Neural-network Processing Unit, NPU) and a modem, etc.
  • a central processing unit Central Processing Unit, CPU
  • an image processor Graphics Processing Unit, GPU
  • a neural network processor Neural-network Processing Unit, NPU
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used to render and draw the content that needs to be displayed on the touch screen
  • the NPU is used to realize the function of artificial intelligence (AI)
  • the modem is used to process Wireless communication. It can be understood that the foregoing modem may also not be integrated into the processor 1710, but implemented by a single chip.
  • the memory 1720 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory, ROM).
  • the memory 1720 includes a non-transitory computer-readable storage medium.
  • the memory 1720 may be used to store instructions, programs, codes, sets of codes or sets of instructions.
  • the memory 1720 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), Instructions and the like for implementing the various method embodiments described below; the storage data area can store data created according to the use of the computer device 1700 (such as audio data, phonebook) and the like.
  • the structure of the computer device 1700 shown in the above drawings does not constitute a limitation to the computer device, and the computer device may include more or less components than those shown in the illustration, or combine certain components, or a different arrangement of components.
  • the computer device 1700 also includes a display screen, a camera component, 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. components, which will not be repeated here.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores at least one program code, and the program code is loaded and executed by a processor to realize the micro-application described in each of the above embodiments. development method.
  • An embodiment of the present application provides a computer program product, where the computer program product includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the micro-application development method provided in various optional implementation manners of the above aspect.
  • the "plurality” mentioned herein refers to two or more than two.
  • “And/or” describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently.
  • the character "/” generally indicates that the contextual objects are an "or” relationship.
  • the numbering of the steps described herein only exemplarily shows a possible sequence of execution among the steps. In some other embodiments, the above-mentioned steps may not be executed according to the order of the numbers, such as two different numbers The steps are executed at the same time, or two steps with different numbers are executed in the reverse order as shown in the illustration, which is not limited in this embodiment of the present application.

Landscapes

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

Abstract

一种微应用的开发方法、装置、设备、存储介质及程序产品,属于应用技术领域。该方法包括:显示微应用编辑界面(301);接收对微应用编辑界面中可编辑元素的编辑操作,可编辑元素包括逻辑元素和服务元素,逻辑元素用于实现逻辑控制,服务元素用于实现服务调用(302);在微应用编辑界面中显示触发器对应的业务逻辑结构,业务逻辑结构由可编辑元素组合得到,触发器用于基于触发事件执行业务逻辑结构表征的业务逻辑(303);基于至少一个触发器对应的业务逻辑结构生成微应用(304)。

Description

微应用的开发方法、装置、设备、存储介质及程序产品
本申请要求于2021年11月29日提交的申请号为202111432111.6、发明名称为“微应用的开发方法、装置、设备、存储介质及程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及应用技术领域,特别涉及一种微应用的开发方法、装置、设备、存储介质及程序产品。
背景技术
随着应用(Application)技术的不断发展,越来越多功能丰富的应用应运而生,为人们的日常生活带来便利。
通常情况下,应用需要由开发人员通过专业的编程工具,并使用相应的编程语言进行代码编写和调试,导致应用的开发门槛较高,且开发效率较低。
发明内容
本申请实施例提供了一种微应用的开发方法、装置、设备、存储介质及程序产品。所述技术方案如下:
一方面,本申请实施例提供了一种微应用的开发方法,所述方法包括:
显示微应用编辑界面;
接收对所述微应用编辑界面中可编辑元素的编辑操作,所述可编辑元素包括逻辑元素和服务元素,所述逻辑元素用于实现逻辑控制,所述服务元素用于实现服务调用,所述编辑操作指对所述可编辑元素进行组合的操作;
在所述微应用编辑界面中显示触发器对应的业务逻辑结构,所述业务逻辑结构由所述可编辑元素组合得到,所述触发器用于基于触发事件执行所述业务逻辑结构表征的业务逻辑;
基于至少一个所述触发器对应的所述业务逻辑结构生成微应用。
另一方面,本申请实施例提供了一种微应用的开发装置,所述装置包括:
界面显示模块,用于显示微应用编辑界面;
接收模块,用于接收对所述微应用编辑界面中可编辑元素的编辑操作,所述可编辑元素包括逻辑元素和服务元素,所述逻辑元素用于实现逻辑控制,所述服务元素用于实现服务调用,所述编辑操作指对所述可编辑元素进行组合的操作;
结构显示模块,用于在所述微应用编辑界面中显示触发器对应的业务逻辑结构,所述业务逻辑结构由所述可编辑元素组合得到,所述触发器用于基于触发事件执行所述业务逻辑结构表征的业务逻辑;
生成模块,用于基于至少一个所述触发器对应的所述业务逻辑结构生成微应用。
另一方面,本申请实施例提供了一种计算机设备,所述计算机设备包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如上述方面所述的微应用的开发方法。
另一方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条程序代码,所述程序代码由处理器加载并执行以实现如上述方面所述的微应用的开发方法。
另一方面,本申请实施例提供了一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述方面的各种可选实现方式中提供的微应用的开发方法。
附图说明
图1是本申请一个示例性实施例示出的微应用脚本的示意图;
图2示出了本申请一个示例性实施例提供的微应用系统的系统架构图;
图3示出了本申请一个示例性实施例提供的微应用的开发方法的流程图;
图4是本申请一个示例性实施例示出的微应用编辑器的结构示意图;
图5是本申请一个示例性实施例示出的逻辑元素添加过程的流程图;
图6是本申请一个示例性实施例示出的逻辑元素添加过程的界面示意图;
图7是本申请一个示例性实施例示出的服务元素添加过程的流程图;
图8是本申请一个示例性实施例示出的服务元素添加过程的界面示意图;
图9是本申请一个示例性实施例示出的拖动合法性检测过程的流程图;
图10是本申请一个示例性实施例示出的业务逻辑结构更新过程的实施示意图;
图11是本申请一个示例性实施例示出的触发器创建过程的界面示意图;
图12是本申请一个示例性实施例示出的触发器切换过程的界面示意图;
图13是本申请一个示例性实施例示出的微应用脚本生成过程的流程图;
图14是本申请一个示例性实施例示出的微应用脚本生成过程的实施示意图;
图15是本申请一个示例性实施例示出的微应用提交设置界面的界面示意图;
图16示出了本申请一个实施例提供的微应用的开发装置的结构框图;
图17示出了本申请一个示例性实施例提供的计算机设备的结构方框图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
为了方便理解,下面对本申请实施例中涉及的名词进行说明。
微应用:微应用可以看做是由服务构成的集合,用于通过服务之间的调用实现特定的业务逻辑,即微应用的应用功能。不同于传统应用只能运行在特定操作系统上,微应用的服务可以是不同操作系统上的服务,即微应用支持异构操作系统,可以实现跨平台运行。
不同于传统应用在使用前需要下载,并与设备绑定,微应用采用订阅机制,并与用户绑定,即通过用户账号下的某一设备订阅微应用后,该用户账号下的各个设备均可以使用该微应用。
微应用脚本:又称为微应用定义,用于控制微应用中服务之间的调用关系,采用脚本语言描述了一段通用的业务逻辑。其中,该脚本语言可以为xml、javascript等等。
如图1所示,微应用脚本11由若干触发器12构成,而每个触发器12又是由触发事件13、控制逻辑14以及控制逻辑14所控制的若干服务15构成。其中,微应用脚本中的服务并非服务本身,而是服务的服务标识。
不同于传统应用在运行前需要下载并安装应用安装包,比如,在运行安卓应用前,需要下载Android应用程序包(Android application package,APK),微应用在运行前只需要下载对应的微应用脚本,微应用过程中,即通过微应用引擎执行该微应用脚本,实现应用功能。相较于传统应用,微应用脚本的代码量更低,因此占用的存储空间较小,且有利于动态部署和更新。
服务:作为微应用运行过程中的最小单元,用于实现特定任务。比如,截屏服务用于实现设备截屏功能、投屏服务用于实现设备间的显示画面投屏等等。并且,微应用运行过程中调用的服务可以为当前设备上的服务,也可以是其他设备上的服务。比如,微应用运行过程中,可以通过调用其他设备上的截屏服务,获取其他设备的设备截屏,并通过调用图片显示服务,对其他设备的设备截屏进行显示。
不同于传统应用安装过程中,需要将运行过程中使用到的所有服务预先安装在本地,由于微应用的业务逻辑在运行过程中动态组装,因此微应用中的服务支持动态部署,即在运行过程基于当前设备所执行的业务逻辑,将业务逻辑对应的服务动态部署至当前设备。相应的,当通过多个设备实现同一微应用的应用功能时,由于不同设备的业务逻辑可能不同,因此不同设备处部署的服务也可能存在差异,即微应用中的服务具有差分部署的特性。
本申请实施例中,构成微应用的服务可以包括静态服务和动态服务,其中,静态服务指由宿主应用提供的服务,需要预安装在设备中,而动态服务则是指支持动态部署的服务,可以在微应用运行过程中动态部署在设备中。
图2示出了本申请一个示例性实施例提供的微应用系统的系统架构图。该系统中包括用户设备210、服务器220以及开发者设备230。
用户设备210是具有微应用运行功能的电子设备,该电子设备可以是智能手机、平板电脑、个人计算机、车机等等,本实施例对此不作限定。图2中以用户设备210包括智能手机、平板电脑以及车机为例进行说明,但并不对此构成限定。
在一种可能的实施方式中,用户设备210中设置有微应用引擎211,微应用引擎211作为控制微应用运行的核心,包括脚本管理模块2111、事件总线模块2112、应用调度模块2113、运行时模块2114以及服务调度模块2115。
脚本管理模块2111用于管理用户设备210中存储的各个微应用的微应用脚本,并负责对微应用脚本进行解析,以此确定该微应用脚本中的触发器以及触发器下的服务。可选的,脚本管理模块2111还用于在接收到对微应用的订阅操作时,下载相应的微应用脚本,在接收到对微应用的订阅取消操作时,删除微应用对应的微应用脚本。
事件总线模块2112用于与应用调度模块2113进行配合,基于触发事件实现微应用调度。在一些实施例中,事件总线模块2112下挂载有多个微应用对应的触发器,由于同一触发事件可能会触发多个订阅的微应用,因此事件总线模块2112接收到触发事件后,交由应用调度模块2113从若干个微应用中确定出需要运行的微应用。其中,应用调度模块2113可以基于调度策略自动确定微应用,也可以交由用户手动选择微应用。
运行时模块2114用于执行微应用脚本中的控制逻辑,从而基于该控制逻辑与服务调度模块2115进行交互,由服务调度模块2115进行服务调用。
此外除了设置有微应用引擎211外,用户设备210中还设置有服务治理模块212、数据同步模块213以及服务网关214。
其中,服务治理模块212用于管理设备中预安装的静态服务;数据同步模块213用于在微应用引擎211的状态发生变更时(比如服务产生的事件导致状态变更),向其他计算机设备进行状态同步,确保不同计算机设备处微应用引擎211的状态一致性。
服务网关214用于基于服务调度模块2115的服务调用请求进行服务调用,具体包括代理管理模块2141以及生命周期管理模块2142。代理管理模块2141中设置有不同的服务代理,服务代理用于将统一格式的服务调用请求进行转换,得到符合真实服务格式要求的请求。生命周期管理模块2142用于管理服务的生命周期,可以包括静态服务生命周期管理模块以及动态服务生命周期管理模块。
微应用运行过程中,用户设备210除了可以通过自身的服务网关214进行服务调用外,还可以通过其他设备的服务网关214进行服务调用(由微应用的业务逻辑决定),即可以实现跨设备的服务调用。
针对不同部署方式的服务,如图2所示,用户设备210中还设置有静态服务模块216和动态服务模块215。静态服务模块216用于管理预安装的静态服务,动态服务模块215则用于管理动态部署的动态服务。
在一些实施例中,动态服务模块215中包含的服务可以对应不同运行环境、不同部署形态或不同编程开发语言。图2中以动态服务模块215包含安卓动态服务2151、Web动态服务2152以及容器动态服务2153为例进行示意性说明,但并不对此构成限定。
服务器220是一台服务器、若干台服务器构成的服务集群或云计算中心。根据服务器集群中各服务器所实现功能进行划分,如图2所示,服务器集群中包括用户资源管理服务器221、微应用商店服务器222、服务市场服务器223以及云端服务库224。
用户资源管理服务器221中包括用户管理模块2211、应用管理模块2212、服务管理模块2213、设备管理模块2214以及安全模块2215。用户管理模块2211用于对使用微应用的用户账号进行管理;应用管理模块2212用于对不同用户账号下订阅的微应用进行管理;服务管理模块2213用于对调用的服务进行管理;设备管理模块2214用于对用户账号与设备之间的绑定关系进行管理;安全模块2215则用于在交互过程中进行安全性验证。
微应用商店服务器222用于提供微应用订阅服务。用户需要使用微应用时,可以通过微应用商店服务器222提供的微应用搜索引擎2221进行微应用搜索,进而从搜索结果中选择订阅微应用。
在一些实施例中,微应用商店服务器222接收到对微应用的订阅操作后,将用户账号与所订阅微应用的应用标识发送至用户资源管理服务器221,由用户资源管理服务器221中的应用管理模块2212更新用户账号与微应用的订阅关系。进一步的,用户管理模块2211与设备管理模块2214,确定该用户账号下的其他设备,并向其他设备推送订阅通知,以便其他设备从微应用商店服务器222处下载微应用的微应用脚本。示意性的,如图2所示,用户“张三”通过智能手机订阅微应用后,登陆“张三”这一用户账号的车机和平板电脑接收到用户资源管理服务器221推送的订阅通知,从而基于通知中的应用标识下载微应用的微应用脚本。
服务市场服务器223是面向开发者,用于提供服务查询服务的服务器。开发者设备230可以通过服务市场服务器223提供的服务搜索引擎2231进行服务搜索,并将搜索到的服务(包括动态服务和静态服务)应用于开发的微应用中,进而将开发完成的微应用上传至微应用商店服务器222,供其他用户下载使用。
除此之外,开发者也可以进行服务开发,并将开发的服务上传至云端服务库224。后续用户设备210即可从云端服务库224处下载并部署该服务。
开发者设备230是开发者使用的电子设备。在一种可能的实现方式中,开发者设备230中安装有微应用编辑器(即客户端),开发者可以通过该微应用编辑器进行微应用开发;在另一种可能的实现方式中,开发者设备230可以访问网页版微应用编辑器,从而通过网页版微应用编辑器进行微应用开发。
本申请实施例提供的微应用编辑器具有服务搜索功能,借助该服务搜索功能,开发者设备230可以从服务市场服务器223处查询满足需求的服务,从而将服务添加至开发的微应用中。
此外,本申请实施例提供的微应用编辑器作为一种可视化编辑器,开发者可以通过对界面中显示的可编辑元素(逻辑元素或服务元素)进行拖动,实现业务逻辑编辑,进而由微应用编辑器基于编辑得到的业务逻辑生成微应用的代码。
可选的,开发者通过开发者设备230可以进行微应用开发,也可以进行服务开发,其中,开发得到的微应用将被提交至微应用商店服务器2221,并在通过审核后供用户设备210下载使用;开发得到的服务将被提交至云端服务库224,并在通过审核后供其他开发者使用。
需要说明的是,上述实施例仅以用户设备210和开发者设备230为不同设备为例进行示意性的说明,在实际应用中,普通用户也可以使用用户设备210进行微应用开发,本实施例对此不作限定。
此外,上述实施例仅对微应用系统的基础架构进行了说明,微应用系统中还可以包括其他计算机设备或实现其他功能的服务器,本实施例并不对此构成限定。
请参考图3,其示出了本申请一个示例性实施例提供的微应用的开发方法的流程图,本申请实施例以该方法应用于图2所示的计算机设备(可以为用户设备或开发者设备)为例进行说明,该方法包括:
步骤301,显示微应用编辑界面。
在一种可能的实施方式中,当计算机设备开启微应用编辑器后,微应用编辑器显示微应用编辑界面;或者,当访问网页版微应用编辑器时,计算机设备即通过浏览器显示微应用编辑界面。
本申请实施例中的微应用编辑界面为可视化编辑界面,其中包含可编辑元素,微应用开发过程中,可以通过拖动可编辑元素实现业务逻辑的编辑。
步骤302,接收对微应用编辑界面中可编辑元素的编辑操作,可编辑元素包括逻辑元素和服务元素,逻辑元素用于实现逻辑控制,服务元素用于实现服务调用,编辑操作指对可编辑元素进行组合的操作。
在一些实施例中,该编辑操作可以为手势操作,比如对可编辑元素的点击操作、长按操作、拖动操作、双击操作等等;可以是通过语音触发语音控制操作,比如通过语音指示将特定的可编辑元素进行组合(语音中包含可编辑元素的名称);可以是通过人眼触发的视觉控制操作,比如通过追踪眼球移动轨迹确定选中的可编辑元素,并移动可编辑元素以进行组合;甚至可以是至少两种操作方式的组合,比如手势操作与语音操作相结合实现对可编辑元素的编辑操作,本申请实施例对此不作限定。下述实施例中,以对可编辑元素的编辑操作为拖动操作为例进行说明,但并不对此构成限定。
由于微应用的业务逻辑由控制逻辑以及该控制逻辑所控制的至少一个服务构成,因此在一种可能的实施方式中,微应用编辑界面中的可编辑元素包括用户实现逻辑控制的逻辑元素,以及用于实现服务调用的服务元素。微应用开发过程中,用户可以将逻辑元素以及服务元素进行逻辑组合,以实现业务逻辑编辑。
相较于纯代码开发,通过对组件形式的可视化可编辑元素进行编辑操作,微应用开发无需开发者具有代码编程基础,且开发过程的可视化程度更高,在降低微应用开发门槛的同时,有助于提高微应用的开发效率。
可选的,可编辑元素以可拖拽控件的形式显示在微应用编辑界面中,比如,该可拖拽控件可以为可拖拽按键,且可拖拽按键上显示有可编辑元素的元素名称,本申请实施例并不对可编辑元素的具体表现形式进行限定。
步骤303,在微应用编辑界面中显示触发器对应的业务逻辑结构,业务逻辑结构由可编辑元素组合得到,触发器用于基于触发事件执行业务逻辑结构表征的业务逻辑。
在一种可能的实施方式中,微应用由多个触发器构成,对于微应用中的各个触发器,当触发器被相应的触发事件触发时,微应用引擎即执行触发器下的控制逻辑,从而调用触发器下的服务,实现触发器对应的业务逻辑。
其中,该触发事件可以由用户交互产生的时间,比如语音触发事件、摇一摇事件、敲击事件等等,或者,该触发事件也可以是调用服务后的服务输出事件,本实施例对此不作限定。
微应用的开发过程即各个触发器的开发过程。为了提高触发器对应业务逻辑的可视性,计算机设备以业务逻辑结构的形式,对当前触发器对应的业务逻辑进行展示。其中,该业务逻辑结构为树形结构、积木结构等等,本实施例对此不作限定。
上述步骤302和303为微应用中单个触发器的开发过程,当微应用由多个触发器构成时,计算机设备即重复执行上述步骤302和303,从而完成各个触发器的开发。
步骤304,基于至少一个触发器对应的业务逻辑结构生成微应用。
完成微应用中各个触发器的开发后,计算机设备即基于各个触发器对应的业务逻辑结构生成微应用的应用代码。在一种可能的实施方式中,计算机设备将业务逻辑结构转换为脚本语言,从而得到微应用对应的微应用脚本。相较于传统的应用安装包,微应用脚本作为一种低代码量的脚本文件,有利于动态部署和动态更新。
可选的,当计算机设备通过本地安装的微应用编辑器进行微应用开发时,计算机设备即通过微应用编辑器生成应用代码;当计算机设备通过网页版微应用编辑器进行微应用开发时,计算机设备即通过服务器生成应用代码。
在一种可能的实施方式中,开发完成的微应用将被上传至微应用商店服务器,由微应用商店服务器对 微应用进行审核(可以是人工审核或机器审核),并在通过审核后将该微应用上架至微应用商店,以便其他用户下载使用。
在一个示意性的实施例中,如图4所示,微应用编辑器由UI模块41、代码生成模块42、元素生成模块43、预览模块44以及云端服务模块45构成。其中,UI模块41负责微应用编辑界面中各个UI元素的展示,代码生成模块42负责对可视化的业务逻辑结构进行代码化,元素生成模块43负责生成逻辑元素以及服务元素,预览模块44负责实现开发过程中局部业务逻辑的执行效果预览,云端服务模块45则负责与服务市场服务器46(进行服务搜索)以及微应用商店服务器47(提交微应用)进行交互。
综上所述,本申请实施例中,通过对微应用编辑界面中的可编辑元素进行编辑操作,从而利用可编辑元素组成微应用中触发器对应的业务逻辑结构,进而基于各个触发器对应的业务逻辑结构生成微应用,实现微应用开发。采用本申请实施例提供的方案,用户通过简单的编辑操作即可完成微应用的开发,无需使用专业的编程语言编写代码,实现了基于可视化组件的微应用开发,有助于降低微应用的开发门槛,并提高了微应用的开发效率。
可选的,微应用编辑界面中包括逻辑选择区域、服务选择区域以及编辑区域;
接收对微应用编辑界面中可编辑元素的编辑操作,包括:
接收对逻辑选择区域中逻辑元素的第一拖动操作,第一拖动操作指将逻辑元素由逻辑选择区域拖动至编辑区域的操作;
接收对服务选择区域中服务元素的第二拖动操作,第二拖动操作指将服务元素由服务选择区域拖动至编辑区域的操作;
在微应用编辑界面中显示触发器对应的业务逻辑结构,包括:
在编辑区域显示触发器对应的业务逻辑结构。
可选的,逻辑选择区域中包含至少一个类型选择控件,不同的类型选择控件对应不同类型的控制逻辑;
接收对逻辑选择区域中逻辑元素的第一拖动操作,包括:
响应于对目标类型选择控件的触发操作,在逻辑选择区域显示属于目标类型的至少一个候选逻辑元素,目标类型为目标类型选择控件对应控制逻辑的类型;
接收对候选逻辑元素中目标逻辑元素的第一拖动操作。
可选的,接收对候选逻辑元素中目标逻辑元素的第一拖动操作之后,方法还包括:
显示目标逻辑元素对应的逻辑设置界面,逻辑设置界面用于设置目标逻辑元素的逻辑参数;
通过逻辑设置界面获取设置的逻辑参数。
可选的,服务选择区域中包含服务搜索控件;
接收对服务选择区域中服务元素的第二拖动操作,包括:
响应于对服务搜索控件的触发操作,在服务选择区域显示至少一个候选服务元素,候选服务元素基于服务搜索词从服务器处查询得到;
接收对候选服务元素中目标服务元素的第二拖动操作。
可选的,接收对候选服务元素中目标服务元素的第二拖动操作之后,方法还包括:
显示目标服务元素对应的服务设置界面,服务设置界面用于设置目标服务元素的服务参数;
通过服务设置界面获取设置的服务参数。
可选的,接收对微应用编辑界面中可编辑元素的编辑操作之后,方法还包括:
基于可编辑元素的目标编辑位置,确定可编辑元素在业务逻辑结构中的目标元素位置;
在目标元素位置合法的情况下,将可编辑元素插入目标元素位置。
可选的,在目标元素位置合法的情况下,将可编辑元素插入目标元素位置,包括:
确定目标元素位置对应子节点的子节点类型;
在可编辑元素对应的节点类型与子节点类型匹配的情况下,确定目标元素位置合法,并将可编辑元素插入目标元素位置。
可选的,基于可编辑元素的目标编辑位置,确定可编辑元素在业务逻辑结构中的目标元素位置之后,方法还包括:
在目标元素位置不合法的情况下,显示无效提示,无效提示用于指示对可编辑元素的编辑操作无效。
可选的,微应用编辑界面中包括触发器区域,触发器区域用于显示创建的至少一个触发器;
接收对微应用编辑界面中可编辑元素的拖动操作之前,方法还包括:
响应于触发器区域内的触发器创建操作,显示触发器设置界面,触发器设置界面用于设置触发器的触发事件;
通过触发器设置界面获取设置的触发事件,并设置触发器。
可选的,方法还包括:
响应于触发器区域内的触发器切换操作,切换微应用编辑界面中显示的业务逻辑结构。
可选的,基于至少一个触发器对应的业务逻辑结构生成微应用,包括:
遍历微应用中的各个触发器;
对于微应用中的各个触发器,遍历触发器对应的业务逻辑结构中的各个节点;
基于节点与代码之间的映射关系,得到各个节点对应的节点代码;
基于各个节点对应的节点代码生成触发器对应的触发器代码;
对各个触发器对应的触发器代码进行合并,得到微应用的微应用脚本。
可选的,微应用编辑界面中包括预览区域以及预览控件;
方法还包括:
接收对业务逻辑结构中目标元素的选择操作;
响应于对预览控件的触发操作,生成目标元素对应的预览代码;
通过执行预览代码在预览区域展示目标元素的执行效果。
可选的,基于至少一个触发器对应的业务逻辑结构生成微应用之后,方法还包括:
响应于对微应用编辑界面中提交控件的触发操作,显示提交设置界面;
响应于提交设置界面内的交互方式选择操作,确定微应用的目标交互信息;
将微应用以及目标交互信息打包上传至服务器。
在一些实施例中,微应用编辑界面中设置有逻辑选择区域、服务选择区域以及编辑区域,其中,逻辑选择区域显示有候选逻辑元素供开发者选择使用,服务选择区域则显示有候选服务元素供开发者选择使用,编辑区域则用于展示已编辑完成的业务逻辑结构。相应的,计算机设备接收对逻辑选择区域中逻辑元素的第一拖动操作,以及接收对服务选择区域中服务元素的第二拖动操作。
在一种可能的实施方式中,如图5所示,通过拖动操作在业务逻辑结构中添加逻辑元素可以包括如下步骤。
步骤501,响应于对目标类型选择控件的触发操作,在逻辑选择区域显示属于目标类型的至少一个候选逻辑元素,目标类型为目标类型选择控件对应控制逻辑的类型。
由于存在大量实现不同逻辑功能的控制逻辑,若直接将各个可用的逻辑元素显示在逻辑选择区域,将会造成逻辑元素的选择效率较低。因此在一种可能的实施方式中,逻辑元素预先被划分为多种类型,而逻辑选择区域则显示不同类型逻辑元素对应的类型选择控件。
关于逻辑元素的类型划分方式,在一种可能的实施方式中,逻辑元素可以被划分为通用类型、变量类型、业务类型和数学运算类型。其中,通用类型的逻辑元素用于实现通用控制逻辑,比如条件逻辑、循环逻辑、等待逻辑、随机逻辑、组合逻辑等等;变量类型的逻辑元素用于实现变量控制(包括变量定义、变量增删和修改等等),该变量可以包括简单变量、列表变量、Map变量等等;业务类型的逻辑元素用于实现与业务相关的逻辑,比如设备选择逻辑;数学运算类型的逻辑元素用于借助数学函数实现基础数学运算,比如加减乘除运算逻辑、三角函数运算逻辑等等。需要说明的是,本申请实施例仅以上述逻辑元素分类方式为例进行示意性说明,但并不对此构成限定。
在选择需要添加至业务逻辑的逻辑元素时,用户首先可以从逻辑选择区域选中目标类型选择控件。相应的,当接收到对目标类型选择控件的触发操作时,计算机设备确定属于目标类型选择控件对应目标类型的候选逻辑元素,并将候选逻辑元素显示在逻辑选择区域中。可选的,候选逻辑元素可以以可拖拽组件的形式显示在逻辑选择区域。
示意性的,如图6所示,微应用编辑界面61中设置有逻辑选择区域62,且该逻辑选择区域62中显示有若干类型选择控件621(图中以4个类型选择控件为例进行示意性说明)。当用户点击“通用类型”的类型选择控件621时,逻辑选择区域62显示若干个属于“通用类型”的候选逻辑元素622。
步骤502,接收对候选逻辑元素中目标逻辑元素的第一拖动操作。
在一种可能的实施方式中,当接收到对候选逻辑元素中目标逻辑元素的长按操作,且进一步接收到对目标逻辑元素的拖动操作,且拖动操作的拖动终点位于编辑区域时,计算机设备确定该目标逻辑元素需要被添加至业务逻辑。
示意性的,如图6所示,当需要在业务逻辑中添加等待逻辑时,用户可以长按选中“等待逻辑”对应的候选逻辑元素622,并将候选逻辑元素622拖动至编辑区域63。
步骤503,显示目标逻辑元素对应的逻辑设置界面,逻辑设置界面用于设置目标逻辑元素的逻辑参数。
由于执行逻辑元素对应的控制逻辑时,需要使用到相应的参数,因此在一种可能的实施方式中,在接收到对目标逻辑元素的拖动操作时,计算机设备基于该目标逻辑元素对应的元素定义,确定添加该目标逻辑元素时所需设置的至少一个逻辑参数,进而显示用于设置该逻辑参数的逻辑设置界面。
其中,不同逻辑元素所需设置的逻辑参数的数量以及类型不同。比如,对于条件逻辑元素,所需设置的逻辑参数包括至少一个条件参数;对于等待逻辑元素,所需设置的逻辑参数包括等待时长;对于随机逻 辑元素,所需设置的逻辑参数包括随机范围参数等等;对于设备选择逻辑元素,所需设置的逻辑参数包括设备选择范围、设备类型或设备标识等等,本申请实施例并不对逻辑参数的具体类型进行限定。
示意性的,如图6所示,当用户将候选逻辑元素622拖动至编辑区域63时,编辑界面61的上层显示逻辑设置界面64,该逻辑设置界面64用于设置等待时长。
步骤504,通过逻辑设置界面获取设置的逻辑参数。
进一步的,计算机设备获取逻辑设置界面中设置的逻辑参数,并将该目标逻辑元素添加至业务逻辑结构中。
示意性的,如图6所示,用户在逻辑设置界面64中输入等待时长“500ms”,并点击确定控件后,候选逻辑元素622即被添加至编辑区域63的业务逻辑结构631中。
在一种可能的实施方式中,如图7所示,通过拖动操作在业务逻辑结构中添加服务元素可以包括如下步骤。
步骤701,响应于对服务搜索控件的触发操作,在服务选择区域显示至少一个候选服务元素,候选服务元素基于服务搜索词从服务器处查询得到。
通常情况下,业务逻辑中控制逻辑的类型较为有限,而控制逻辑所控制的服务却多种多样。为了提高开发者从海量服务中选择所需服务的效率,在一种可能的实施方式中,服务选择区域中设置有服务搜索控件,开发者可以通过该服务搜索控件输入服务搜索词,从而由服务市场服务器基于该服务搜索词搜索匹配的服务。其中,服务市场服务器搜索到的候选服务元素可以是静态服务对应的服务元素,也可以是动态服务对应的服务元素。
可选的,候选服务元素可以是具体的服务实现,也可以是有若干相同功能的服务实现所构成的服务集合。比如,当服务关键词为支付时,该候选服务元素可以为即时通信应用A中的静态服务,也可以是由即时通信应用A中的静态支付服务、支付应用B中的静态支付服务以及动态支付服务构成的服务集合。
可选的,候选服务元素可以以可拖拽组件的形式显示在服务选择区域。
在一些实施例中,服务市场服务器中存储由各个服务元素对应的服务定义,该服务定义中包含服务名称、服务说明等信息,服务市场服务器可以基于服务搜索词对服务定义进行搜索,从而确定出与服务搜索词匹配的候选服务元素。
示意性的,图8所示,微应用编辑界面61中设置有服务选择区域65,且该服务选择区域65中显示有服务搜索控件651。当用户在服务搜索控件651中输入服务关键词“A”时,计算机设备即通过服务市场服务器进行服务查询,并对查询得到的若干候选服务元素652进行显示。
步骤702,接收对候选服务元素中目标服务元素的第二拖动操作。
在一种可能的实施方式中,当接收到对候选服务元素中目标逻辑元素的长按操作,且进一步接收到对目标服务元素的拖动操作,且拖动操作的拖动终点位于编辑区域时,计算机设备确定该目标服务元素需要被添加至业务逻辑。
示意性的,如图8所示,当需要在业务逻辑中添加服务A1时,用户可以长按选中“服务A1”对应的候选服务元素652,并将候选服务元素652拖动至编辑区域63。
步骤703,显示目标服务元素对应的服务设置界面,服务设置界面用于设置目标服务元素的服务参数。
由于执行服务元素对应的服务时,需要使用到相应的参数,因此在一种可能的实施方式中,在接收到对目标服务元素的拖动操作时,计算机设备基于该目标服务元素对应的元素定义,确定添加该目标服务元素时所需设置的至少一个服务参数,进而显示用于设置该服务参数的服务设置界面。
其中,不同服务元素所需设置的服务参数的数量以及类型不同。比如,对于重定向服务元素,所需设置的服务参数包括源端设备、目的端参数以及媒体类型参数(包括音频、视频和控制);对于手势识别服务,所需设置服务参数包括手势类型等等,本申请实施例并不对具体的服务参数进行限定。
可选的,该服务参数包括服务输入参数以及服务调用方式,且服务调用方式可以包括同步调用和异步调用,其中,对于同步调用服务,当前服务的输出将作为后续服务的输入,对于异步调用服务,当前服务的服务输出事件将作为触发器的触发事件。
示意性的,如图8所示,当用户将候选服务元素652拖动至编辑区域63时,编辑界面61的上层显示服务设置界面66,该服务设置界面66用于设置服务输入参数以及服务调用方式。
步骤704,通过服务设置界面获取设置的服务参数。
进一步的,计算机设备获取服务设置界面中设置的服务参数,并将该目标服务元素添加至业务逻辑结构中。
示意性的,如图8所示,用户在服务设置界面66完成服务参数设置,并点击确定控件后,候选服务元素652“服务A1”即被添加至编辑区域63的业务逻辑结构631中。
为了提高开发效率,使用户在开发过程中能够实时查看已编辑业务逻辑的执行效果,在一种可能的实施方式中,微应用编辑界面中还包括预览区域以及预览控件。当接收到对业务逻辑结构中目标元素的选择操作时,响应于对预览控件的触发操作,计算机设备生成目标元素对应的预览代码,并通过执行预览代码在预览区域展示目标元素的执行效果。
可选的,该预览代码由预览代码生成模块生成,并由预览代码运行时模块执行,该预览代码运行时模块用于将预览代码转换为动画进行展示。示意性的,如图6所示,微应用编辑界面61中设置有预览区域69,用户选中编辑区域63中的元素(服务元素和/或逻辑元素)并点击预览控件后,预览区域69中即展示选中元素的执行动画。
用户进行业务逻辑编辑时,需要保证可编辑元素之间能够正确组合,以此保证业务逻辑正常运行。在一种可能的实施方式中,微应用编辑器提供了校验功能,通过该功能,微应用编辑器可以对可编辑元素的编辑位置进行合法性校验,以此提高拖动操作的合法性。如图9所示,接收到对可编辑元素的编辑操作之后,还可以包括如下步骤。
步骤901,基于可编辑元素的目标编辑位置,确定可编辑元素在业务逻辑结构中的目标元素位置。
可选的,该目标编辑位置指对可编辑元素进行的拖动操作的拖动终点位置。在一种可能的实施方式中,计算机设备基于目标拖动位置与业务逻辑结构中已有元素之间的相对位置关系,确定可编辑元素的目标元素位置。
可选的,可编辑元素作为节点被添加至业务逻辑结构中,该目标元素位置用于表征可编辑元素与已有元素之间的父子节点关系。
在一种可能的实施方式中,计算机设备基于目标元素位置以及可编辑元素的元素特征,对该目标元素位置进行合法性检测,若该目标元素位置合法(即可编辑元素显示在该目标元素位置时合法),则执行步骤902,若该目标位置不合法,则执行步骤903。
步骤902,在目标元素位置合法的情况下,将可编辑元素插入目标元素位置。
在一种可能的实施方式中,服务元素和逻辑元素均包含各自对应的节点定义,该节点定义中包括:
1、节点key(键)、名称以及说明,其中,key为唯一标识符,名称和说明用于指示元素的含义;
2、属性,对于服务元素,该属性与服务的服务输入参数对应,可以用于指示属性的类型以及候选值;
3、类型,用于指示当前节点的节点类型(即元素类型),后续即基于类型控制节点所支持的位置;
4、子节点以及各个子节点的子节点类型,用于指示当前节点作为父节点时,其下属子节点所支持的节点类型。
在一个示意性的例子中,服务元素(相机服务)的节点定义如下:
Figure PCTCN2022127027-appb-000001
可选的,在对目标元素位置进行合法性检测时,计算机设备确定目标元素位置对应子节点的子节点类型,并检测可编辑元素对应的节点类型与该子节点类型是否匹配。若两者匹配,则确定该目标元素位置合法;若两者不匹配,则确定该目标元素位置不合法。其中,该目标元素位置对应子节点的子节点类型,从该目标元素位置对应父节点的节点定义中获取得到。
进一步的,当目标元素位置合法时,计算机设备将可编辑元素插入目标元素位置。
示意性的,如图10所示,计算机设备基于“服务4”的目标元素位置,获取“逻辑3”的节点定义。由于该节点定义中,子节点的子节点类型包括“服务”,而“服务4”对应的节点类型为“服务”,因此计算机设备确定“服务4”在该目标元素位置时合法,并将“服务4”插入业务逻辑结构中的目标元素位置。
步骤903,在目标元素位置不合法的情况下,显示无效提示,无效提示用于指示对可编辑元素的编辑操作无效。
可选的,当编辑操作为拖动操作时,当目标元素位置不合法时,计算机设备不会将可编辑元素插入目标元素位置,并显示无效提示,告知用户对可编辑元素的当前拖动操作无效。其中,该无效提示可以采用文字、弹窗、动画等形式,本实施例对此不作限定。
本实施例中,计算机设备基于编辑操作所指示的目标元素位置以及元素定义,对编辑操作进行合法性检验,避免由于该可编辑元素的编辑位置不当导致业务逻辑异常,影响微应用的正常运行,有助于提高业 务逻辑编辑过程的准确性。
当微应用由多个触发器构成时,微应用开发过程中,用户需要编辑各个触发器各自对应的触发器业务逻辑。在一些实施例中,微应用编辑界面中还包括触发器区域,该触发器区域中显示有创建的至少一个触发器,用户可以通过该触发器区域创建触发器、删除触发器以及切换触发器。
在一种可能的实施方式,响应于触发器区域内的触发器创建操作,计算机设备显示触发器设置界面,该触发器设置界面用于设置触发器的触发事件。通过触发器设置界面获取到设置的触发事件后,计算机设备即设置相应的触发器。
其中,该触发器创建操作可以是对触发器区域中触发器创建控件的点击操作,或者,对菜单选项(比如通过在触发器区域内右击鼠标呼出)中新增触发器选项的点击操作,本实施例对此不作限定。
可选的,该触发事件可以预先在服务器中进行注册,计算机设备可以从服务器获取注册的触发事件,并为创建的触发器指定触发事件。
此外,在设置触发事件时,还可以设置触发事件对应的事件参数。比如,当触发事件的场景感知事件时,为场景感知时间设置的事件参数可以包括位置参数(例如家、办公室等等)。
除了从注册的触发事件中指定触发器的触发事件外,还可以增加额外的条件作为触发器的触发条件。比如,触发事件为摇一摇事件时,可以额外增加前台应用条件,即在检测到摇一摇事件,且前台运行指定应用时,触发相应的触发器。
可选的,完成触发器创建后,计算机设备清空编辑区域,以便用户在编辑区域编辑新增触发器的业务逻辑。
示意性的,如图11所示,微应用编辑界面61中设置有触发器区域67,该触发器区域67中包含已创建触发器的触发器标识671以及触发器创建控件672。当用户点击触发器创建控件672时,计算机设备显示触发器设置界面68,以便用户可以为新增的触发器3设置触发事件。完成触发器创建后,计算机设备清空编辑区域63,以便用户编辑触发器3的业务逻辑。
微应用开发过程中,用户可能需要在多个触发器之间来回切换,在一种可能的实施方式中,响应于触发器区域内的触发器切换操作,计算机设备切换微应用编辑界面中展示的业务逻辑结构。
示意性的,如图12所示,编辑区域63当前显示触发器1对应的业务逻辑结构,当用户点击触发器区域67中的触发器2时,编辑区域63即切换显示触发器2对应的业务逻辑结构。
关于微应用的生成方式,在一种可能的实施方式中,如图13所示,该过程可以包括如下步骤:
步骤1301,遍历微应用中的各个触发器。
当微应用由多个触发器构成时,计算机设备遍历各个触发器,并对各个触发器执行下述步骤1302至1304。
示意性的,如图14所示,对于应用名为“测试”的微应用,计算机设备遍历该微应用中的触发器1和触发器2。
步骤1302,对于微应用中的各个触发器,遍历触发器对应的业务逻辑结构中的各个节点。
进一步的,计算机设备通过遍历触发器对应业务逻辑结构中的各个节点(与元素相对应),并确定节点之间的父子节点关系。示意性的,如图14所示,对于触发器1,通过遍历触发器1对应的第一业务逻辑结构1401,计算机设备确定服务1和服务2均为逻辑1对应的子节点,服务3和逻辑3均为逻辑2的子节点,服务4和服务5均逻辑3的子节点。对于触发器2,通过遍历触发器2对应的第二业务逻辑结构1402,计算机设备确定服务6和服务7为逻辑3对应的子节点。
步骤1303,基于节点与代码之间的映射关系,得到各个节点对应的节点代码。
在一种可能的实施方式中,针对不同类型的节点,预先定义节点与代码之间的映射关系,将业务逻辑结构转换为代码形式时,计算机设备即根据该映射关系,对节点的属性进行映射,得到节点代码。
在一些实施例中,当代码采用xml格式时,基于该映射关系,节点本身被映射为xml中的node节点,而节点的属性则被映射为xml中的attribute(属性)。
步骤1304,基于各个节点对应的节点代码生成触发器对应的触发器代码。
进一步的,计算机设备基于节点之间的父子关系,对节点代码进行嵌套,得到当前触发器对应的触发器代码。其中,子节点对应的节点代码嵌套在其父节点对应的节点代码中。
示意性的,如图14所示,由于服务1和服务2为逻辑1的子节点,因此服务1和服务2映射得到的代码嵌套在逻辑1映射得到的代码中;服务3和服务4为逻辑3的子节点,因此服务4和服务5映射得到的代码嵌套在逻辑3映射得到的代码中。
步骤1305,对各个触发器对应的触发器代码进行合并,得到微应用的微应用脚本。
得到各个触发器对应的触发器代码后,计算机设备进一步对各个触发器的触发器代码进行合并,得到 微应用的微应用脚本。后续微应用运行过程中,计算机设备即通过微应用引擎对微应用脚本进行解析。
示意性的,如图14所示,计算机设备对触发器1和触发器2的触发器代码进行合并,得到xml格式的微应用脚本1403。
为了进一步简化微应用的开发流程,使开发者能够更加关注业务逻辑本身,对于开发完成的微应用,微应用编辑器支持为微应用自动添加交互功能,该交互功能包括分享以及共享中的至少一种。在一种可能的实施方式中,响应于对微应用编辑界面中提交控件的触发操作,计算机设备显示提交设置界面,该提交设置界面用于设置微应用的基本应用信息以及交互信息。其中,该基本应用信息可以包括应用名称、应用图标以及应用说明等等,该交互信息用于指示微应用具体交互方式。
响应于提交设置界面内的交互方式选择操作,计算机设备确定微应用的目标交互信息。可选的,该目标交互信息包括微应用的分享方式以及共享方式中的至少一种,且分享(共享)方式可以包括碰一碰分享(共享)、链接分享(共享)或二维码分享(共享)中的至少一种。
示意性的,如图15所示,提交设置界面1501中设置有分享方式选择控件1502,用户在提交微应用前,可以设置微应用的分享方式。
进一步的,计算机设备将微应用以及目标交互信息打包上传至服务器。后续其它用户设备从微应用商店中下载该微应用时,除了下载微应用的微应用脚本外,还会获取该目标交互信息。在使用微应用时,微应用管理器(用于统一管理订阅的微应用)即可基于目标交互信息,将微应用分享或共享给其他设备或用户,进而借助微应用实现跨设备联动。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图16,其示出了本申请一个实施例提供的微应用的开发装置的结构框图。该装置可以包括:
界面显示模块1601,用于显示微应用编辑界面;
接收模块1602,用于接收对所述微应用编辑界面中可编辑元素的编辑操作,所述可编辑元素包括逻辑元素和服务元素,所述逻辑元素用于实现逻辑控制,所述服务元素用于实现服务调用,所述编辑操作指对所述可编辑元素进行组合的操作;
结构显示模块1603,用于在所述微应用编辑界面中显示触发器对应的业务逻辑结构,所述业务逻辑结构由所述可编辑元素组合得到,所述触发器用于基于触发事件执行所述业务逻辑结构表征的业务逻辑;
生成模块1604,用于基于至少一个所述触发器对应的所述业务逻辑结构生成微应用。
可选的,所述微应用编辑界面中包括逻辑选择区域、服务选择区域以及编辑区域;
所述接收模块1602,包括:
第一接收单元,用于接收对所述逻辑选择区域中所述逻辑元素的第一拖动操作,第一拖动操作指将逻辑元素由逻辑选择区域拖动至编辑区域的操作;
第二接收单元,用于接收对所述服务选择区域中所述服务元素的第二拖动操作,所述第二拖动操作指将所述服务元素由所述服务选择区域拖动至所述编辑区域的操作;
所述结构显示模块1603,用于:
在所述编辑区域显示所述触发器对应的所述业务逻辑结构。
可选的,所述逻辑选择区域中包含至少一个类型选择控件,不同的类型选择控件对应不同类型的控制逻辑;
所述第一接收单元,用于:
响应于对目标类型选择控件的触发操作,在所述逻辑选择区域显示属于目标类型的至少一个候选逻辑元素,所述目标类型为所述目标类型选择控件对应控制逻辑的类型;
接收对所述候选逻辑元素中目标逻辑元素的第一拖动操作。
可选的,所述装置还包括:
逻辑参数设置模块,用于显示所述目标逻辑元素对应的逻辑设置界面,所述逻辑设置界面用于设置所述目标逻辑元素的逻辑参数;通过所述逻辑设置界面获取设置的所述逻辑参数。
可选的,所述服务选择区域中包含服务搜索控件;
所述第二接收单元,用于:
响应于对所述服务搜索控件的触发操作,在所述服务选择区域显示至少一个候选服务元素,所述候选服务元素基于服务搜索词从服务器处查询得到;
接收对所述候选服务元素中目标服务元素的第二拖动操作。
可选的,所述装置还包括:
服务参数设置模块,用于显示所述目标服务元素对应的服务设置界面,所述服务设置界面用于设置所 述目标服务元素的服务参数;
通过所述服务设置界面获取设置的所述服务参数。
可选的,所述装置还包括:
位置确定模块,用于基于所述可编辑元素的目标编辑位置,确定所述可编辑元素在所述业务逻辑结构中的目标元素位置;
插入模块,用于在所述目标元素位置合法的情况下,将所述可编辑元素插入所述目标元素位置。
可选的,所述插入模块,包括:
节点类型确定单元,用于确定所述目标元素位置对应子节点的子节点类型;
插入单元,用于在所述可编辑元素对应的节点类型与所述子节点类型匹配的情况下,确定所述目标元素位置合法,并将所述可编辑元素插入所述目标元素位置。
可选的,所述装置还包括:
提示模块,用于在所述目标元素位置不合法的情况下,显示无效提示,所述无效提示用于指示对所述可编辑元素的编辑操作无效。
可选的,所述微应用编辑界面中包括触发器区域,所述触发器区域用于显示创建的至少一个所述触发器;
所述装置还包括:
触发器设置模块,用于响应于所述触发器区域内的触发器创建操作,显示触发器设置界面,所述触发器设置界面用于设置所述触发器的触发事件;通过所述触发器设置界面获取设置的所述触发事件,并设置所述触发器。
可选的,所述装置还包括:
切换模块,用于响应于所述触发器区域内的触发器切换操作,切换所述微应用编辑界面中显示的所述业务逻辑结构。
可选的,所述生成模块1604,用于:
遍历所述微应用中的各个所述触发器;
对于所述微应用中的各个所述触发器,遍历所述触发器对应的所述业务逻辑结构中的各个节点;
基于节点与代码之间的映射关系,得到各个所述节点对应的节点代码;
基于各个所述节点对应的所述节点代码生成所述触发器对应的触发器代码;
对各个所述触发器对应的所述触发器代码进行合并,得到所述微应用的微应用脚本。
可选的,所述微应用编辑界面中包括预览区域以及预览控件;
所述装置还包括:
预览模块,用于接收对所述业务逻辑结构中目标元素的选择操作;响应于对所述预览控件的触发操作,生成所述目标元素对应的预览代码;通过执行所述预览代码在所述预览区域展示所述目标元素的执行效果。
可选的,所述装置还包括:
提交模块,用于响应于对所述微应用编辑界面中提交控件的触发操作,显示提交设置界面;响应于所述提交设置界面内的交互方式选择操作,确定所述微应用的目标交互信息;将所述微应用以及所述目标交互信息打包上传至服务器。
综上所述,本申请实施例中,通过对微应用编辑界面中的可编辑元素进行编辑操作,从而利用可编辑元素组成微应用中触发器对应的业务逻辑结构,进而基于各个触发器对应的业务逻辑结构生成微应用,实现微应用开发。采用本申请实施例提供的方案,用户通过简单的编辑操作即可完成微应用的开发,无需使用专业的编程语言编写代码,实现了基于可视化组件的微应用开发,有助于降低微应用的开发门槛,并提高了微应用的开发效率。
请参考图17,其示出了本申请一个示例性实施例提供的计算机设备的结构方框图。该计算机设备1700可以实现成为上述各个实施例中的开发者设备。计算机设备1700可以包括一个或多个如下部件:处理器1710和存储器1720。
处理器1710可以包括一个或者多个处理核心。处理器1710利用各种接口和线路连接整个计算机设备1700内的各个部分,通过运行或执行存储在存储器1720内的指令、程序、代码集或指令集,以及调用存储在存储器1720内的数据,执行计算机设备1700的各种功能和处理数据。可选地,处理器1710可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1710可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)、神经网络处理器(Neural-network Processing Unit,NPU)和调制解调器等中的一种或几种的组合。其中,CPU 主要处理操作系统、用户界面和应用程序等;GPU用于负责触摸显示屏所需要显示的内容的渲染和绘制;NPU用于实现人工智能(Artificial Intelligence,AI)功能;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1710中,单独通过一块芯片进行实现。
存储器1720可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。可选地,该存储器1720包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器1720可用于存储指令、程序、代码、代码集或指令集。存储器1720可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等;存储数据区可存储根据计算机设备1700的使用所创建的数据(比如音频数据、电话本)等。
除此之外,本领域技术人员可以理解,上述附图所示出的计算机设备1700的结构并不构成对计算机设备的限定,计算机设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,计算机设备1700中还包括显示屏、摄像组件、麦克风、扬声器、射频电路、输入单元、传感器(比如加速度传感器、角速度传感器、光线传感器等等)、音频电路、WiFi模块、电源、蓝牙模块等部件,在此不再赘述。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有至少一条程序代码,所述程序代码由处理器加载并执行以实现如上各个实施例所述的微应用的开发方法。
本申请实施例提供了一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述方面的各种可选实现方式中提供的微应用的开发方法。
应当理解的是,在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。另外,本文中描述的步骤编号,仅示例性示出了步骤间的一种可能的执行先后顺序,在一些其它实施例中,上述步骤也可以不按照编号顺序来执行,如两个不同编号的步骤同时执行,或者两个不同编号的步骤按照与图示相反的顺序执行,本申请实施例对此不作限定。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (31)

  1. 一种微应用的开发方法,所述方法包括:
    显示微应用编辑界面;
    接收对所述微应用编辑界面中可编辑元素的编辑操作,所述可编辑元素包括逻辑元素和服务元素,所述逻辑元素用于实现逻辑控制,所述服务元素用于实现服务调用,所述编辑操作指对所述可编辑元素进行组合的操作;
    在所述微应用编辑界面中显示触发器对应的业务逻辑结构,所述业务逻辑结构由所述可编辑元素组合得到,所述触发器用于基于触发事件执行所述业务逻辑结构表征的业务逻辑;
    基于至少一个所述触发器对应的所述业务逻辑结构生成微应用。
  2. 根据权利要求1所述的方法,其中,所述微应用编辑界面中包括逻辑选择区域、服务选择区域以及编辑区域;
    所述接收对所述微应用编辑界面中可编辑元素的编辑操作,包括:
    接收对所述逻辑选择区域中所述逻辑元素的第一拖动操作,所述第一拖动操作指将所述逻辑元素由所述逻辑选择区域拖动至所述编辑区域的操作;
    接收对所述服务选择区域中所述服务元素的第二拖动操作,所述第二拖动操作指将所述服务元素由所述服务选择区域拖动至所述编辑区域的操作;
    所述在所述微应用编辑界面中显示触发器对应的业务逻辑结构,包括:
    在所述编辑区域显示所述触发器对应的所述业务逻辑结构。
  3. 根据权利要求2所述的方法,其中,所述逻辑选择区域中包含至少一个类型选择控件,不同的类型选择控件对应不同类型的控制逻辑;
    所述接收对所述逻辑选择区域中所述逻辑元素的第一拖动操作,包括:
    响应于对目标类型选择控件的触发操作,在所述逻辑选择区域显示属于目标类型的至少一个候选逻辑元素,所述目标类型为所述目标类型选择控件对应控制逻辑的类型;
    接收对所述候选逻辑元素中目标逻辑元素的第一拖动操作。
  4. 根据权利要求3所述的方法,其中,所述接收对所述候选逻辑元素中目标逻辑元素的第一拖动操作之后,所述方法还包括:
    显示所述目标逻辑元素对应的逻辑设置界面,所述逻辑设置界面用于设置所述目标逻辑元素的逻辑参数;
    通过所述逻辑设置界面获取设置的所述逻辑参数。
  5. 根据权利要求2所述的方法,其中,所述服务选择区域中包含服务搜索控件;
    所述接收对所述服务选择区域中所述服务元素的第二拖动操作,包括:
    响应于对所述服务搜索控件的触发操作,在所述服务选择区域显示至少一个候选服务元素,所述候选服务元素基于服务搜索词从服务器处查询得到;
    接收对所述候选服务元素中目标服务元素的第二拖动操作。
  6. 根据权利要求5所述的方法,其中,所述接收对所述候选服务元素中目标服务元素的第二拖动操作之后,所述方法还包括:
    显示所述目标服务元素对应的服务设置界面,所述服务设置界面用于设置所述目标服务元素的服务参数;
    通过所述服务设置界面获取设置的所述服务参数。
  7. 根据权利要求1至6任一所述的方法,其中,所述接收对所述微应用编辑界面中可编辑元素的编辑操作之后,所述方法还包括:
    基于所述可编辑元素的目标编辑位置,确定所述可编辑元素在所述业务逻辑结构中的目标元素位置;
    在所述目标元素位置合法的情况下,将所述可编辑元素插入所述目标元素位置。
  8. 根据权利要求7所述的方法,其中,所述在所述目标元素位置合法的情况下,将所述可编辑元素 插入所述目标元素位置,包括:
    确定所述目标元素位置对应子节点的子节点类型;
    在所述可编辑元素对应的节点类型与所述子节点类型匹配的情况下,确定所述目标元素位置合法,并将所述可编辑元素插入所述目标元素位置。
  9. 根据权利要求7所述的方法,其中,所述基于所述可编辑元素的目标编辑位置,确定所述可编辑元素在所述业务逻辑结构中的目标元素位置之后,所述方法还包括:
    在所述目标元素位置不合法的情况下,显示无效提示,所述无效提示用于指示对所述可编辑元素的编辑操作无效。
  10. 根据权利要求1至6任一所述的方法,其中,所述微应用编辑界面中包括触发器区域,所述触发器区域用于显示创建的至少一个所述触发器;
    所述接收对所述微应用编辑界面中可编辑元素的拖动操作之前,所述方法还包括:
    响应于所述触发器区域内的触发器创建操作,显示触发器设置界面,所述触发器设置界面用于设置所述触发器的触发事件;
    通过所述触发器设置界面获取设置的所述触发事件,并设置所述触发器。
  11. 根据权利要求10所述的方法,其中,所述方法还包括:
    响应于所述触发器区域内的触发器切换操作,切换所述微应用编辑界面中显示的所述业务逻辑结构。
  12. 根据权利要求1至6任一所述的方法,其中,所述基于至少一个所述触发器对应的所述业务逻辑结构生成微应用,包括:
    遍历所述微应用中的各个所述触发器;
    对于所述微应用中的各个所述触发器,遍历所述触发器对应的所述业务逻辑结构中的各个节点;
    基于节点与代码之间的映射关系,得到各个所述节点对应的节点代码;
    基于各个所述节点对应的所述节点代码生成所述触发器对应的触发器代码;
    对各个所述触发器对应的所述触发器代码进行合并,得到所述微应用的微应用脚本。
  13. 根据权利要求1至6任一所述的方法,其中,所述微应用编辑界面中包括预览区域以及预览控件;
    所述方法还包括:
    接收对所述业务逻辑结构中目标元素的选择操作;
    响应于对所述预览控件的触发操作,生成所述目标元素对应的预览代码;
    通过执行所述预览代码在所述预览区域展示所述目标元素的执行效果。
  14. 根据权利要求1至6任一所述的方法,其中,所述基于至少一个所述触发器对应的所述业务逻辑结构生成微应用之后,所述方法还包括:
    响应于对所述微应用编辑界面中提交控件的触发操作,显示提交设置界面;
    响应于所述提交设置界面内的交互方式选择操作,确定所述微应用的目标交互信息;
    将所述微应用以及所述目标交互信息打包上传至服务器。
  15. 一种微应用的开发装置,所述装置包括:
    界面显示模块,用于显示微应用编辑界面;
    接收模块,用于接收对所述微应用编辑界面中可编辑元素的编辑操作,所述可编辑元素包括逻辑元素和服务元素,所述逻辑元素用于实现逻辑控制,所述服务元素用于实现服务调用,所述编辑操作指对所述可编辑元素进行组合的操作;
    结构显示模块,用于在所述微应用编辑界面中显示触发器对应的业务逻辑结构,所述业务逻辑结构由所述可编辑元素组合得到,所述触发器用于基于触发事件执行所述业务逻辑结构表征的业务逻辑;
    生成模块,用于基于至少一个所述触发器对应的所述业务逻辑结构生成微应用。
  16. 根据权利要求15所述的装置,其中,所述微应用编辑界面中包括逻辑选择区域、服务选择区域以及编辑区域;
    所述接收模块,包括:
    第一接收单元,用于接收对所述逻辑选择区域中所述逻辑元素的第一拖动操作,所述第一拖动操作指 将所述逻辑元素由所述逻辑选择区域拖动至所述编辑区域的操作;
    第二接收单元,用于接收对所述服务选择区域中所述服务元素的第二拖动操作,所述第二拖动操作指将所述服务元素由所述服务选择区域拖动至所述编辑区域的操作;
    所述结构显示模块,用于:
    在所述编辑区域显示所述触发器对应的所述业务逻辑结构。
  17. 根据权利要求16所述的装置,其中,所述逻辑选择区域中包含至少一个类型选择控件,不同的类型选择控件对应不同类型的控制逻辑;
    所述第一接收单元,用于:
    响应于对目标类型选择控件的触发操作,在所述逻辑选择区域显示属于目标类型的至少一个候选逻辑元素,所述目标类型为所述目标类型选择控件对应控制逻辑的类型;
    接收对所述候选逻辑元素中目标逻辑元素的第一拖动操作。
  18. 根据权利要求17所述的装置,其中,所述接收对所述候选逻辑元素中目标逻辑元素的第一拖动操作之后,所述装置还包括:
    逻辑参数设置模块,用于显示所述目标逻辑元素对应的逻辑设置界面,所述逻辑设置界面用于设置所述目标逻辑元素的逻辑参数;通过所述逻辑设置界面获取设置的所述逻辑参数。
  19. 根据权利要求16所述的装置,其中,所述服务选择区域中包含服务搜索控件;
    所述第二接收单元,用于:
    响应于对所述服务搜索控件的触发操作,在所述服务选择区域显示至少一个候选服务元素,所述候选服务元素基于服务搜索词从服务器处查询得到;
    接收对所述候选服务元素中目标服务元素的第二拖动操作。
  20. 根据权利要求19所述的装置,其中,所述接收对所述候选服务元素中目标服务元素的第二拖动操作之后,所述装置还包括:
    服务参数设置模块,用于显示所述目标服务元素对应的服务设置界面,所述服务设置界面用于设置所述目标服务元素的服务参数;
    通过所述服务设置界面获取设置的所述服务参数。
  21. 根据权利要求15至20任一所述的装置,其中,所述接收对所述微应用编辑界面中可编辑元素的编辑操作之后,所述装置还包括:
    位置确定模块,用于基于所述可编辑元素的目标编辑位置,确定所述可编辑元素在所述业务逻辑结构中的目标元素位置;
    插入模块,用于在所述目标元素位置合法的情况下,将所述可编辑元素插入所述目标元素位置。
  22. 根据权利要求21所述的装置,其中,所述插入模块,包括:
    节点类型确定单元,用于确定所述目标元素位置对应子节点的子节点类型;
    插入单元,用于在所述可编辑元素对应的节点类型与所述子节点类型匹配的情况下,确定所述目标元素位置合法,并将所述可编辑元素插入所述目标元素位置。
  23. 根据权利要求21所述的装置,其中,所述基于所述可编辑元素的目标编辑位置,确定所述可编辑元素在所述业务逻辑结构中的目标元素位置之后,所述装置还包括:
    提示模块,用于在所述目标元素位置不合法的情况下,显示无效提示,所述无效提示用于指示对所述可编辑元素的编辑操作无效。
  24. 根据权利要求15至20任一所述的装置,其中,所述微应用编辑界面中包括触发器区域,所述触发器区域用于显示创建的至少一个所述触发器;
    所述接收对所述微应用编辑界面中可编辑元素的拖动操作之前,所述装置还包括:
    触发器设置模块,用于响应于所述触发器区域内的触发器创建操作,显示触发器设置界面,所述触发器设置界面用于设置所述触发器的触发事件;通过所述触发器设置界面获取设置的所述触发事件,并设置所述触发器。
  25. 根据权利要求24所述的装置,其中,所述装置还包括:
    切换模块,用于响应于所述触发器区域内的触发器切换操作,切换所述微应用编辑界面中显示的所述业务逻辑结构。
  26. 根据权利要求15至20任一所述的装置,其中,所述生成模块,用于:
    遍历所述微应用中的各个所述触发器;
    对于所述微应用中的各个所述触发器,遍历所述触发器对应的所述业务逻辑结构中的各个节点;
    基于节点与代码之间的映射关系,得到各个所述节点对应的节点代码;
    基于各个所述节点对应的所述节点代码生成所述触发器对应的触发器代码;
    对各个所述触发器对应的所述触发器代码进行合并,得到所述微应用的微应用脚本。
  27. 根据权利要求15至20任一所述的装置,其中,所述微应用编辑界面中包括预览区域以及预览控件;
    所述装置还包括:
    预览模块,用于接收对所述业务逻辑结构中目标元素的选择操作;响应于对所述预览控件的触发操作,生成所述目标元素对应的预览代码;通过执行所述预览代码在所述预览区域展示所述目标元素的执行效果。
  28. 根据权利要求15至20任一所述的装置,其中,所述基于至少一个所述触发器对应的所述业务逻辑结构生成微应用之后,所述装置还包括:
    提交模块,用于响应于对所述微应用编辑界面中提交控件的触发操作,显示提交设置界面;响应于所述提交设置界面内的交互方式选择操作,确定所述微应用的目标交互信息;将所述微应用以及所述目标交互信息打包上传至服务器。
  29. 一种计算机设备,所述计算机设备包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如权利要求1至14任一所述的微应用的开发方法。
  30. 一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条程序代码,所述程序代码由处理器加载并执行以实现如权利要求1至14任一所述的微应用的开发方法。
  31. 一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中;计算机设备的处理器从所述计算机可读存储介质读取所述计算机指令,所述处理器执行所述计算机指令,使得所述计算机设备执行如权利要求1至14任一所述的微应用的开发方法。
PCT/CN2022/127027 2021-11-29 2022-10-24 微应用的开发方法、装置、设备、存储介质及程序产品 WO2023093414A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111432111.6A CN114064024A (zh) 2021-11-29 2021-11-29 微应用的开发方法、装置、设备、存储介质及程序产品
CN202111432111.6 2021-11-29

Publications (1)

Publication Number Publication Date
WO2023093414A1 true WO2023093414A1 (zh) 2023-06-01

Family

ID=80277601

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/127027 WO2023093414A1 (zh) 2021-11-29 2022-10-24 微应用的开发方法、装置、设备、存储介质及程序产品

Country Status (2)

Country Link
CN (1) CN114064024A (zh)
WO (1) WO2023093414A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116909582A (zh) * 2023-09-13 2023-10-20 云账户技术(天津)有限公司 一种可视化大屏业务部署方法、装置及电子设备
CN117234470A (zh) * 2023-10-08 2023-12-15 开物数智(安徽)智能科技有限公司 一种基于低代码平台的跨端表单开发系统及方法
CN117251143A (zh) * 2023-11-14 2023-12-19 武汉万云网络科技有限公司 一种应用系统、构建方法及其可视化开发工具的实现方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114064024A (zh) * 2021-11-29 2022-02-18 Oppo广东移动通信有限公司 微应用的开发方法、装置、设备、存储介质及程序产品
CN115543290B (zh) * 2022-10-12 2024-04-19 睿珀智能科技有限公司 可视化编程方法及系统
CN115906802B (zh) * 2023-02-09 2023-08-22 成都数联云算科技有限公司 一种条件逻辑数据的解析方法、装置、设备及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9652203B1 (en) * 2015-11-24 2017-05-16 Corpa Inc. Application development framework using configurable data types
CN108268260A (zh) * 2017-12-21 2018-07-10 博康智能信息技术有限公司 一种基于一体化支撑技术的快速微应用组装方法
CN108614689A (zh) * 2017-01-09 2018-10-02 阿里巴巴集团控股有限公司 场景服务的生成方法、装置和终端设备
CN109683905A (zh) * 2018-12-24 2019-04-26 国云科技股份有限公司 一种系统自动发布方法
CN110618882A (zh) * 2019-09-20 2019-12-27 国网浙江省电力有限公司 一种电力业务应用系统
CN114064024A (zh) * 2021-11-29 2022-02-18 Oppo广东移动通信有限公司 微应用的开发方法、装置、设备、存储介质及程序产品

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8397223B2 (en) * 2000-03-17 2013-03-12 Gutenberg Printing Llc Web application generator
US9495134B2 (en) * 2011-09-16 2016-11-15 Adobe Systems Incorporated Methods and apparatus for code segment handling
KR101408280B1 (ko) * 2012-03-08 2014-06-17 주식회사 청호컴넷 개발도구의 로직생성장치 및 방법과, 그 방법을 실행하기 위한 프로그램이 기록된 저장매체
CN106155673B (zh) * 2015-04-23 2020-03-13 阿里巴巴集团控股有限公司 实现页面内容编辑器的方法、装置、服务器及用户设备
CN106155686B (zh) * 2016-06-30 2020-11-17 华为技术有限公司 界面生成方法、装置和系统
CN107132975A (zh) * 2017-05-26 2017-09-05 努比亚技术有限公司 一种控件编辑处理方法、移动终端以及计算机可读存储介质
CN107526597A (zh) * 2017-08-30 2017-12-29 广东欧珀移动通信有限公司 用户界面编辑方法、装置、终端及计算机可读存储介质
CN108345456A (zh) * 2018-03-07 2018-07-31 平安普惠企业管理有限公司 页面代码生成方法、装置、计算机设备和存储介质
CN112230914B (zh) * 2019-07-15 2023-09-15 腾讯科技(深圳)有限公司 小程序的制作方法、装置、终端及存储介质
CN112988138A (zh) * 2019-12-16 2021-06-18 杭州中天微系统有限公司 应用于集成开发环境中的系统和方法
CN111506244A (zh) * 2020-04-24 2020-08-07 东莞市精驰软件有限公司 控件拖拽显示方法、系统、智能终端及存储介质
CN111930370A (zh) * 2020-06-17 2020-11-13 石化盈科信息技术有限责任公司 可视化页面处理方法、装置、计算机设备和存储介质
CN112015410A (zh) * 2020-07-16 2020-12-01 深圳市大富网络技术有限公司 网页编辑方法、装置、系统以及计算机存储介质
CN112068820B (zh) * 2020-07-27 2023-08-08 北京旷视科技有限公司 微服务的配置处理方法、装置、计算机设备和存储介质
CN112346618A (zh) * 2020-11-11 2021-02-09 广州小鹏汽车科技有限公司 一种车辆服务处理方法和装置
CN113504908A (zh) * 2021-07-19 2021-10-15 中国建设银行股份有限公司 业务代码生成方法、装置、电子设备及计算机可读介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9652203B1 (en) * 2015-11-24 2017-05-16 Corpa Inc. Application development framework using configurable data types
CN108614689A (zh) * 2017-01-09 2018-10-02 阿里巴巴集团控股有限公司 场景服务的生成方法、装置和终端设备
CN108268260A (zh) * 2017-12-21 2018-07-10 博康智能信息技术有限公司 一种基于一体化支撑技术的快速微应用组装方法
CN109683905A (zh) * 2018-12-24 2019-04-26 国云科技股份有限公司 一种系统自动发布方法
CN110618882A (zh) * 2019-09-20 2019-12-27 国网浙江省电力有限公司 一种电力业务应用系统
CN114064024A (zh) * 2021-11-29 2022-02-18 Oppo广东移动通信有限公司 微应用的开发方法、装置、设备、存储介质及程序产品

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116909582A (zh) * 2023-09-13 2023-10-20 云账户技术(天津)有限公司 一种可视化大屏业务部署方法、装置及电子设备
CN116909582B (zh) * 2023-09-13 2024-01-30 云账户技术(天津)有限公司 一种可视化大屏业务部署方法、装置及电子设备
CN117234470A (zh) * 2023-10-08 2023-12-15 开物数智(安徽)智能科技有限公司 一种基于低代码平台的跨端表单开发系统及方法
CN117234470B (zh) * 2023-10-08 2024-02-23 开物数智(安徽)智能科技有限公司 一种基于低代码平台的跨端表单开发系统及方法
CN117251143A (zh) * 2023-11-14 2023-12-19 武汉万云网络科技有限公司 一种应用系统、构建方法及其可视化开发工具的实现方法
CN117251143B (zh) * 2023-11-14 2024-02-06 武汉万云网络科技有限公司 一种应用系统、构建方法及其可视化开发工具的实现方法

Also Published As

Publication number Publication date
CN114064024A (zh) 2022-02-18

Similar Documents

Publication Publication Date Title
WO2023093414A1 (zh) 微应用的开发方法、装置、设备、存储介质及程序产品
US10705942B1 (en) Simulated testing of API
US10091628B2 (en) Message based application state and card sharing methods for user devices
US9063755B2 (en) Systems and methods for presenting information on mobile devices
US11797273B2 (en) System and method for enhancing component based development models with auto-wiring
CN110708202B (zh) 插件节点的配置方法、装置、设备及存储介质
US10135940B2 (en) Subscribing to event notifications using object instances
TW201814545A (zh) 多服務集成方法、裝置、智慧型終端、伺服器和操作系統
WO2023093429A1 (zh) 微应用的运行方法、装置、设备、存储介质及程序产品
US20230229406A1 (en) Page rendering method, apparatus, electronic device, computer-readable storage medium, and computer program product
US11321422B1 (en) User-configurable aggregate web components
CN111026490A (zh) 页面渲染方法、装置、电子设备及存储介质
US10268456B2 (en) Standardized approach to contextual code identification in editors and IDEs
KR20170016362A (ko) 컴파일 동안 표시 메타데이터를 브라우저 렌더링 가능 포맷으로 변환하는 기법
CN110971974B (zh) 配置参数创建方法、装置、终端及存储介质
CN116360735A (zh) 一种表单生成方法、装置、设备和介质
WO2023124657A1 (zh) 微应用的运行方法、装置、设备、存储介质及程序产品
CN112860247A (zh) 一种模型组件的自定义生成方法、装置、设备及介质
CN116301785A (zh) 自定义文本编辑器组件的实现方法及装置
CN117251231B (zh) 一种动画资源处理方法、装置、系统及电子设备
CN113806596B (zh) 运营数据管理方法及相关装置
US20240070146A1 (en) Database systems and methods of batching data requests for application extensions
US20240070139A1 (en) Database systems and methods for client-side initiation of server-side actions
US20240069933A1 (en) Database systems and client-side field retrieval methods
US20240070149A1 (en) Database systems and client-side data synchronization methods

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22897497

Country of ref document: EP

Kind code of ref document: A1