Method and apparatus for processing interaction event
Abstract
This application provides a method and apparatus for processing an interaction event. The method may be performed by a unified interaction framework. Behavior identification of the interaction event is performed by the unified interaction framework, and a widget may directly execute the interaction behavior identified by the unified interaction framework. The widget does not need to adapt to an interactive device. When a software system needs to adapt to a newly added interactive device, a developer can perform adaptation development on the unified interaction framework once to adapt the newly added interactive device for a plurality of widgets.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 13 · Forward citations: 0.
Claims (20 — 3 Independent, 17 Dependent)
- Claim 1Independent Claim
A method comprising: obtaining, by a unified interaction framework in an electronic device, at least one interaction event triggered by operation(s) of a user on the electronic device, wherein the unified interaction framework is comprised in a user interface (UI) framework layer and interacts between a widget and an operation system (OS) layer; determining, by the unified interaction framework in the electronic device, an interaction behavior corresponding to the at least one interaction event, wherein the unified interaction framework comprises a correspondence between interaction behaviors and interaction operations of different interaction devices, wherein different interaction operations of the different interaction devices correspond to a same interaction behavior in the correspondence, and wherein the interaction behavior corresponding to the at least one interaction event indicates a task executable by the electronic device; receiving, by the unified interaction framework in the electronic device, registration information from the widget, wherein the registration information indicates a correspondence between the interaction behavior corresponding to the at least one interaction event and the widget; and invoking, by the unified interaction framework in the electronic device, and based on the determined interaction behavior matching the interaction behavior from the registration information of the widget, the widget to execute the interaction behavior.
- Claim 2Depends on #1
The method according to claim 1, wherein invoking, by the unified interaction framework in the electronic device, and based on the determined interaction behavior matching the interaction behavior from the registration information of the widget, the widget to execute the interaction behavior, comprises: invoking, by the unified interaction framework in the electronic device through a behavior enable application programming interface (API) registered by the widget, and based on the determined interaction behavior matching the interaction behavior from the registration information of the widget, the widget to execute the interaction behavior.
- Claim 3Depends on #1
The method according to claim 1, wherein the method further comprises: configuring, by the unified interaction framework in the electronic device, an enable application programming interface (API) or a registration API using a domain specific language (DSL) profile, wherein the widget is invokable by an application (APP) through the enable API, and the widget is configured to invoke the APP through the registration API.
- Claim 4Depends on #1
The method according to claim 1, wherein the method further comprises: generating, by the unified interaction framework in the electronic device, a behavior parameter based on an event value of the at least one interaction event; and sending, by the unified interaction framework in the electronic device, the behavior parameter to the widget.
- Claim 5Depends on #4
The method according to claim 4, wherein the behavior parameter comprises a behavior amplitude value, the behavior amplitude value is positively correlated to the event value of the at least one interaction event, the behavior amplitude value is positively correlated to a transform coefficient, and there is a correspondence between the transform coefficient and a type of an interactive device corresponding to the at least one interaction event, the interactive device being configured to receive a user operation.
- Claim 6Depends on #5
The method according to claim 5, wherein the transform coefficient is positively correlated to a user interface (UI) size of the interactive device.
- Claim 7Depends on #1
The method according to claim 1, wherein the at least one interaction event comprises a plurality of interaction events, and the interaction behavior comprises a combined interaction behavior of the plurality of interaction events.
- Claim 8Depends on #1
The method according to claim 1, wherein the at least one interaction event comprises a start scroll event, an intermediate scroll event and an end scroll event triggered by a scroll operation of the user on the electronic device, wherein the start scroll event is a scroll event detected for the first time after a scroll listener is started at the electronic device, or a scroll event generated for the first time after the end scroll event is generated at the electronic device; the intermediate scroll event is a scroll event generated within a preset time period after the start scroll event is generated; the end scroll event is a scroll event fitted when no scroll event is generated within the preset time period after the start scroll event or the intermediate scroll event is generated; and the interaction behavior comprises one of following: pre-scrolling processing corresponding to the start scroll event; scrolling processing corresponding to the intermediate scroll event; or post-scrolling processing corresponding to the end scroll event.
- Claim 9Independent Claim
A device comprising: a non-transitory memory configured to store a program instruction; and a processor configured to execute the program instruction to cause a unified interaction framework that is comprised in a user interface (UI) framework layer and that interacts between a widget and an operation system (OS) layer in the device to perform: obtaining at least one interaction event triggered by operation(s) of a user on the device; determining an interaction behavior corresponding to the at least one interaction event, wherein the unified interaction framework comprises a correspondence between interaction behaviors and interaction operations of different interaction devices, wherein different interaction operations of the different interaction devices correspond to a same interaction behavior in the correspondence, and wherein the interaction behavior corresponding to the at least one interaction event indicates a task executable by the device; receiving registration information from the widget, wherein the registration information indicates a correspondence between the interaction behavior corresponding to the at least one interaction event and the widget; and invoking, based on the determined interaction behavior matching the interaction behavior from the registration information of the widget, the widget to execute the interaction behavior.
- Claim 10Depends on #9
The device according to claim 9, wherein the unified interaction framework in the device is further caused to perform: invoking, through a behavior enable application programming interface (API) registered by the widget, and based on the determined interaction behavior matching the interaction behavior from the registration information of the widget, the widget to execute the interaction behavior.
- Claim 11Depends on #9
The device according to claim 9, wherein the unified interaction framework in the device is further caused to perform: configuring an enable application programming interface (API) or a registration API using a domain specific language DSL profile, wherein the widget is invokable by an application (APP) through the enable API, and the widget is configured to invoke the APP through the registration API.
- Claim 12Depends on #9
The device according to claim 9, wherein the unified interaction framework in the device is further caused to perform: generating a behavior parameter based on an event value of the at least one interaction event; and sending the behavior parameter to the widget.
- Claim 13Depends on #12
The device according to claim 12, wherein the behavior parameter comprises a behavior amplitude value, the behavior amplitude value is positively correlated to the event value of the at least one interaction event, the behavior amplitude value is positively correlated to a transform coefficient, and there is a correspondence between the transform coefficient and a type of an interactive device corresponding to the at least one interaction event, the interactive device being configured to receive a user operation.
- Claim 14Depends on #13
The device according to claim 13, wherein the transform coefficient is positively correlated to a user interface (UI) size of the interactive device.
- Claim 15Depends on #9
The device according to claim 9, wherein the at least one interaction event comprises a plurality of interaction events, and the interaction behavior comprises a combined interaction behavior of the plurality of interaction events.
- Claim 16Depends on #9
The device according to claim 9, wherein the at least one interaction event comprises a start scroll event, an intermediate scroll event and an end scroll event triggered by a scroll operation of the user on the device, wherein the start scroll event is a scroll event detected for the first time after a scroll listener is started at the device, or a scroll event generated for the first time after the end scroll event is generated at the device; the intermediate scroll event is a scroll event generated within a preset time period after the start scroll event is generated; the end scroll event is a scroll event fitted when no scroll event is generated within the preset time period after the start scroll event or the intermediate scroll event is generated; and the interaction behavior comprises one of following: pre-scrolling processing corresponding to the start scroll event; scrolling processing corresponding to the intermediate scroll event; or post-scrolling processing corresponding to the end scroll event.
- Claim 17Independent Claim
A non-transitory computer readable medium comprising program instructions, when executed by a processor of an electronic device, cause a unified interaction framework that is comprised in a user interface (UI) framework layer and that interacts between a widget and an operation system (OS) layer in the electronic device to: obtain at least one interaction event triggered by operation(s) of a user on the electronic device; determine an interaction behavior corresponding to the at least one interaction event, wherein the unified interaction framework comprises a correspondence between interaction behaviors and interaction operations of different interaction devices, wherein different interaction operations of the different interaction devices correspond to a same interaction behavior in the correspondence, and wherein the interaction behavior corresponding to the at least one interaction event indicates a task executable by the electronic device; receive registration information from the widget, wherein the registration information indicates a correspondence between the interaction behavior corresponding to the at least one interaction event and the widget; and invoke, based on the determined interaction behavior matching the interaction behavior from the registration information of the widget, the widget to execute the interaction behavior.
- Claim 18Depends on #17
The non-transitory computer readable medium according to claim 17, wherein the program instructions, when executed by the processor of the electronic device, cause the unified interaction framework in the electronic device further to: invoke, through a behavior enable application programming interface (API) registered by the widget, and based on the determined interaction behavior matching the interaction behavior from the registration information of the widget, the widget to execute the interaction behavior.
- Claim 19Depends on #17
The non-transitory computer readable medium according to claim 17, wherein the program instructions, when executed by the processor of the electronic device, cause the unified interaction framework in the electronic device further to: configure an enable API or a registration API using a domain specific language DSL profile, wherein the widget is invokable by an application (APP) through the enable API, and the widget is configured to invoke the APP through the registration API.
- Claim 20Depends on #17
The non-transitory computer readable medium according to claim 17, wherein when executed by the processor of the electronic device, cause the unified interaction framework in the electronic device further to: generate a behavior parameter based on an event value of the at least one interaction event; and send the behavior parameter to the widget.
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation of International Application No. PCT/CN2021/111733, filed on Aug. 10, 2021, which claims priority to Chinese Patent Application No. 202010945205.2, filed on Sep. 9, 2020. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD This application relates to the field of electronic technologies, and specifically, to a method and apparatus for processing an interaction event. BACKGROUND When a user performs an operation on a user interface (UI), an application (APP) needs to respond to the operation of the user, to complete interaction with the user. An Android (Android ® ) system performs user interaction by using an event-driven method. For example, a tap operation performed by the user on a touchpad triggers the Android system to generate an ACTION_DOWN event and an ACTION_UP event. The Android system senses and processes the two events by using an Android application framework, and then sends the two events to a corresponding widget. The widget identifies the two events, determines that a corresponding behavior is object selection, and may control an APP to select an object through an application programming interface (API). In the foregoing example, the widget needs to perform mapping from an event to a behavior. Therefore, when the Android system needs to adapt to a newly added interactive device, a developer needs to develop, for each widget, an adaptation capability for the newly added interactive device. Consequently, development workload is heavy. SUMMARY This application provides a method for processing an interaction event, to reduce workload of adapting to an interactive device and improve interaction experience consistency. According to a first aspect, a method for processing an interaction event is provided. The method includes: obtaining at least one interaction event; determining an interaction behavior correspon
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (13)
Non-Patent Literature (5)
- Ntanos et al.,
- “
- A Context Awareness Framework for Cross-Platform Distributed Applications
- ”
- , publisher: Elsevier, published: 2013, pp. 1-9. (Year: 2013).