WO2021244452A1 - Multi-device interaction method and system - Google Patents

Multi-device interaction method and system Download PDF

Info

Publication number
WO2021244452A1
WO2021244452A1 PCT/CN2021/097004 CN2021097004W WO2021244452A1 WO 2021244452 A1 WO2021244452 A1 WO 2021244452A1 CN 2021097004 W CN2021097004 W CN 2021097004W WO 2021244452 A1 WO2021244452 A1 WO 2021244452A1
Authority
WO
WIPO (PCT)
Prior art keywords
component
user interface
description information
application
attribute
Prior art date
Application number
PCT/CN2021/097004
Other languages
French (fr)
Chinese (zh)
Inventor
代海涛
Original Assignee
荣耀终端有限公司
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 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2021244452A1 publication Critical patent/WO2021244452A1/en

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/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications

Definitions

  • This application relates to the field of terminal technology, and in particular to a method and system for multi-device interaction.
  • multiple devices can display a user interface corresponding to the same service.
  • these multiple devices can perform related processing according to the user operation.
  • multiple different devices can notify each other, exchange information, and control each other, so as to jointly complete an application scenario.
  • the mobile phone pushes incoming call notifications or instant messages to the screen of the smart watch and assists with vibration reminders, and the smart watch controls the music played on the mobile phone.
  • This application provides a method and system for multi-device interaction.
  • the first application is installed in the first device.
  • the second device can display the user interface of the first application program by receiving the user interface UI description information of the first application program in the first device and act on the user operation on the user interface accordingly. In this way, the second device can provide the user with the service of the first application without installing the first application, thereby reducing the development cost of the developer developing the first application on the second device.
  • an embodiment of the present application provides a multi-device interaction method.
  • the method includes: a second device receives first UI description information from a first device; the first UI description information is used to describe the information of the first application.
  • the first UI component the first UI component is determined according to the first user interface of the first application; the first UI component is displayed on the first user interface with the first component attribute; the first application is The application installed on the first device; the second device can instantiate the first UI component according to the second component attribute and the executable underlying code of the first UI component; the second component attribute is according to the first UI component Determined by the UI description information, the executable underlying code of the first UI component is determined from the component library according to the component type of the first UI component, and the component library contains executables for drawing different types of components Low-level code; the second device can display a second user interface, and the second user interface can include the first UI component.
  • the first UI component can be displayed in the second user interface with the
  • both the first device and the second device may be devices such as mobile phones, computers, smart watches, smart TVs, and smart cars.
  • the first device and the second device may be different.
  • the first device may be a smart car
  • the second device may be a smart watch.
  • a fatigue driving detection system can be installed in a smart car.
  • the smart car can send UI description information containing warning information to the smart watch.
  • the smart watch can display warning messages on the screen and assist with vibration reminders.
  • the first device may be a mobile phone
  • the second device may be a smart watch.
  • the mobile phone receives an incoming call notification or instant message
  • the mobile phone can send to the smart watch the UI description information corresponding to the user interface such as the incoming call notification interface or instant message.
  • Smart watches can display incoming call notifications or instant messages on the screen.
  • the first device establishes a communication connection with the second device.
  • the connection mode may include: classic Bluetooth, low energy Bluetooth, and near field communication.
  • the second device includes a component library.
  • the second device can obtain the component library through one or more of the following methods: the second device obtains the component library from the first device, the second device obtains the component library from the cloud (such as a content server), and the second device obtains the component library from the cloud (such as a content server).
  • a component library is stored in the way.
  • the component library included in the second device includes executable low-level codes for drawing some or all types of components.
  • the UI description information is a description of each component in the user interface.
  • the amount of data is relatively small.
  • the first device may not require high bandwidth to transmit the UI description information to the second device, thereby reducing the requirement for data transmission bandwidth.
  • the UI description information is not a program directly executable by the processor, which can reduce uncontrollable security risks caused by the direct download of the executable program by the second device.
  • the above-mentioned first user interface may be displayed on the first device.
  • the first device is a mobile phone
  • the second device is a smart watch.
  • the incoming call notification interface can be displayed on the mobile phone.
  • the smart watch can receive the UI description information of the incoming call notification interface from the mobile phone.
  • the smart watch may display the components in the incoming call notification interface on the user interface according to the UI description information. For example, answer the component, hang up the component. And these components can respond to user operations. In this way, both the mobile phone and the watch can display an incoming call notification interface to remind the user to answer the call.
  • the second device when a first user operation acting on the first UI component is detected in the second user interface, the second device can change the component size and/or component appearance of the first UI component in the second user interface.
  • the appearance of the aforementioned components may include one or more of the following: color, foreground, and background.
  • the above-mentioned first UI component may be associated with a listener.
  • the listener can be used to monitor user operations that act on the first UI component, such as click, long press, and drag.
  • the second device can change the component size and/or component appearance of the first UI component. That is, the display state of the first UI component itself changes.
  • the display state of the first UI component in this application may undergo one or more of the following changes: the size of the first UI component changes, the foreground icon of the first UI component changes, the first UI component and the first UI component change The size of the sub-components changes.
  • the smart watch may display the application icon on the main interface of the first device according to the UI description information.
  • the application icon For example, dial icon, WeChat icon, Google Maps icon and settings icon, etc.
  • the Google Maps icon can become larger. That is, the Google Maps icon can be enlarged to indicate that the Google Maps icon is in a selected state.
  • the first UI component of the aforementioned second user interface can respond to user operations, which is different from a static picture.
  • the second device may send the first event to the first device.
  • the first event can be used to indicate the occurrence of the first user operation.
  • the second device receives the second UI description information from the first device; the second UI description information is used to describe the second UI component of the first application, and the second UI component is based on the first application.
  • the third user interface is determined; the second UI component is displayed on the third user interface with the third component attribute; the second device can instantiate the second UI component according to the fourth component attribute and the executable underlying code of the second UI component The second UI component.
  • the fourth component attribute is determined according to the second UI description information, and the executable underlying code of the second UI component is determined from the component library according to the component type of the second UI component.
  • the second device may display a fourth user interface, and the fourth user interface may include the second UI component.
  • the second UI component may be displayed on the fourth user interface with the above-mentioned fourth component attribute.
  • the second device in response to a user operation on the first UI component detected in the second user interface, can jump to the next user interface or refresh the second user interface, and display the fourth user interface .
  • the smart watch may display the components in the incoming call notification interface according to the UI description information. For example, answering components and hanging up components.
  • the smart watch can send an event indicating that the hang-up component has a user operation to the mobile phone.
  • the smart watch can receive the UI description information from the phone hang-up interface of the mobile phone.
  • the smart watch can display the components of the phone hang up interface according to the UI description information of the phone hang up interface. Among them, the hang-up interface may be displayed or not displayed on the mobile phone.
  • the second device can find the executable low-level code of the first UI component from the component library according to the component type of the first UI component; the second device can use the executable low-level code of the first UI component
  • the underlying code obtains the component object of the component type of the first UI component; the second device can use the second component attribute to set one or more of the following one or more of the component object of the component type of the first UI component in the second user interface Parameters: component size, component position, component appearance, get the first UI component instantiated.
  • the first UI component includes at least one sub-component
  • the second device can find the executable underlying code of the first UI component from the component library according to the component type of the first UI component, and according to The component type of the subcomponent finds the executable underlying code of the subcomponent from the component library; the second device can use the executable underlying code of the first UI component to obtain the component object of the component type of the first UI component , And use the executable underlying code of the subcomponent to obtain the component object of the component type of the subcomponent; the second device can use the second component property to set the component object of the component type of the first UI component in the second user interface One or more of the following parameters in: component size, component position, component appearance, the first UI component to be instantiated, and the component object that uses the component property of the sub-component to set the component type of the sub-component in the second user One or more of the following parameters in the interface: component size, component position, component appearance, get instantiated
  • the first UI description information may include the above-mentioned first component attribute
  • the second device may determine the second component according to the first component attribute and the screen information of the second device Properties
  • the screen information includes one or more of the following: screen size, screen shape, and screen resolution.
  • the first UI description information may include the foregoing second component attribute.
  • the second component attribute may be determined by the first device according to the foregoing first component attribute and screen information of the second device.
  • the second device may send the screen information of the second device to the first device.
  • the second component attribute of the first UI component can be determined by using the screen information of the second device.
  • the first device or the second device may determine the component size and component position of the first UI component displayed on the second device according to the screen information of the second device. In this way, not only the problem of screen mismatch is reduced, but a set of UI description information can be applied to multiple devices.
  • the first UI component may be determined according to some or all of the components in the first user interface.
  • the incoming call notification interface may include an avatar component, a contact component, a hang-up component, and an answer component.
  • the avatar component can indicate the avatar of the contact.
  • the contact component can indicate the name of the contact.
  • the hang-up component can be used to hang up the phone, and the answering component can be used to answer the phone.
  • the smart watch can display the components in the incoming call notification interface.
  • the components in the incoming call notification interface may have a priority order. That is, the smart watch can display these components in descending order of their priority. When the screen size of the smart watch is not large enough to display all the components in the incoming call notification interface, components with low priority may not be displayed in the smart watch.
  • the priority order of the hanging up component and the answering component may be the first priority.
  • the priority order that the contact component may be may be the second priority.
  • the priority order that the avatar component can be may be the third priority.
  • the smart watch can first display the hang-up component and the answer component, then display the contact component, and finally display the avatar component.
  • the method further includes: the second device may be in a screen off state;
  • the second device may display a third user interface, the third user interface is a user interface of a second application, and the second application is an application installed on the second device.
  • the first application program may include a system application program, a home screen application program, and a third-party application program.
  • the third-party application is an application downloaded and installed from a third-party application market.
  • the system application programs are, for example, a dialing application, a short message application, and a contact application.
  • the third-party applications are, for example, WeChat applications, sports health applications, and Google Maps applications.
  • the second device may receive UI description information from the user interface of the system application in the first device, UI description information of the main screen application user interface, and UI description information of the third-party application user interface.
  • UI description information from the user interface of the system application in the first device
  • UI description information of the main screen application user interface UI description information of the third-party application user interface.
  • the user interface of the home screen application and the user interface of a third-party application, so that the user interface can be provided to the user by communicating with the first device without installing these applications.
  • the services of these applications In this way, developers do not need to develop application programs on the second device side, thereby effectively reducing development costs.
  • the first UI component of the first application can be displayed on the first user interface of the first device with the first component attribute, and can also be displayed on the second user of the second device with the second component attribute.
  • the first component attribute may be the same as the second component attribute.
  • the first device and the second device are two devices with the same screen information, and the first UI component may be displayed on the user interfaces of the two devices with the same component size, component position, and component appearance.
  • the vertical orientation of the first component may be different from that of the second component.
  • the first device and the second device are a mobile phone and a smart watch, respectively, and the screen information of the two devices is different.
  • the component size, component position, and component appearance of the first UI component displayed on the mobile phone and the smart watch may be different.
  • the embodiments of the present application also provide a method for multi-device interaction.
  • the method includes: a first device detects a first event and can send a first user interface UI description information to a second device; the first UI description The information can be used to describe the first UI component of the first application, the first UI component is determined according to the first user interface of the first application; the first UI component can be displayed on the first user interface as the first UI component A component attribute display; the first application is an application installed on the first device; the second device can instantiate the first UI component according to the second component attribute and the executable underlying code of the first UI component .
  • the second component attribute may be determined according to the first UI description information, the executable underlying code of the first UI component may be determined from the component library according to the component type of the first UI component, the component library Contains executable low-level code for drawing different types of components.
  • the second device may display a second user interface; the second user interface includes the first UI component.
  • the first UI component can be displayed in the second user interface with the second component attribute.
  • the first component attribute and the second component attribute both include the component type and one or more of the following parameters: component size, component location, and component appearance.
  • the first device may determine the second device from multiple devices according to a first preset rule. These multiple devices have established a communication connection with the first device.
  • the first device may determine the second device to interact with it according to the distance between the first device and the first device or the priority order between the multiple devices.
  • the first device can select the closest device from a plurality of devices with which it has established a communication connection as the second device, and then send the user interface information in the first application to the selected second device.
  • UI description information Or, there is a priority order among multiple devices that have established a communication connection with the first device.
  • the first device may select the device with the highest priority as the second device, and then send the UI description information of the user interface in the first application to the selected second device.
  • the first device may be a mobile phone.
  • both the smart car and the smart watch worn by the user have established a communication connection with the mobile phone, and in this application scenario, the priority of the smart car is higher than the priority of the smart watch.
  • the mobile phone can send the UI description information such as the incoming call notification interface to the smart car with higher priority.
  • the smart car can display the components in the incoming call notification interface on the display screen according to the UI description information.
  • the on-board computer can answer calls in response to user operations (such as touch operations, voice control operations).
  • the first device can detect the operation of the first user.
  • the first user operation can be used to select the second device.
  • the first device may determine that the device selected by the first user's operation is the second device.
  • the first device may be a mobile phone, and a communication connection is established between the mobile phone and the user's tablet and smart watch.
  • the first device can display a music playing interface.
  • the mobile phone may send the UI description information to the smart watch.
  • the smart watch can display the music playing interface.
  • the mobile phone can also send the audio data of the played music to the smart watch. In this way, the smart watch can play music and respond to user operations on the music playing interface.
  • an embodiment of the present application provides a device including a display screen, a communication device, a memory, and a processor.
  • the display screen is used to display a user interface
  • the memory is used to store one or more programs
  • the processor is used to execute the one or more programs, so that the device implements any of the A possible implementation, or any possible implementation as in the second aspect.
  • an embodiment of the present application provides a chip that is applied to a device.
  • the chip includes one or more processors for invoking computer instructions to make the device perform any possible Implementation, or any possible implementation as in the second aspect.
  • an embodiment of the present application provides a computer program product containing instructions, characterized in that, when the computer program product is run on a device, the device is caused to execute any possible implementation manner in the first aspect, or Such as any possible implementation in the second aspect.
  • an embodiment of the present application provides a computer-readable storage medium, including instructions, characterized in that, when the foregoing instructions are executed on a device, the foregoing device executes any possible implementation manner as in the first aspect, or Such as any possible implementation in the second aspect.
  • the device provided in the third aspect, the chip provided in the fourth aspect, the computer program product provided in the fifth aspect, and the computer-readable storage medium provided in the sixth aspect are all used to execute the methods provided in the embodiments of the present application. . Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
  • FIG. 1A is a schematic diagram of the component composition of a user interface provided by an embodiment of the present application.
  • FIG. 1B and FIG. 1C are schematic structural diagrams of the logical relationship between components of a user interface provided by an embodiment of the present application;
  • 2A to 2E, 3A to 3D, 4A, and 4B are schematic diagrams of a series of user interfaces for multi-device interaction provided by an embodiment of the application;
  • FIG. 5 is a flowchart of a method for multi-device interaction provided by an embodiment of the present application.
  • FIGS. 6A to 6E are schematic diagrams of some multi-device interaction user interfaces provided by embodiments of the present application.
  • FIG. 7 is a flowchart of a method for instantiating a component of a device according to an embodiment of the present application.
  • FIG. 8 is a flowchart of a method for determining whether a device is adapted to a screen according to an embodiment of the present application
  • FIG. 9A, FIG. 9B, FIG. 10A, and FIG. 10B are schematic diagrams of application scenarios for adapting components provided by an embodiment of the application to the screen of a device;
  • FIGS. 11A to 11C are schematic diagrams of other multi-device interaction user interfaces provided by embodiments of the present application.
  • FIG. 12 is a schematic diagram of a structure for developing a multi-device interaction system provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of another development multi-device interaction system provided by an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • FIG. 15 is a schematic structural diagram of another device provided by an embodiment of the present application.
  • the first method is to install applications that can implement the same service on multiple devices to achieve multi-device interaction. For example, in an application scenario where a user uses WeChat to communicate with others on mobile phones and smart watches, the WeChat application needs to be installed on both mobile phones and smart watches. In this way, for the same application, developers need to develop applications that can be applied to different devices, and the development cost is relatively high.
  • the second method is to install an application on a device or deploy an application on the cloud (such as a server), and other devices can interact with the above one device by dynamically downloading an executable program (such as a hot patch).
  • an application is installed on a device, and multiple functions of the application are respectively contained in multiple program packages.
  • the other device can run the program package corresponding to this function downloaded from the above-mentioned one device.
  • the third method is to install an application on a device.
  • This device can run all applications and services and send the results of the operation (such as pixel information or drawing commands) to other devices. Other devices can display based on these running results to realize multi-device interaction.
  • the operation result of the above one device does not take into account information such as the screen size of other devices, and the problem of screen mismatch may occur.
  • the embodiment of the present application provides a method for multi-device interaction.
  • a first application such as a dial-up application
  • the first application may not be installed in the second device.
  • the first device may send user interface (UI) description information of the user interface of the first application to the second device.
  • UI user interface
  • the second device can run a service program to parse the UI description information, and use the component library to instantiate each component in the UI description information.
  • the second device can display these components on the user interface according to the logical relationship between these components.
  • the aforementioned component library contains executable low-level codes that can be used to draw various components. Further, when a user operation acting on the second device is detected, for example, a user's touch operation, text input operation, etc., the second device may feed back the user operation to the first device. The first device can process the user operation.
  • the first device may be a smart car, and the second device may be a smart watch.
  • a fatigue driving detection system can be installed in a smart car.
  • the smart car can send UI description information containing warning information to the smart watch.
  • the smart watch can display warning messages on the screen and assist with vibration reminders.
  • the first device may be a mobile phone, and the second device may be a smart watch.
  • the mobile phone receives an incoming call notification or instant message
  • the mobile phone can send to the smart watch the UI description information corresponding to the user interface such as the incoming call notification interface or instant message.
  • Smart watches can display incoming call notifications or instant messages on the screen.
  • the process of multi-device interaction can use the above-mentioned multi-device interaction method provided in the embodiment of the present application.
  • the first device may first determine the second device that needs to interact from multiple devices, and then send the UI description information of the first application to the second device .
  • the first application program may not need to be installed in the second device.
  • the second device can provide the user with the service in the first application.
  • the user interface of the first application in the first device may be displayed on the second device.
  • the second device can detect the user operation, and feed back the user operation to the first device. Then, the first device can process the task indicated by the user operation. In this way, the first device and the second device can notify each other, exchange information, and control each other.
  • the second device does not need to install the first application program, and the developer does not need to develop the application program on the second device side, thereby effectively reducing development costs.
  • the second device may be a lightweight device with weaker computing capability, storage capability, or human-computer interaction capability, such as a smart watch.
  • the lightweight device when the lightweight device does not install the first application, the lightweight device can also provide users with the services and applications of the first application.
  • the aforementioned multi-device interaction method not only reduces development costs, but also reduces the requirements for various capabilities of the second device, such as computing capabilities, storage capabilities, or human-computer interaction capabilities.
  • first device and second device may both be devices such as mobile phones, computers, smart watches, smart TVs, and smart cars.
  • both the first device and the second device may be multiple devices, which are not limited in the embodiment of the present application.
  • UI description information text conforming to the UI description format, used to describe the attributes of each component in the user interface, and can also be used to describe the processing of input events or bound data by each component.
  • Script or bytecode can be inserted in the UI description information.
  • the aforementioned UI description format is a text format, for example, an XML format or a JSON format.
  • the UI description format defines the syntax that needs to be followed to describe each component of the user interface.
  • the UI description information can be transmitted between the second device and the first device or the cloud (such as the application market).
  • the UI description information is loaded and analyzed by the second device, and the component library is used to implement the display of each component in the user interface.
  • Service program A resident program or module preset on the device.
  • the service program can be used to load and parse the UI description information, so as to display the components in the UI description information on the user interface of the device.
  • the service program can also be used to call a virtual machine or a script engine to execute the bytecode or script accessed in the UI description information.
  • Component refers to the basic UI elements that have independent appearance, can respond to input events, and can bind data. For example, buttons, sliders, check boxes, text boxes, icons, etc.
  • the aforementioned input event may be a user operation on the component detected by the device, such as a touch operation, a text input operation, and so on.
  • the above-mentioned binding data may indicate that there is a corresponding relationship between the component and the data.
  • the device can update the component. For example, for a component used to display the current time on the device, when the current time changes (for example, from 10:00 to 10:01), the device can update the time on the component. Alternatively, the device can also update the data when a change in the component is detected.
  • the second device is associated with a listener on the component displayed on the user interface according to the UI description information.
  • the listener can be used to monitor user operations that act on the component, such as click, long press, and drag.
  • the component can respond to the user operation.
  • the specific response manner may include: the display state of the component itself changes, for example, the appearance of the component changes, and the second device can jump to the next user interface or refresh the current user interface according to the user operation.
  • the size of the component may change.
  • the UI description information contains a description of the application icon on the main interface of the first device (ie mobile phone)
  • the second device ie smart watch
  • the UI description information contains a description of the application icon on the main interface of the first device (ie mobile phone)
  • the second device ie smart watch
  • the UI description information contains a description of the application icon on the main interface of the first device (ie mobile phone)
  • the second device ie smart watch
  • the Google Maps icon 723, the setting icon 724, and so on When a click operation acting on the Google Maps icon 723 is detected, the Google Maps icon 723 can become larger. In other words, the Google Maps icon 723 can be enlarged to indicate that the Google Maps icon 723 is in a selected state.
  • the foreground icon of the component in response to a user operation on a component displayed by the second device according to the UI description information, the foreground icon of the component may change.
  • the UI description information includes a description of each component in the music playing interface of the first device
  • the second device may display each component on the music playing interface according to the UI description information.
  • playback control keys If the initial foreground icon of the playback control key is an icon indicating that music is playing, in response to a user operation of the playback control key acting on the foreground icon as an icon indicating that the music is playing, the playback control key can transform the foreground icon to indicate that the music is playing. The icon of the paused playback state. In other words, the playback control key can indicate that the music is in a playing or paused state by changing the foreground icon.
  • the size of the component and the size of the subcomponents contained in the component may both change.
  • the UI description information includes a description of the application icon on the desktop of the first device
  • the second device may display the application icon on the desktop of the first device according to the UI description information.
  • these application icons may be subcomponents of page components in the desktop.
  • the page component and its subcomponents can all become smaller.
  • the page component and its subcomponents can exchange positions displayed on the second device with other page components and its subcomponents.
  • the embodiment of the present application does not limit the manner in which the display state of the component itself changes in response to the user operation described above, and the display state of the component may undergo other transformations.
  • the components displayed by the second device according to the UI description information are associated with listeners. These components can respond based on user operations monitored by the listener, which is different from the static pictures displayed by the second device according to the drawing commands from the first device. .
  • the component may include a first component and a second component.
  • the first component may be a component that contains other components inside.
  • the relationship between the first component and these other components is the relationship between the parent component and the child component.
  • the first component can manage the arrangement of its internal sub-components.
  • the second component may be a component that does not contain other components inside.
  • the UI description information may include a description of the attribute of the first component.
  • the attribute of the first component may include the type of the first component, and the type of the first component may include linear layout or relative layout.
  • a linear layout may specify that the alignment of its internal sub-components is left-aligned and the arrangement is top-to-bottom, and the sub-components in the linear layout are arranged one by one in a left-aligned and top-to-bottom manner.
  • the attributes of the first component may also include the desired size, desired position, and appearance (such as background, foreground, border line) of the first component.
  • the attributes of the first component may also include size and position information of the sub-components contained in the first component. For example, the width and height of the child component should match the width and height of the parent component as much as possible, and the width and height of the child component should match the width and height of the content in the child component as much as possible.
  • the UI description information may include a description of the attribute of the second component.
  • the attributes of the second component may include the type of the second component, and the type of the second component may include a button, a slider, a check box, a text box, and an icon.
  • the attributes of the second component may also include the desired size, desired position, and appearance (such as background, foreground, border line) of the second component, and so on.
  • Fig. 1A exemplarily shows the component composition of a user interface.
  • the user interface includes a component 101, a component 102, a time component 103, a heart rate component 104, a weather component 105, and a temperature component 106.
  • the component 101 includes a component 102, a time component 103, and a heart rate component 104, and the component 101 is the first component.
  • the component 102 includes a weather component 105 and a temperature component 106, and the component 102 is the first component. Since the time component 103, the heart rate component 104, the weather component 105 and the temperature component 106 do not contain sub-components, the time component 103, the heart rate component 104, the weather component 105 and the temperature component 106 are the second components.
  • Both the component 101 and the component 102 can have a linear layout, and the sub-components contained in the component 101 and the component 102 can be arranged in a manner of left-aligned, left-to-right, and automatic line wrapping.
  • Both the time component 103 and the heart rate component can be text boxes, which are used to display the current time and heart rate data, respectively.
  • the weather component 105 may be an icon for indicating current weather conditions (such as sunny, cloudy, heavy rain, etc.).
  • the temperature component 106 can be a text box for displaying the current ambient temperature.
  • FIG. 1B shows the logical relationship of the components in the UI description information of the user interface shown in FIG. 1A.
  • the first component 101 includes sub-components 102-104.
  • the sub-component 102 of the first component 101 is also the first component.
  • the first component 102 includes a sub-component 105 and a sub-component 106.
  • the second device can run a service program to parse the UI description information, so as to determine the attributes of the components 101-106.
  • the second device can determine the size and position of the first component in combination with the screen information of the smart watch (such as shape, size, resolution, etc.), and display it on the smart watch screen as shown in the figure The first assembly 101 shown in 1A.
  • the smart watch can also determine the arrangement of the sub-components 102 to 104 in the first component 101, and the size and position of these sub-components in the smart watch.
  • the smart watch determines the size and position of the component 102 when instantiating the first component 101, the smart watch can determine the background color, border line and other attributes of the first component 102, and the first component 102 in the size and position of the sub-assembly 105 and the sub-assembly 106.
  • the smart watch can display the time component 103, the heart rate component 104, the weather component 105 and the temperature component 106 as shown in FIG. 1A on the screen of the smart watch according to the attributes of these second components.
  • the logical relationship between the components in the UI description information can be described through the UI view tree.
  • Figure 1C shows a UI view tree.
  • the UI view tree may indicate the logical relationship of the components in the UI description information as shown in FIG. 1A and FIG. 1B.
  • node 101 and node 102 may represent component 101 and component 102, respectively
  • node 103, node 104, node 105, and node 106 may represent time component 103, heart rate component 104, weather component 105, and temperature component 106, respectively.
  • the relationship between node 101 and node 102, node 103, and node 104 is a parent node and a child node.
  • the relationship between the node 102 and the node 105 and the node 106 is a parent node and a child node.
  • the second device can display each component on the user interface according to the aforementioned UI view tree.
  • the embodiment of the present application does not limit the manner in which the user describes the logical relationship between the components in the UI description information.
  • Component library a module that contains executable low-level code (such as machine code, bytecode, etc.) corresponding to each component.
  • executable low-level code such as machine code, bytecode, etc.
  • the above executable low-level code can be used to draw various components on the user interface.
  • the above-mentioned machine code can be directly run on the central processing unit (CPU) of the device.
  • the above bytecode can be run in the virtual machine of the device.
  • the executable low-level code in the component library can include an instruction part and a data part. When running the service program to parse the UI description information, the device can determine the attributes of the component.
  • the device can obtain the executable low-level code corresponding to the component from the component library according to the type of the component in the above attribute, and initialize the data part of the executable low-level code according to other attributes of the component.
  • the device can instantiate the component, that is, draw the component on the user interface.
  • the component has attributes that describe the component in the UI description information. For example, a button with a background color of gray, a black border line, and a thickness of 2px.
  • the component library can be stored in the first device or the second device in a preset manner.
  • the component library may also be downloaded to the first device when the first device downloads the application program, or sent to the second device when the first device sends UI description information to the second device.
  • the embodiment of the application does not limit this.
  • the aforementioned component library stored in the first device and the second device in a preset manner or in a download manner may include executable low-level codes corresponding to a part of the components. This part of the components provides services for the first device and the second device for users, and displays the components required by the corresponding user interface.
  • the component libraries stored in the first device and the second device may not necessarily contain executable low-level codes corresponding to all components.
  • the first device can install the first application, and the second device There is no need to install the first application. This can effectively reduce development costs.
  • the first device may send the UI description information of the user interface in the first application to the second device.
  • the second device may parse the UI description information to display the user interface of the first application, and feedback the user operation detected on the user interface to the first device.
  • the first device can process the task indicated by the user operation. In this way, the user can indirectly control the first device through the second device.
  • the UI description information transferred between the first device and the second device is not an executable program, thereby reducing uncontrollable security risks.
  • the second device When the second device is running the service program to parse the UI description information, it can obtain the second device’s own screen information (such as shape, size, resolution), and then determine the size and position of each component in the UI description information on the second device . In this way, determining the size and position of each component according to the shape and size of the screen of the device can not only reduce the problem of screen mismatch, but also this set of UI description information can be applied to a variety of devices.
  • own screen information such as shape, size, resolution
  • the second device can parse the UI description information, high-overhead steps such as drawing various components of the user interface mainly rely on the component library, that is, the second device can directly run the executable low-level code in the component library to draw each component. This reduces the requirement on the processing capacity of the second device.
  • the transmission of UI description information occupies less bandwidth.
  • the first device When the first device interacts with the second device, the first device may send UI description information to the second device, and the UI description information may describe the attributes of the user interface components in the first application.
  • the above-mentioned first application program may be a system application or a third-party application.
  • the system application may be an application program preset in the device when the first device or the second device leaves the factory.
  • main interface application dialing application
  • messaging application contact application
  • camera settings, etc.
  • the third-party application can be an application that the first device or the second device downloads and installs from the cloud (such as an application market) or other places. For example, sports health, WeChat, Google Maps, etc.
  • the second device displays the user interface of the first application in the first device.
  • 2A to 2E show that when the first application is a main interface application in the system application, the second device displays some user interfaces of the main interface of the first device.
  • the first device Before the first device interacts with the second device, the first device can select the second device to interact with, and the first application.
  • the first device is a mobile phone and the second device is a smart watch. Both the first device and the second device may be other devices, which are not limited in the embodiment of the present application.
  • the mobile phone may display a main interface 710.
  • the main interface 710 may include a status bar 711, a component 715 with a list of commonly used applications, a calendar component 712, a weather component 713, a navigation bar 716, and other application icons 714. in:
  • the status bar 711 may include one or more signal strength components of a mobile communication signal, one or more signal strength components of a wireless fidelity (wireless fidelity, WiFi) signal, a Bluetooth component, a battery status component, and a time component.
  • a wireless fidelity wireless fidelity, WiFi
  • Bluetooth component a Bluetooth component
  • battery status component a time component.
  • the calendar component 712 can be used to indicate the current time, such as date, day of the week, hour and minute information, and so on.
  • the weather component 713 can be used to indicate the type of weather, such as cloudy to clear, and can also be used to indicate information such as temperature.
  • the component 715 with commonly used application icons may include: a dial icon 715A, an information icon 715B, a contact icon 715C, and a camera icon 715D.
  • the component 715 with commonly used application program icons may include more or fewer application program icons.
  • Other application icons 614 may include: sports health icon 714A, Google Maps icon 714B, WeChat icon 713C, and settings icon 714D.
  • the other application icons 714 may include more or fewer application icons.
  • the navigation bar 716 may include components used for system navigation, such as a return component, a main interface component, and a call-out task history component.
  • the mobile phone can display a drop-down notification bar component 717 as shown in FIG. 2B on the main interface 710.
  • the drop-down notification bar component 717 may include a linkage control icon 717A.
  • the linkage control icon 717A can be used to select the second device that interacts with the first device.
  • the drop-down notification bar component 717 may also include more content, such as a WiFi signal icon, a Bluetooth icon, a flashlight icon, and so on. The embodiment of the present application does not limit the content in the drop-down notification bar component 717.
  • the mobile phone can automatically search for a second device that can interact with the mobile phone, and display the linkage device option component 718 as shown in FIG. 2C on the main interface 710.
  • the linked device option component 718 may include an icon indicating the second device searched by the mobile phone, for example, a smart watch icon 718A, a tablet icon 718B, and a car computer icon 718C.
  • each second device indicated by the icon in the linked device option component 718 may be a device that has established a communication connection (such as a Bluetooth connection) with a mobile phone.
  • the mobile phone may send the UI description information of the user interface in the first application to the one or more second devices.
  • the embodiment of the present application does not limit the user operation for calling the drop-down notification bar component 717.
  • the mobile phone can determine that the second device is a smart watch, and can display a linked application option component 719 as shown in FIG. 2D in the main interface 710.
  • the linkage application option component 719 may include a system application 719A and a third-party application 719B.
  • the system application 719A may include a main interface icon, a dial icon, an information icon, and a contact icon.
  • the third-party application 719B can include WeChat icons, sports health icons, and Google Maps icons.
  • the mobile phone can send the UI description information of the user interface in the one or more applications to the second selected in FIG. 2C. equipment.
  • the mobile phone may send the UI description information of the main interface 710 to the main interface 710 when displaying the main interface 710 as shown in FIG. 2A smart watch.
  • the smart watch may display the user interface 720 as shown in FIG. 2E.
  • the user interface 720 may include icons of application programs displayed on the main interface 710, such as a dial icon 721, a WeChat icon 722, a Google Maps icon 723, and a setting icon 724.
  • the smart watch may respond to a user operation of an icon of any application program in the user interface 720, and feedback the user operation to the mobile phone.
  • the mobile phone can process the task indicated by the user's operation, and send the updated UI description information of the user interface to the smart watch. For example, in response to a user operation acting on the dial icon 721, the smart watch may feed back to the mobile phone that a user operation acts on the dial icon 721.
  • the mobile phone can send the UI description information of the user interface 730 for dialing as shown in FIG. 3A to the smart watch.
  • the smart watch can parse the UI description information of the user interface 730 and update the user interface 720 to display the user interface 740 as shown in FIG. 3B.
  • the user interface 720 may also include more icons of other applications installed on the mobile phone.
  • the mobile phone can reselect or cancel the second device and the first application that interact with the mobile phone multiple times.
  • the mobile phone when a touch operation on the linkage control component 717A is detected, the mobile phone can display the linkage device option component 718 as shown in FIG. 2C, and further display the linkage application option component 719 as shown in FIG. 2D . This allows the user to re-select the second device and the first application.
  • the mobile phone can cancel all interactions with the second device.
  • the embodiment of the present application may also reselect or cancel the second device and the first application program that interact with the mobile phone in other manners.
  • 3A to 3D show schematic diagrams of the smart watch displaying the user interface of the dialing application.
  • the mobile phone may send UI description information of the user interface 730 to the smart watch when the user interface 730 shown in FIG. 3A is displayed .
  • the smart watch may display a user interface 740 as shown in FIG. 3B.
  • the user interface 730 may include a historical call record component 731, a dialing component 732, a telephone component 733, a contact component 734, and a favorite component 735.
  • the historical call record component 731 may include call records before the current moment, such as the call record with Jane at 9:00.
  • the mobile phone can dial a user corresponding to the call record.
  • the dialing component 732 can include a dialing keyboard, which can be used for the user to input a telephone number and make a call.
  • the phone component 733 can be used for a mobile phone to display a user interface 730 as shown in FIG. 3A.
  • the contact component 734 can be used to display the contact information (such as mobile phone number, email address, etc.) of the contact stored in the mobile phone.
  • the favorite component 735 can be used to display the contact information of the favorite contact.
  • the user interface 730 may include more or fewer components, which is not limited in the embodiment of the present application.
  • the mobile phone can send the UI description information of the user interface 730 to the smart watch.
  • the smart watch can parse the aforementioned UI description information, and use the component library to instantiate each component in the aforementioned UI description information, so that the size and position of each component are adapted to the screen of the smart watch.
  • the smart watch may display a user interface 740 as shown in FIG. 3B.
  • the user interface 740 may include a number component 741, a dial component 743, and a mobile phone main interface component 742. in:
  • the number component 741 can be used to display the phone number entered by the user, such as "131********".
  • the dialing component 743 may include a dialing keyboard, which can be used for the user to input a telephone number and make a call. Specifically, in response to a user operation acting on the dial keypad "1,2,3,4,5,6,7,8,9,*,0,#", the smart watch can display the corresponding symbol on the number component 741 . When a user operation acting on the component for making a call is detected, the smart watch can feed back the user operation to the mobile phone, and send the phone number in the number component 741 to the mobile phone.
  • the mobile communication module in the mobile phone can send instructions to the base station to make a call. It is not limited to the above manner, and the smart watch in the embodiment of the present application may also make a call in other manners.
  • the mobile phone main interface component 742 can be used to display the main interface of the mobile phone on the smart watch.
  • the smart watch may display a user interface 720 as shown in FIG. 2E.
  • the components in the user interface 720 can be obtained by analyzing the UI description information of the main interface 710 by the smart watch. In this way, when the user interface 720 is displayed, the smart watch can open any application included in the main interface 710 of the mobile phone according to the detected user operation, so as to provide the user with a corresponding service.
  • the smart watch may include physical buttons.
  • the smart watch can display the main interface of the smart watch as shown in FIG. 6B.
  • the embodiment of the present application does not limit the content included in the main interface of the smart watch, and does not limit the manner in which the smart watch displays the main interface of the smart watch.
  • the mobile phone when the mobile phone uses the module for mobile communication to send an instruction to the base station to make a call, the mobile phone can display a user interface 750.
  • the user interface 750 may include components indicating the name of the call contact, a recording component, a video call component, a hang-up component, a speaker component, and other components.
  • the recording component can be used to record calls.
  • the video call component can be used to convert the current voice call into a video call.
  • the hang-up component can be used to hang up the phone.
  • the speaker assembly can be used to switch the module for playing sound from the earpiece to the speaker.
  • the embodiment of the present application does not limit the components included in the user interface 750.
  • the mobile phone may send the UI description information of the user interface 750 to the smart watch.
  • the smart watch can parse the UI description information of the user interface 750, and use the component library to instantiate each component in the UI description information, so that the size and position of each component are adapted to the screen of the smart watch.
  • the smart watch may display a user interface 760 as shown in FIG. 3D.
  • the user interface 760 may include a component indicating the name of the call contact, a hang-up component, a speaker component, and the like. Among them, the hang-up component can be used to hang up the phone.
  • the speaker assembly can be used to switch the module for playing sound from the earpiece to the speaker.
  • the smart watch may feed back the user operation to the mobile phone. Then the mobile phone can use the module for mobile communication to send instructions to the base station to hang up the phone. In this way, the user can control the mobile phone to hang up the call through the hang-up component on the smart watch.
  • the user interface 760 may also include a mobile phone main interface component 742.
  • the smart watch in response to a user operation acting on the main interface component 742 of the mobile phone, the smart watch can update the user interface 760 to the user interface 720 as shown in FIG. 2E. That is, the user can use the mobile phone main interface component 742 to jump directly from the user interface 760 to the user interface 720.
  • the mobile phone in response to a user operation acting on the Google Maps icon 714B in the main interface 710, the mobile phone can display the user interface 770.
  • the user interface 770 may include a search box component 771, a positioning component 772, a clearing component 773, a start navigation component 774, and a map component 775.
  • the search box component 771 can be used to input the address information that needs to be queried by text or voice.
  • the positioning component 772 can be used to locate the current position of the user and display it in the map component 775.
  • the clearing component 773 can be used to cancel the navigation path currently displayed in the map component 775.
  • the start navigation component 774 can be used to start navigating the user according to the navigation path currently displayed in the map component 775.
  • the map component 775 can be used to display information such as map information, the user's current location information, and navigation paths.
  • the embodiment of the present application does not limit the components included in the user interface 770.
  • the mobile phone can send the UI description information of the user interface 770 to the smart watch.
  • the smart watch can parse the UI description information of the user interface 770, and use the component library to instantiate each component in the UI description information, so that the size and position of each component are adapted to the screen of the smart watch.
  • the smart watch may display a user interface 780 as shown in FIG. 4B.
  • the user interface 780 may include a map component 781 and a start navigation component 782. Among them, the map component 781 can be used to display information such as map information, the user's current location information, and navigation paths.
  • the start navigation component 782 can be used to start navigation for the user according to the navigation path currently displayed in the map component 781.
  • the smart watch may feed back the user operation to the mobile phone.
  • the mobile phone can send the updated UI description information of the user interface to the smart watch according to the user operation. In this way, the smart watch can realize the navigation function for the user in the process of interacting with the mobile phone.
  • the foregoing second device may also be a device such as a tablet or a vehicle-mounted computer, which is not limited in the embodiment of the present application.
  • the following specifically takes the application scenario of receiving incoming call notification as an example to introduce the method of multi-device interaction.
  • Figure 5 shows a flow chart of a method for multi-device interaction.
  • the method includes steps S101 to S114.
  • steps S105 to S107 are the specific process of the second device instantiating the component.
  • steps S109 to S114 are the interaction process between the first device and the second device after the second device detects the user operation.
  • the first device establishes a communication connection with the second device.
  • the first device may establish a communication connection and perform communication in a wired or wireless manner.
  • the first device and the second device may communicate through classic Bluetooth, Bluetooth low energy, or near field communication, which is not limited in the embodiment of the present application.
  • the first device displays a first user interface.
  • the first device In an application scenario where the first device interacts with the second device, for example, the first device receives an incoming call notification, short message, or WeChat message, etc., and the first device is installed with a first application (such as a dial-up application, WeChat, etc.).
  • the first device can run the first application to display the first user interface (such as an incoming call notification interface, a short message user interface, etc.).
  • the first user interface may be a user interface (incoming call notification interface) 21 as shown in FIG. 6A.
  • the user interface 21 may include a first component 210, an avatar component 211, a contact component 212, a hang-up component 213, and an answer component 214. in:
  • the first component 210 is the parent component of the avatar component 211, the contact component 212, the hang-up component 213, and the answer component 214.
  • the first device can use the module for mobile communication therein to send an instruction to the base station to hang up the phone.
  • the first device may use the module for mobile communication therein to send an instruction to the base station to connect to the phone.
  • the user interface 21 may also include more or fewer components, which is not limited in the embodiment of the present application.
  • the first device sends the first UI description information to the second device.
  • the first device contains first UI description information.
  • the first UI description information is used to describe the attributes of each component in the first user interface.
  • the first device may send the first UI description information to the second device.
  • the first UI description information may include the first component 210, the avatar component 211, the contact component 212, the hang-up component 213, and the answer Description of the attributes of the component 214.
  • the attribute of the first component 210 may include the type of the first component.
  • the type of the first component 210 may be a linear layout or a relative layout.
  • the attributes of the first component 210 may also include a desired size, a desired position, and appearance (such as background, foreground, border line), and the like.
  • the attributes of the avatar component 211, the contact component 212, the hang-up component 213, and the answer component 214 may include the types of these components.
  • the types of these components can be icons, text boxes, buttons, etc.
  • the attributes of the avatar component 211, the contact component 212, the hang-up component 213, and the answer component 214 may also include a desired size, a desired position, and appearance (such as background, foreground, border line), and the like.
  • the first device may first send an inquiry instruction to the second device.
  • the query instruction can be used to determine whether the second device can interact with the first device, that is, whether the second device can receive and parse the first UI description information.
  • the first device may send the first UI description information to the second device.
  • the mobile phone may send an inquiry instruction to the second device (smart watch). If the call notification function is enabled in the smart watch, the smart watch can send confirmation information to the mobile phone. The determination information may indicate that the smart watch agrees to interact with the mobile phone. Then the mobile phone can send the first UI description information to the smart watch.
  • the smart watch cannot receive and parse the first UI description information, for example, the call notification function in the smart watch is turned off, or the smart watch contains a priority ordering of the services that can be processed, and the smart watch is processing The priority of the service is higher than the priority of receiving and parsing the first UI description information, and the smart watch may not respond to the inquiry instruction from the mobile phone. Then, when the smart watch does not receive a response to the inquiry instruction of the mobile phone, the mobile phone may not send the first UI description information to the smart watch.
  • the first device Before the first device sends the UI description information to the second device, it may also determine that the first device and the second device can interact in other ways, which is not limited in the embodiment of the present application.
  • the second device obtains the component library.
  • the component library contains executable low-level codes (such as machine code, bytecode, etc.) corresponding to each component (such as text boxes, buttons, etc.).
  • the executable low-level code can include an instruction part and a data part.
  • the second device can obtain the executable low-level code corresponding to the component from the component library according to the type of the component, and initialize the data part of the executable low-level code according to the attribute of the component. When running the executable low-level code with the initialized data part, the second device can draw the component on the user interface.
  • the component library can be stored in the second device in a preset manner, and can also be sent to the second device along with the UI description information.
  • the second device may receive the UI description information sent from the first device, the cloud (such as a content server) and other devices.
  • the second device can obtain the component library from the first device, cloud and other devices.
  • the second device may also obtain the component library in other ways, which is not limited in the embodiment of the present application.
  • step S104 There is no sequence relationship between step S104 and other steps, and the embodiment of the present application does not limit the occurrence time of step S104.
  • the second device parses the first UI description information, and determines the attributes of each component in the first user interface.
  • the second device When receiving the first UI description information, the second device can run the service program.
  • the service program can be used to parse the first UI description information.
  • the second device can determine the attributes of the components in the first user interface. Exemplarily, if the first user interface is the user interface 21 as shown in FIG. 6A, the second device may determine that the component 210 is the first component, the type in the attribute is linear layout, and the background color in the attribute is white Wait. The second device may also determine that the component 213 is the second component, the type in its attribute is a button, and its attribute indicates that the button is associated with a picture or the like.
  • the second device obtains the executable low-level code of the first component from the component library according to the type of the first component in the first user interface, and uses the executable low-level code of the first component and the attributes of the first component. Instantiate the first component.
  • the component library contains executable low-level codes corresponding to multiple components.
  • the second device can obtain the executable low-level code corresponding to the first component from the component library according to the type of the first component.
  • the executable low-level code corresponding to the component in the component library includes an instruction part and a data part.
  • the attributes of the first component are determined (for example, the background color is white, the border line is 2px, etc.)
  • the second device can initialize the data part of the executable underlying code according to the attributes of the first component. In this way, the second device can complete the instantiation of the first component.
  • the instantiated first component has the attributes describing the first component in the first UI description information (for example, the background color is white, the border line is 2px, etc.).
  • the second device can determine the size and position of the topmost first component according to the screen information (such as shape, size, resolution, etc.) of the second device.
  • the above-mentioned top-most first component means that the first component is not a subcomponent of any other components, that is, the first component is not included in any other components.
  • the second device when instantiating the first component, can also match the parent component as much as possible according to the size and position of the first component and preset rules (such as the width and height of the child component)
  • the width and height of the sub-component and the width and height of the sub-component should match the width and height of the content in the sub-component as much as possible) to determine the size and position of each sub-component.
  • the second device can display the components on the first user interface in a suitable size on a suitable position on the screen of the second device.
  • the second device obtains the executable low-level code of the second component from the component library according to the type of the second component in the first user interface, and uses the executable low-level code of the second component and the attributes of the second component. Instantiate the second component.
  • the second device can obtain the executable low-level code corresponding to the second component from the component library according to the type of the second component.
  • the second device can initialize the data part of the executable underlying code according to the attributes of the second component. In this way, the second device can complete the instantiation of the second component. And the instantiated second component has the attributes describing the first component in the first UI description information (for example, the background color is white, the border line is 2px, etc.).
  • the second device displays the first component and the second component in the instantiated first UI description information.
  • the second device may instantiate the first component and the second component in the first UI description information according to the UI view tree display.
  • the UI view tree may indicate the logical relationship between the components in the first UI description information.
  • the UI view tree may be a child node of an existing UI view tree, that is, each component in the first UI description information may be displayed in a certain position of an existing user interface .
  • This existing user interface can be the user interface or desktop of any application.
  • This existing UI view tree can indicate the logical relationship between components on this existing user interface.
  • the second device can embed the UI view tree as a child node in an existing UI view tree, and display each of the first UI description information at the position of the child node on the existing user interface. Components.
  • a music playing interface is displayed on the second device.
  • the music playing interface contains a pause component.
  • the second device may send an instruction indicating that there is a user operation on the pause component to the first device, and receive UI description information from the first device.
  • the UI description information may include a playback component.
  • the first UI view tree may indicate the logical relationship between the components in the UI description information.
  • the second UI view tree may indicate the logical relationship between the components in the existing music playing interface. Then the above-mentioned first UI view tree may be embedded in the second UI view tree as a child node. In this way, the second device can display the playback component at the location of the pause component on the music playback interface, that is, replace the pause component with the playback component, and other components on the music playback interface are still displayed on the music playback interface.
  • the UI view tree may be a separate UI view tree, that is, each component in the first UI description information may be separately displayed on a new user interface.
  • the second device can create a new user interface separately, and display the components in the first UI description information on the new user interface.
  • a user interface 30 is displayed on the second device (smart watch).
  • the user interface 30 may include a first component 301, a weather component 301A, an exercise data component 301B, and a time component 301C.
  • the first component 301 is the parent component of the weather component 301A, the motion data component 301B, and the time component 301C.
  • the weather component 301A can indicate the current weather and the current temperature.
  • the exercise data component 301B can indicate the user's calories burned, number of steps, and heart rate information.
  • the time component 301C can indicate time information, calendar information, and the like.
  • the embodiment of the present application does not limit the components included in the user interface 30.
  • the mobile phone When the first device (mobile phone) receives the incoming call notification, the mobile phone can display the user interface 21 as shown in FIG. 6A, and send UI description information to the smart watch.
  • the smart watch can receive and parse the UI description information.
  • the smart watch can display each component on the user interface according to the UI view tree.
  • the UI view tree may indicate the logical relationship between the components in the UI description information. Since it can be determined that the UI view tree is a separate UI view tree, the smart watch can create a new user interface, such as the user interface 31 shown in FIG. 6C. In this way, the smart watch can display the components in this UI view tree on the user interface 31.
  • the second device detects a user operation acting on the component.
  • Each component in the first UI description information can respond to input events.
  • the aforementioned input event may be a user operation that acts on the component, etc.
  • the second device can detect user operations on the components, such as touch operations.
  • the second device may determine the component associated with the user operation. Specifically, the second device may first determine the screen coordinates of the touch operation acting on the screen, and convert the screen coordinates into component coordinates on the user interface, thereby determining the component acting on the touch operation, and associating the user operation with the component .
  • the embodiment of the present application does not specifically limit the manner of determining the component associated with the user operation.
  • the first UI description information may describe the attributes of each component in the user interface 21.
  • the second device can display the user interface 31 as shown in FIG. 6C.
  • the user interface 31 includes a first component 310, a contact component 311, a hang-up component 312, and an answer component 313.
  • the smart watch can obtain the screen coordinates of the user's operation on the screen.
  • Each component on the user interface 31 may have component coordinates on the user interface 31.
  • the smart watch can convert the screen coordinates of the user operation to the component coordinates on the user interface 31, so as to determine that the component associated with the user operation is the hang-up component 312.
  • the second device sends an instruction to the first device.
  • the second device may send an instruction to the first device.
  • the instruction may indicate the user operation detected by the second device.
  • the second device may send the detected screen coordinates of the user operation, the text or audio input by the user, and other content to the first device.
  • the second device smart watch
  • the smart watch can send the touch operation to the mobile phone and act on the smart watch screen. Screen coordinates.
  • the second device may send the information of the component associated with the detected user operation to the first device.
  • the smart watch when the second device (smart watch) detects a user operation that acts on the hang-up component 312 in the user interface 31, such as a touch operation, the smart watch can confirm the component associated with the user operation in step S109. , It is determined that there is a user operation in the hang-up component 312. Further, the smart watch may send an instruction to the mobile phone to indicate that the hang-up component 312 has a user operation. The instruction can instruct the mobile phone to hang up the phone in the mobile communication network.
  • the embodiments of the present application do not limit the instructions sent by the second device to the first device, except for the information used to indicate the components operated by the user, the screen coordinates of the user operation detected by the second device, the text input by the user, audio, etc.
  • the content can also be other.
  • the first device displays a second user interface.
  • the first device When receiving an instruction from the first device, the first device can respond to the instruction and display the second user interface.
  • the mobile phone when the first device (mobile phone) receives an incoming call notification and receives an instruction from the second device (smart watch) to hang up the phone, the mobile phone can display the user interface 22 .
  • the user interface 22 may include a first component 210, an avatar component 211, a contact component 212, and a call ending component 217.
  • the first component 210 is the parent component of the avatar component 211, the contact component 212, and the call end component 217.
  • the call end component 217 can indicate that the call has been hung up.
  • the mobile phone can also use the mobile communication module in the mobile phone to send an instruction to hang up the phone to the base station, so as to hang up the phone in the mobile communication network.
  • the mobile phone can first hang up the phone in the mobile communication network, and then display the user interface 22 as shown in FIG. 6D, or first display the user interface 22 as shown in FIG. 6D and then hang up the phone in the mobile communication network.
  • the user interface 22 as shown in FIG. 6D can be displayed while hanging up the phone in the mobile communication network.
  • the embodiment of the application does not limit this.
  • the first device sends the second UI description information to the second device.
  • the second UI description information can be used to describe the attributes of each component in the second user interface.
  • the smart watch when the second device (smart watch) detects a user operation acting on the hang-up component 312 as shown in FIG. 6C, in addition to sending a hang-up instruction to the first device (mobile phone), the smart watch can also display A user interface indicating that the phone has been hung up (the user interface 32 shown in FIG. 6E).
  • the dial application may not be installed in the smart watch, and the smart watch may not be able to update the user interface according to the detected user operation.
  • the smart watch can interact with mobile phones.
  • the mobile phone stores UI description information corresponding to each user interface, and the mobile phone can send the second UI description information to the smart watch.
  • the second UI description information may describe each component in the user interface where the phone has been hung up. In this way, the smart watch can update the user interface to display the user interface that the phone has been hung up.
  • step S111 there is no sequence between step S111 and step S112.
  • the second device parses the second UI description information, and uses the component library to instantiate the first component and the second component in the second UI description information.
  • the second device can run a service program to parse the second UI description information.
  • the components in the second UI description information may include a first component and a second component.
  • the second device may obtain the executable underlying code corresponding to the component from the component library to instantiate the first component and the second component in the second UI description information.
  • the second UI description information may include the first component 210, the avatar component 211, the contact component 212, and the call The description of the attributes of the component 217 ends.
  • the avatar component 211, the contact component 212, and the call ending component 217 are included in the first component 210 and are the second component.
  • the second device parses the second UI description information and instantiates the first component and the second component by using the component library. For the specific implementation process, please refer to steps S105 to S107, which will not be repeated here.
  • the second device displays the first component and the second component in the instantiated second UI description information.
  • the second device may display each component in the second UI description information according to the UI view tree.
  • the UI view tree may indicate the logical relationship between the components in the second UI description information.
  • the UI view tree can be embedded in an existing UI view tree as a child node, or can be used as a separate UI view tree.
  • the second device may display the components in the second UI description information after instantiating each component in the second UI description information.
  • the user interface 32 may include a first component 310, a contact component 311, and a call end component 314.
  • the first component 310 is the parent component of the contact component 311 and the call end component 314.
  • the call end component 314 can indicate that the call has been hung up.
  • step S108 For the specific display method, refer to step S108, which will not be repeated here.
  • the second device may not install the first application (such as a dial-up application, an application for playing music, etc.), but by receiving and parsing the user in the first application
  • the UI description information of the interface can provide users with the services in the first application. This can effectively reduce development costs.
  • the second device can run a preset service program to parse the UI description information.
  • the UI description information is a description of each component in the user interface, rather than an executable program. This not only reduces the bandwidth requirement for data transmission between the first device and the second device, but also reduces uncontrollable security risks caused by the second device directly downloading executable programs.
  • the second device when the second device parses the UI description information, it can determine the size and position of each component in the UI description information on the user interface of the second device according to the screen information of the second device itself. In this way, not only the problem of screen mismatch is reduced, but a set of UI description information can be applied to multiple devices. Since the second device can use the executable underlying code in the component library to draw each component, this reduces the requirement on the processing capability of the second device, and is suitable for application scenarios that include lightweight devices.
  • an application scenario of receiving notification of incoming calls is taken as an example to illustrate an implementation method of the instantiated component of the second device.
  • the first UI description information may describe various components in the user interface 21 as shown in FIG. 6A.
  • the first UI description information may specifically be:
  • Fig. 7 shows a flow chart of a method for instantiating a component of a second device. As shown in Figure 7, the method includes steps S201 to S207.
  • the second device identifies the first component in the UI description information.
  • the description will be made by taking the UI description information as the above-mentioned first UI description information.
  • the second device parses the first UI description information, and can first identify the first component (such as component 210) in the first UI description information.
  • the smart watch can execute step S202. Otherwise, the smart watch executes step S205.
  • the smart watch can recognize the first component 210 and execute step S202.
  • the second device uses the component library to instantiate the first component according to the parsed attribute of the first component.
  • the second device parses the first UI description information to obtain the attributes of the first component. From the description of the first component 210 described above by the first UI description information, it can be determined that the type in the attributes of the first component 210 is linear layout, and the expected size in the attributes of the first component 210 and the arrangement of the sub-components contained therein. Cloth way.
  • the second device may obtain the executable low-level code corresponding to the linear layout from the component library according to the type in the attribute of the first component 210, and initialize the data part of the executable low-level code by using the attribute of the first component. In this way, the second device can instantiate the first component 210 and determine the size and position of its internal sub-components on the user interface of the second device.
  • the second device can determine the size of the first component and the size and position of the sub-components of the first component on the user interface of the second device in combination with the size of the screen.
  • the second device can determine the size of the first component and the size of the sub-components of the first component according to the method flowchart shown in FIG. 8 And location.
  • the method includes steps S301 to S304.
  • S301 The second device sets the value of the initial margin of the subcomponent of the first component to 0.
  • the margin of the sub-component may represent the distance between each side of the sub-component and each side of the first component.
  • margin can include top margin, bottom margin, left margin and right margin.
  • the second device calculates the maximum possible width and maximum possible height of each subcomponent.
  • the second device may calculate the maximum possible width (maxWidth) and maximum possible height (maxHeight) of each subcomponent according to the width and height of the content contained in each subcomponent and the expected size of the subcomponent. In this way, the second device can ensure that a subcomponent with a width of maxWidth and a height of maxHeight can accommodate the content it contains.
  • the second device calculates the width and height of the first component.
  • the size of the first component should match the size of the screen as much as possible, and the size of the first component should match the size of the sub-component as much as possible.
  • the second device can calculate the first component.
  • the measuredWidth and measuredHeight are the final dimensions of the first component.
  • the top-most first component is the top-most first component in the UI description information.
  • the second device adjusts the value of the outer margin of each subcomponent according to the size of the screen and the size of the first component, and determines the size and position of each subcomponent.
  • the second device When the final size of the first component is determined, the second device needs to calculate the size and position of the sub-components of the first component. Specifically, the size and position of the sub-component can be determined by the margin value of the sub-component.
  • screenWidth and screenHieght represent the width and height of the screen, respectively.
  • the second device can determine the size and position of each subcomponent.
  • the first component 210 is not included in other components, and is the top-most first component.
  • the second device instantiates the first component 210, it can determine the size and position of the first component 210 and the subcomponents 211 to 214 of the first component 210 on the smart watch user interface according to the above steps S301 to S304. Size and location.
  • the smart watch can display the first component 310 and the subcomponents 311-313 of the first component as shown in FIG. 6C.
  • the first component 310 may be the first component 210 after instantiation.
  • the component 311 may be the contact component 212 after instantiation.
  • the component 312 may be the hang-up component 213 after instantiation.
  • the component 313 may be the answering component 214 after instantiation.
  • the sizes and positions of the components 310 to 313 are adapted to the screen of the smart watch.
  • determining the size and position of each component above means determining the size and position of each component on the user interface of the second device.
  • the second device when the second device instantiates the top-most first component in the UI description information, it can determine the size of the first component in conjunction with the size of the second device’s screen. And the size and position of the sub-components of the first component. In this way, the first component and its subcomponents can be adapted to the screen of the second device, and the same set of UI description information can be applied to multiple different devices.
  • the screen of the second device is circular, in addition to determining the size of the first component and the size and position of the sub-components of the first component according to the method flowchart shown in FIG.
  • the method of adapting the circular screen to determine the size and position of each component is not limited in the embodiment of the present application.
  • the second device can determine the size and position of each component according to the method of adapting each component to the screen of the other shape in the prior art. This embodiment of the present application I will not go into details about this.
  • the second device has already determined the size and position of the first component.
  • the second device can determine the size and position of the sub-components of the first component.
  • the second device can determine the size and position of the sub-component of the first component.
  • S203 The second device recognizes the second component in the UI description information.
  • the description will still be made by taking the UI description information as the above-mentioned first UI description information.
  • the second device can further identify the sub-components of the first component 210 in the first UI description information. If a component that has not been instantiated can be identified, the smart watch can execute step S204. When the smart watch fails to identify a component that has not been instantiated, that is, the sub-components of the first component 210 have been instantiated, the second device can return to step S201 to identify other first components in the first UI description information .
  • the second device uses the component library to instantiate the second component according to the parsed attribute of the second component.
  • the second device may instantiate these sub-components as sub-components of the second component. That is, the second device can instantiate sub-components that do not contain other components. For the sub-components of the first component, that is, the sub-components that contain other components, the second device can instantiate all the sub-components of the second component and then compare the sub-components of the first component according to step S201 and step S202. Perform instantiation, and further instantiate other components contained in the sub-components that are the first component according to step S203 and step S204.
  • the second device may determine the executable low-level code corresponding to the sub-component from the component library according to the type of the sub-component, and initialize the data part of the executable low-level code with data related to the attribute of the component.
  • the second device can instantiate the sub-component, and display the sub-component at the position of the sub-component determined in step S202.
  • the sub-component has attributes that describe the sub-component in the UI description information. For example, a button with a background color of gray, a black border line, and a thickness of 2px.
  • the second device may perform step S203 to identify other sub-components that are not instantiated in the first component including this sub-component.
  • the second device may perform step S203 and step S204 in a loop until all subcomponents of the second component in the first component are instantiated. Then the second device can perform step S201 to identify other first components in the UI description information. If the other first components are not recognized, it may indicate that the second device has instantiated all the recognized first components and second components. In this way, the second device can execute step S205.
  • the second device may first recognize the avatar component 211 and instantiate the avatar component 211.
  • the type of the avatar component 211 is an icon, and the attributes include a desired size and associated picture information.
  • the smart watch can obtain the executable low-level code corresponding to the icon from the component library according to the type of the icon, and use the attributes of the avatar component 211 to initialize the data part of the executable low-level code. In this way, the smart watch completes the instantiation of the avatar component 211.
  • the smart watch may return to step S203 to continue to identify the sub-components in the first component 210, such as the contact component 212, the hang-up component 213, and the answer component 214.
  • the smart watch can instantiate the contact component 212, the hanging up component 213, and the answering component 214 according to the method of instantiating the avatar component 211.
  • the smart watch may perform step S201, To identify whether there are other first components that have not been instantiated in the first UI description information.
  • the aforementioned first component that is not instantiated may include any sub-component of the first component that is the first component.
  • the smart watch may execute step S205.
  • S205 The second device judges whether the UI description information is parsed.
  • the second device When the second device instantiates each first component and each second component in the UI description information, that is, the second device does not recognize the components that have not been instantiated, the second device can determine whether the UI description information has been parsed .
  • the second device can determine the logical relationship between the components in the UI description information, and execute step S206.
  • the second device may perform step S207 to perform the resolution failure processing on the UI description information.
  • the UI description information contains unrecognizable items, such as undefined tags or UI description information that does not conform to the UI description format, the second device cannot complete the analysis of the UI description information.
  • the second device displays the instantiated first component and the second component.
  • step S108 For the method for the second device to display the instantiated first component and the second component, refer to step S108, which will not be repeated here.
  • the second device may change the UI description information according to a preset filtering rule. Part of the components in the filter are filtered out. The second device may display the components that are not filtered out in the UI description information on the user interface.
  • the above filtering rules can be used to filter components that are not important for various application scenarios. For example, components that cannot respond to input events or components that are not bound to data, etc.
  • the embodiments of the present application do not specifically limit the foregoing filtering rules.
  • the foregoing first UI description information includes a first component 210, an avatar component 211, a contact component 212, a hang-up component 213, and an answer component 214.
  • the smart watch can filter out the avatar component 211 according to the filter rule based on the size of its own screen. In this way, the smart watch can display the user interface 31 as shown in FIG. 6C.
  • the user interface 31 displays a first component 210, a contact component 212, a hang-up component 213, and an answer component 214.
  • the second device performs a parsing failure process on the UI description information.
  • the foregoing analysis failure processing may be that the second device displays information about the analysis failure on the user interface, etc.
  • the embodiment of the present application does not specifically limit the method for processing the analysis failure.
  • the order in which the second device instantiates the components in the UI description information may be the order in which these components are described in the UI description information. Take the UI description information of the user interface 21 shown in FIG. 6A as an example for description. The order of describing these components in the UI description information is: the first component 210, the avatar component 211, the contact component 212, the hanging up component 213, and the answering component 214, respectively. Then, the second device can instantiate these components in the above sequence and display them on the user interface.
  • the order in which the second device instantiates the components in the UI description information may be determined by the priority order of the components in the UI description information.
  • the priority order of the components in the UI description information can be preset. Still taking the UI description information of the user interface 21 shown in FIG. 6A as an example for description.
  • the priority order of the components in the UI description information can be: the first component 210 has the highest priority; the hang-up component 213 and the answer component 214 have the same priority and are lower than the priority of the first component 210; contact component The priority of 212 is lower than the priority of the hanging up component 213 and the answering component 214; the priority of the avatar component 211 is lower than the priority of the contact component 212.
  • the second device can first instantiate the first component 210, then instantiate the hang-up component 213 and the answer component 214, then instantiate the contact component 212, and finally instantiate the avatar component, and display it in the user interface in the order of the above instantiations.
  • These components are shown one by one.
  • the second device may display components with a higher priority order according to the size of its own screen. As shown in FIG. 6C, since the screen of the second device (smart watch) is small, the second device may not display the above-mentioned avatar component 211 with the lowest priority on the user interface.
  • the embodiment of the present application does not limit the priority order of the components in the UI description information.
  • the second device can determine whether the UI description information is parsed Complete, and then decide whether to perform the analysis failure processing or display the instantiated component on the user interface according to the result of the completion of the analysis.
  • the parsing failure processing, and displaying the instantiated components can refer to steps S205 to S207 in the method embodiment shown in FIG. 7, which will not be repeated here.
  • the first device may display the user interface 810 as shown in FIG. 9A.
  • the user interface 810 may include a contact list component 811 and an alphabetic index component 812.
  • the contact list component 811 may indicate the contact information (such as phone number, email) of each contact stored in the mobile phone.
  • the contact information of each contact can be arranged in alphabetical order according to the first letter of the contact's name.
  • the letter index component 812 can contain 26 letters of the alphabet, and can be used to find a contact whose name is the first letter based on one of the letters.
  • the letters in the letter index component 812 can be arranged vertically in the order of the alphabet.
  • the embodiment of the present application does not limit the components included in the user interface 810.
  • the mobile phone can send the UI description information of the user interface 810 to the second device (smart watch).
  • the screen of the smart watch is circular.
  • the smart watch can parse the UI description information according to the method flowcharts shown in FIGS. 7 and 8 and display the user interface 820 as shown in FIG. 9B.
  • the user interface 820 may include a letter index component 821 and a contact viewing component 822. Among them, the letter index component 821 can contain 26 letters of the alphabet, and can be used to find a contact whose name is the first letter based on one of the letters.
  • the smart watch may display the contact “Dad” in the contact viewing component 822. Further, when a user operation acting on "Dad” in the contact viewing component 822 is detected, the smart watch can display the contact information (such as phone number, email) of the contact "Dad” in the contact viewing component 822.
  • the contact information such as phone number, email
  • the smart watch can display the letters in the letter index component 821 on the user interface 820 in a circular arrangement. Not limited to the above-mentioned circular arrangement, the letters in the letter index component 821 may also be displayed on the user interface 820 according to other methods adapted to the smart watch screen.
  • the first device may display a user interface 830 as shown in FIG. 10A.
  • the user interface 830 may include an outdoor running component 831, a mountaineering component 832, a bicycle component 833, a swimming component 834, and a walking component 835.
  • the outdoor running component 831, mountaineering component 832, bicycle component 833, swimming component 834, and walking component 835 can be used to view the user's outdoor running, climbing, cycling, swimming, and walking exercise records, respectively.
  • These components may be displayed in the user interface 830 in a vertical list arrangement.
  • the user interface 830 may include more or fewer components indicating the user's exercise record, which is not limited in the embodiment of the present application.
  • the mobile phone can send the UI description information of the user interface 830 to the second device (smart watch).
  • the screen of the smart watch is circular.
  • the smart watch can parse the UI description information according to the method flowcharts shown in FIGS. 7 and 8 and display the user interface 840 as shown in FIG. 10B.
  • the user interface 840 may include an outdoor running component 841, a mountain climbing component 842 and other components that indicate the user's exercise record.
  • the smart watch can display components such as the outdoor running component 841 and the mountain climbing component 842 in the user interface 840 in an arc-shaped list arrangement. It is not limited to the above-mentioned arrangement of the arc-shaped list, and each component indicating the user's exercise record may also be displayed on the user interface 840 according to other methods adapted to the smart watch screen.
  • the first device may send multiple sets of UI description information involved in one application scenario to the second device all at once.
  • the UI description information sent by the first device to the second device may at least include the first UI description information and the second UI description information corresponding to the user interface 21 and the user interface 22.
  • the first device may send multiple sets of UI description information involved in an interactive application scenario to the second device all at once.
  • the second device can search multiple sets of stored UI description information to determine the UI description information corresponding to the updated user interface.
  • the application scenario of receiving incoming call notification is still taken as an example for description.
  • the first device when receiving an incoming call notification, the first device (mobile phone) may display the user interface 21.
  • the mobile phone can send all UI description information involved in the application scenario of receiving the incoming call notification to the second device (smart watch). All the UI description information may include the first UI description information corresponding to the user interface 21, the second UI description information corresponding to the user interface 22, and so on.
  • the smart watch can search for the first UI description information.
  • the smart watch can run a service program, parse the first UI description information, and display the components described by the first UI description information on the user interface 31 as shown in FIG. 6C.
  • the smart watch can determine the component associated with the input event. For example, when it is determined that the component associated with the input event is the hang-up component 312, the smart watch can search for the second UI description information from all the UI description information.
  • the second UI description information may describe various components in the user interface 22 for instructing to hang up the phone as shown in FIG. 6D.
  • the smart watch can also feed back the instruction to hang up the phone to the mobile phone.
  • the mobile phone can use the module for mobile communication to send an instruction to the base station to hang up the phone.
  • the second device can store all UI description information involved in a certain application scenario, and when an input event is detected, it automatically searches for the UI description information according to the component associated with the input event. In this way, the requirement for the communication connection between the second device and the first device is not high, which reduces the situation that the second device cannot respond to the input event in time due to the disconnection of the communication connection between the first device and the second device.
  • the first device may send multiple sets of UI description information involved in one application scenario to the second device in stages.
  • the first device may send multiple sets of UI description information involved in an application scenario to the second device in stages. That is, when the second device detects an input event and updates the user interface according to the input event, the first device may send the set of UI description information corresponding to the updated user interface to the second device.
  • the application scenario of receiving incoming call notification is still taken as an example for description.
  • step S102 and step S103 when the first device (mobile phone) receives an incoming call notification, the mobile phone can display the user interface 21 as shown in FIG. 6A, And send the first UI description information to the second device (smart watch).
  • the first UI description information can be used to describe the attributes of each component in the user interface 21.
  • the smart watch may display the user interface 31 as shown in FIG. 6C.
  • the smart watch can send an instruction to hang up the phone to the mobile phone.
  • the mobile phone can display the user interface 22 as shown in FIG. 6D, use the mobile communication module in the mobile phone to send an instruction to hang up the phone to the base station, and send the second UI description information to the smart watch .
  • the second UI description information can be used to describe the attributes of each component in the user interface 22.
  • the smart watch may display the user interface 32 as shown in FIG. 6E.
  • the second device may not store all UI description information, but only needs to parse the UI description information from the first device. And the second device can only feed back the detected input event to the first device without actually processing services. In this way, the storage space and processing capability of the second device are not high requirements, and the burden on the second device can be reduced.
  • the first device may select a second device for interaction in response to a user operation.
  • the first device when the first device runs the first application and detects an instruction to interact with the second device selected by the user, the first device may send the first application to the second device selected by the user UI description information of the user interface in the.
  • the first device is a mobile phone
  • the second device is a smart watch or a tablet.
  • the music playing interface may include a first component 410, which may include a linkage control component 411, a song information component 412, an album cover component 413, a lyrics component 414, a progress bar component 415, a play mode component 416, and a previous song. Component 417, pause component 418, next song component 419, and volume component 4110.
  • the linkage control component 411 can be used for interaction between the mobile phone and the second device.
  • the mobile phone can search for devices that have established a communication connection with the mobile phone, and display a user interface as shown in FIG. 11B.
  • the user interface includes a first component 420.
  • the first component 420 may include components indicating device options, such as a smart watch component 421 and a tablet component 422.
  • the device corresponding to the device option included in the first component 420 is a device that has established a communication connection with a mobile phone.
  • the mobile phone may send UI description information to the smart watch.
  • the UI description information can include the linkage control component 411, the song information component 412, the album cover component 413, the lyrics component 414, the progress bar component 415, the play mode component 416, the previous song component 417, the pause component 418, and the next A description of the attributes of the header component 419 and the volume component 4110.
  • the smart watch When receiving the UI description information, the smart watch can parse the UI description information according to steps S105 to S108 shown in Figure 5, instantiate the components in the UI description information using the component library, and display on the user interface as shown in Figure 11C The components.
  • the user interface shown in FIG. 11C may include a song information component 431, a previous song component 432, a pause component 433, a next song component 434, a play mode component 435, and a volume component 436.
  • the embodiment of the present application does not limit the foregoing music playing interface, and the music playing interface may also include more or fewer components.
  • the foregoing embodiment of the second device that the first device selects to interact in response to the user's operation may be combined with the foregoing method embodiment shown in FIG. 5.
  • the first device when the first device performs step S102 and displays the first user interface, the first device may perform step S103 after receiving a user operation for determining the second device
  • the second device sends the first UI description information.
  • the first UI description information is used to describe the attributes of each component in the first user interface.
  • the first device can intelligently select the second device to interact with.
  • the first device when the first device runs the first application and detects that multiple devices have established a communication connection with the first device, the first device can be based on the distance between the first device or the multiple devices.
  • the second device interacts with it in such a way as the priority order.
  • the first device can select the closest device from a plurality of devices with which it has established a communication connection as the second device, and then send the user interface information in the first application to the selected second device.
  • UI description information there is a priority order among multiple devices that have established a communication connection with the first device.
  • the first device may select the device with the highest priority as the second device, and then send the UI description information of the user interface in the first application to the selected second device.
  • the first device may be a mobile phone.
  • both the smart car and the smart watch worn by the user have established a communication connection with the mobile phone, and in this application scenario, the priority of the smart car is higher than the priority of the smart watch.
  • the mobile phone can send the UI description information of the incoming call notification interface as shown in FIG. 6A to the smart car with higher priority.
  • the smart car can parse the UI description information of the incoming call notification interface, and display the components in the UI description information on the onboard computer.
  • the on-board computer can answer calls in response to user operations (such as touch operations, voice control operations).
  • user operations such as touch operations, voice control operations
  • the foregoing embodiment in which the first device intelligently selects the second device for interaction may be combined with the foregoing method embodiment shown in FIG. 5.
  • the first device when the first device executes step S102 and displays the first user interface, the first device can be based on the distance to the first device or the priority between the multiple devices.
  • the second device to interact with is determined by means of level sequence, etc., and then step S103 is executed to send the first UI description information to the second device.
  • the first UI description information is used to describe the attributes of each component in the first user interface.
  • the embodiment of the present application does not limit the manner in which the first device determines the second device to interact with.
  • the first device may also use other methods. Determine the second device to interact with.
  • Figure 12 shows a schematic diagram of the development of a multi-device interaction system.
  • the structure for developing a multi-device interaction system may include a workstation 510, a cloud 520, a first device 530, and a second device 540. in:
  • the workstation 510 is a development environment for developers (such as designers and programmers).
  • the workstation may include a simulator 511 and a designer 512.
  • the designer 512 can be used to generate UI description information.
  • the designer 512 may include a text editor and a visual drag-and-drop component.
  • the above text editor can be used to generate UI description information by writing text.
  • the UI description information conforms to the UI description format.
  • the above-mentioned visual drag-and-drop component can be dragged, change attributes such as background color and border line, and generate UI description information in a visual user interface manner.
  • developers can use the designer to generate UI description information by writing text or dragging and dropping visual components.
  • the designer 512 may also generate UI description information in other ways.
  • the designer 512 may generate UI description information by receiving a user interface design draft input by a developer. The embodiment of the application does not limit this.
  • the designer 512 may send the UI description information to the simulator 511.
  • the simulator 511 can be used to simulate the output module and the input module of the target device (such as the first device or the second device).
  • the simulator 511 can simulate the screen of a smart watch and an input module (such as a touch sensor, a keyboard, etc.) for responding to an input event (such as a user's touch operation and a text input operation).
  • the simulator 511 can provide the same binary interface as the target device. That is, developers can regard the simulator as the target device to verify whether the results displayed on the screen of the target device of each component in the UI description can achieve the expected effect, and whether the component associated with the input event is detected when an input event is detected. Able to respond.
  • the simulator 511 may include a service program 511a and a virtual machine/script engine 511b.
  • the service program 511a can be used to load and parse the UI description information.
  • the simulator 511 can run the service program 511a to obtain the attributes of each component in the UI description information.
  • the simulator 511 can obtain the executable low-level code corresponding to the component in the component library, and initialize the data part of the executable low-level code by using the attribute of the component.
  • the simulator 511 can instantiate each component, and display each component in the UI description information on the user interface according to the logical relationship between the components.
  • the aforementioned component library may be preset in the simulator, or may be sent to the simulator along with the UI description information.
  • the embodiment of the present application does not limit the manner in which the simulator obtains the component library.
  • the simulator 511 can run a service program to determine the component associated with the input event, and search for UI description information corresponding to the updated user interface.
  • the simulator 511 can parse the aforementioned UI description information corresponding to the updated user interface, and display each component in the UI description information on the user interface. In this way, the developer can check on the simulator whether the second device's response to the input event reaches the expected effect when the second device detects the input event.
  • a script or bytecode can be inserted into the UI description information.
  • the simulator 511 runs the service program to parse the UI description information, it can extract these scripts or bytecodes and send them to the virtual machine/script engine 511b.
  • the virtual machine/script engine 511a may indicate that the simulator 51 may include only a virtual machine, only a script engine, a virtual machine and a script engine, or a script engine based on a virtual machine. Among them, the virtual machine can be used to execute bytecode.
  • the script engine can be used to execute scripts. If the script or bytecode contains a description of each component of the user interface, the virtual machine/script engine 511a can call the component library, obtain and execute executable low-level code from the component library to instantiate each component. If the script or bytecode contains a description of processing input events, when an input event is detected, the simulator 511 can execute the script or bytecode describing the input event in the virtual machine/script engine 511b.
  • scripts or bytecodes are executable programs.
  • the virtual machine/script engine 511a executes a script or bytecode, it can be executed in an isolated space in the simulator memory, and can control various permissions required by the script or bytecode. It can also capture and process Abnormal conditions during operation. In this way, the risks that may exist when the script or bytecode is executed can be reduced.
  • the workstation 510 may also contain more content, which is not limited in the embodiment of the present application.
  • the designer 512 may upload the UI description information to the cloud 520.
  • the cloud 520 may be used to store UI description information and application programs.
  • the cloud 520 may be a content server, an application market, and so on.
  • the first device 530 may include UI description information.
  • the UI description information may be preset or obtained by downloading an application that contains the UI description information.
  • the first device can download the application program from the designer 512 in the workstation 510 or download the application program from the cloud 520.
  • the application program may contain UI description information.
  • the first device may include a service program and a virtual machine/script engine.
  • the components displayed on the user interface of the first device are the components described in the UI description information. That is, the first device can run the service program to parse the UI description information, and call the component library to instantiate each component in the UI description information.
  • the first device parses the UI description information, it may first obtain its own screen information (such as shape, size, resolution, etc.) of the first device, and calculate the size and position of each component according to the screen information. In this way, the components in the UI description information can be adapted to the screen of the first device.
  • the application program contains a drawing command of a user interface adapted to the screen of the first device.
  • the first device can execute these drawing commands to display various components on the user interface.
  • the embodiment of the present application does not limit the manner in which the first device displays each component on the user interface.
  • the first device 530 may send all UI description information related to an application scenario to the second device 540 at one time or in batches.
  • the second device 540 may include a service program 511a and a virtual machine/script engine 511b.
  • the description of the service program 511a and the virtual machine/script engine 511b can refer to the description of the service program 511a and the virtual machine/script engine 511b in the simulator 511.
  • the second device 540 may obtain the UI description information from the first device 530 or from the cloud 520. Wherein, when the UI description information is obtained from the first device 530, the second device 540 needs to establish a communication connection with the first device 530. For example, the second device 540 may establish a communication connection with the first device 530 in a manner such as classic Bluetooth, Bluetooth low energy, or near field communication. When obtaining UI description information from the cloud 520, the second device 540 needs to establish a communication connection with the cloud 520. For example, the second device 540 may establish a communication connection with the cloud 520 by turning on WiFi and accessing the Internet.
  • the second device 540 includes a component library.
  • the component library can be preset in the second device, or can be downloaded to the second device 540 along with the UI description information.
  • the second device 540 may process the UI description information according to steps S105 to S108 in the method flowchart shown in FIG. 5, and display the components in the UI description information on the user interface. I won't repeat it here.
  • the second device 540 may obtain UI description information from the first device 530.
  • the first device (mobile phone) 530 needs to communicate with the second device 540.
  • the smart watch can receive the UI description information from the mobile phone.
  • the smart watch parses the UI description information, and according to preset filtering rules, can display the first component 430, the song information component 431, the previous component 432, the pause component 433, and the next as shown in FIG. 11C on the user interface.
  • a song component 434, a play mode component 435, and a volume component 436 can control the music played on the mobile phone through the smart watch.
  • the second device obtains UI description information from the first device
  • the channel power consumption for communication between the first device and the second device is low, it is beneficial for the second device to obtain UI description information from the first device. Reduce the power consumption of the second device.
  • the second device 540 may obtain UI description information from the cloud 520.
  • the smart watch can use its own speaker to play music.
  • the smart watch may not install the application music player, but obtain the UI description information of the user interface in the music player from the cloud 520.
  • Smart watches can also obtain other music-related data (such as music audio) from the cloud.
  • the UI description information acquired by the smart watch may include UI description information corresponding to the music playing interface and UI description information corresponding to the music list interface as shown in FIG. 11A.
  • the music list interface can be used to select music to be played on the smart watch.
  • the second device obtains the UI description information of the user interface in the first application (such as a music player) from the cloud
  • the second device can not only provide the user with the first application without installing the first application; Service in the application, and the second device can work independently from the first device.
  • Figure 13 shows a schematic diagram of another development of a multi-device interactive system.
  • the structure for developing a multi-device interaction system may include a workstation 610, a cloud 620, a first device 630, and a second device 640. in:
  • the first device 630 may include a virtual screen 631.
  • the first device 630 may obtain in advance the screen information of the second device 640 or the window information of a specific window in the second device 640 (such as the shape, size, and resolution of the window), and set the screen information or window information of the second device It is the screen information of the virtual screen 631.
  • the first device 630 When the first device 630 interacts with the second device 640, the first device 630 can run the service program 611a to analyze the UI description information, and determine the size of each component in the UI description information according to the screen information of the virtual screen 631.
  • the method for parsing the UI description information by the first device may refer to the method for parsing the UI description information by the second device in the method flowchart shown in FIG. 5.
  • the first device 630 may parse the UI description information, and use the component library to obtain instantiated components.
  • the first device 630 may draw the instantiated component on the virtual screen 631 and generate a drawing command.
  • the drawing command can be used to draw components that are adapted to the virtual screen.
  • the first device 630 may send the aforementioned drawing command to the second device 640.
  • the second device 640 may include a service program 611a and a virtual machine/script engine 611b. When receiving drawing commands from the first device 630, the second device 640 can run the service program 611a to execute these drawing commands. In this way, the second device 640 can display each component in the UI description information on the user interface.
  • the second device 640 may feed back the input event to the first device 630.
  • the first device 630 can actually process the service corresponding to the input event, analyze the UI description information, and generate a drawing command.
  • the UI description information parsed by the first device 630 is UI description information corresponding to the user interface that needs to be updated on the second device 640.
  • the second device 640 can run the service program 611a to execute these drawing commands. In this way, the second device 640 can update the user interface.
  • the first device parses the UI description information and generates drawing commands according to the screen information of the second device, and the second device can directly execute the drawing commands to draw each component. This not only solves the problem of adaptation of the components displayed on the user interface of the second device, but also reduces the processing burden of the second device.
  • the first device 630 may pre-acquire the screen information of the second device 640 or the window information of a specific window in the second device 640 (such as the shape, size, and resolution of the window), and set the The screen information or window information is set as the screen information of the virtual screen 631.
  • the first device 630 can parse the UI description information, and combine with the screen information of the virtual screen 631 to determine that each component in the UI description information is displayed on the virtual screen 631, that is, the first device 630 Second, the attributes used on the screen of the device 640. For example, the type, size, location, color, etc. of the component.
  • the first device 630 may send to the second device 640 the UI description information that determines the attribute used by the component to be displayed on the screen of the second device 640.
  • the second device 640 can instantiate the aforementioned UI description information according to the attributes and component libraries used on the display of the components in the aforementioned UI description information on the second device 640, so as to display the aforementioned UI on the user interface of the second device 640. Describe the components in the information. These components can respond to user actions.
  • the first device may parse the UI description information to determine the attributes used by each component in the UI description information to be displayed on the screen of the second device.
  • the second device may only need to instantiate the components in the UI description information and display the instantiated components. In this way, it is also possible to solve the problem of adaptation of the components displayed on the user interface of the second device and reduce the processing burden of the second device.
  • the following introduces a schematic diagram of the structure of a device involved in the process of multi-device interaction.
  • Both the first device and the second device can be devices such as mobile phones, computers, smart watches, smart TVs, and automobiles.
  • the embodiment of the present application does not limit the types of the first device and the second device.
  • FIG. 14 shows a schematic structural diagram of a device 500.
  • the schematic structural diagram may be a schematic structural diagram of the first device or a schematic structural diagram of the second device.
  • the device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, and a battery 142, Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, display screen 190, camera 191, etc.
  • the sensor module 180 may include a pressure sensor, a gyroscope sensor, an acceleration sensor, a distance sensor, a touch sensor, etc.
  • the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the device 100.
  • the device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the device 100.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 190, the camera 191, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the wireless communication module 160 can provide applications on the device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems. (Global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS Global navigation satellite system
  • frequency modulation frequency modulation, FM
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
  • a wireless communication connection such as BT, NFC, etc.
  • devices can transmit UI description information and related instructions, data, etc. through wireless communication channels.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the device 100.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the device 100 may use the mobile communication module 150 to communicate with the base station to realize the functions of answering and hanging up calls.
  • the display screen 190 is used to display images, videos, and the like.
  • the display screen 190 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the device 100 may include 1 or N display screens 190, and N is a positive integer greater than 1.
  • the camera 191 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the device 100 may include 1 or N cameras 191, and N is a positive integer greater than 1.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the device 100 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • the internal memory 121 of the device may be used to store service programs, component libraries, and the like.
  • the above service program can be used to parse the UI description information.
  • the aforementioned component library contains executable low-level code corresponding to each component.
  • the processor 110 may run a service program stored in the internal memory 121 to parse the UI description information.
  • the processor 110 may load the component library stored in the internal memory 121, execute the component library to obtain executable low-level code corresponding to the component, and instantiate the component.
  • the device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, and an application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called a "handset" is used to convert audio electrical signals into sound signals.
  • the device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the device 100 may be provided with at least one microphone 170C. In other embodiments, the device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association
  • the touch sensor 180K may be disposed on the display screen 190, and the touch screen is composed of the touch sensor and the display screen 190, which is also called a “touch screen”.
  • the touch sensor is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation may be provided through the display screen 190.
  • the touch sensor may also be disposed on the surface of the device 100, which is different from the position of the display screen 190.
  • the processor 110 may determine the screen coordinates of the touch operation on the display screen 190 according to the position of the touch sensor that detects the touch operation, and then convert the screen coordinates into the component coordinates of the user interface to determine the Touch the associated component.
  • Fig. 15 exemplarily shows a schematic structural diagram of another device 100.
  • the device 100 may include a display screen 910, a communication device 920, a memory 930, and a processor 940 that are coupled to each other through a bus. in:
  • the communication device 920 can be used for the device 100 to exchange data with other devices.
  • the device 100 may receive UI description information from another device, and the device 100 may send an event for indicating a user operation on the device 100 to the other device.
  • the device 100 establishes a communication connection with other devices.
  • the memory 930 may be used to store one or more programs.
  • the processor 940 may be used to execute one or more programs stored in the memory 930, so that the device 100 can perform the following operations:
  • the device 100 may receive the first UI description information from other devices.
  • the first UI description information can be used to describe the first UI component of the first application.
  • the first UI component may be determined according to the first user interface of the first application.
  • the first UI component can be displayed on the first user interface with the first component attribute.
  • the first application is an application installed on other devices.
  • the device 100 may instantiate the aforementioned first UI component according to the second component attribute and the executable underlying code of the first component.
  • the second component attribute can be determined according to the first UI description information.
  • the executable underlying code of the first UI component may be determined from the component library according to the component type of the first UI component.
  • the component library may contain executable low-level codes for drawing different types of components.
  • the device 100 may use the display screen 910 to display the second user interface.
  • the second user interface may include a first UI component.
  • the first UI component may be displayed with the second component attribute in the second user interface.
  • the first component attribute and the second component attribute may include component type, component size, component location, and component appearance.
  • the first UI component may be a component in the first application that can be displayed on user interfaces of different devices.
  • the first UI component may be displayed with the first component attribute on the first user interface of the first device.
  • the first UI component may be displayed with the second component attribute on the second user interface of the second device.
  • the first UI component displayed on the above-mentioned second user interface may be a component instantiated according to the second component attribute and the executable underlying code of the first UI component. That is, the components mentioned in the foregoing embodiments.
  • the first application program may be a dial-up application.
  • the dial-up application can include a contact component, a hang-up component, and an answer component. These components may represent the aforementioned first UI component.
  • These components can be displayed on the user interface of the mobile phone as shown in FIG. 6A and the user interface of the smart watch as shown in FIG. 6C, respectively, with the first component attribute and the second component attribute.
  • These components are displayed on the user interface of the mobile phone, and can be a contact component 213, a hang-up component 213, and an answer component 214, respectively.
  • These components are displayed on the user interface of the smart watch, and may be a contact component 311, a hang-up component 312, and an answer component 313, respectively.
  • the position, size, color and other parameters of these components displayed on the user interface of the smart watch may be different from those displayed on the user interface of the mobile phone.
  • the first UI component can be divided into the first component or the second component mentioned in the foregoing embodiment according to whether it contains sub-components.
  • the first UI component may be the aforementioned first component.
  • the first UI component may be the aforementioned second component.
  • the second UI component please refer to the above description of the first UI component.
  • both the first application and the second application may be a system application, a home screen application, or a third-party application.
  • the system application program may include the dialing application, the information application, and the contact application mentioned in the foregoing embodiments.
  • the main screen application may be the main interface application mentioned in the foregoing embodiment.
  • the third-party application program may include the WeChat application, the sports health application, and the Google Maps application mentioned in the foregoing embodiment.
  • the first component attribute may include the component type of the first UI component and the component size, component position, and component appearance displayed on the user interface of the first UI component.
  • the aforementioned component type may be the type of the first UI component.
  • the above-mentioned component size, the above-mentioned component position, and the above-mentioned component appearance may be the size, position, and appearance of the first UI component.
  • the appearance is, for example, background, foreground, border line.
  • the meaning of the second component attribute, the third component attribute, and the fourth component attribute please refer to the description of the first component attribute.
  • the component object of the component type of the first UI component may be a type of component corresponding to the component type of the first UI component.
  • the component type of the first UI component is a button
  • the second device uses the executable underlying code of the first UI component to obtain the component object of the component type of the first UI component, which can indicate that the second device obtains A button.
  • the size, position, and appearance of the button displayed on the user interface of the second device need to be determined by the second device according to the attributes of the button displayed on the user interface of the second device.
  • the first application program is installed in the first device.
  • the first device may send the first UI description information of the first user interface to the second device.
  • the first application program may be a dial-up application.
  • the above event refers to incoming call notification.
  • the above-mentioned first user interface may be an incoming call notification interface. That is, the first device sends the UI description information of the call notification interface to the second device, so that the second device can notify the user to answer the call.
  • the second device displays the second user interface.
  • the second user interface may be a user interface displayed by the second device according to the UI description information from the first device.
  • the first device sends the UI description information of the call notification interface to the second device.
  • the foregoing second user interface may be an incoming call notification interface displayed on the second device, which includes the components described in the UI description information.
  • the term “when” can be interpreted as meaning “if" or “after” or “in response to determining" or “in response to detecting".
  • the phrase “when determining" or “if detected (statement or event)” can be interpreted as meaning “if determined" or “in response to determining" or “when detected (Condition or event stated)” or “in response to detection of (condition or event stated)”.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium, (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state hard disk).
  • the process can be completed by a computer program instructing relevant hardware.
  • the program can be stored in a computer readable storage medium. , May include the processes of the foregoing method embodiments.
  • the aforementioned storage media include: ROM or random storage RAM, magnetic disks or optical discs and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

A multi-device interaction method and system. In the method, a first application program is installed in a first device (530, 630), and the first application program may not be installed in a second device (540, 640). The first device (530, 630) displays a user interface of the first application program, and sends UI description information of the user interface of the first application program to the second device (540, 640). The UI description information can be used for describing attributes of assemblies in the user interface of the first application program. The second device (540, 640) displays the user interface of the first application program according to the UI description information and in combination with a screen shape and size of the second device (540, 640). The second device (540, 640) can also detect a user operation on the user interface, and feeds the user operation back to the first device (530, 630). The first device (530, 630) can process a task indicated by the user operation. By means of the method, the second device (540, 640) does not need to install the first application program, but provides a service in the first application program for a user by means of interacting with the first device (530, 630), thereby effectively reducing development costs.

Description

一种多设备交互的方法及系统Method and system for multi-device interaction
本申请要求于2020年05月30日提交中国专利局、申请号为202010480943.4、申请名称为“一种多设备交互的方法及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on May 30, 2020, the application number is 202010480943.4, and the application name is "a method and system for multi-device interaction", the entire content of which is incorporated herein by reference Applying.
技术领域Technical field
本申请涉及终端技术领域,尤其涉及一种多设备交互的方法及系统。This application relates to the field of terminal technology, and in particular to a method and system for multi-device interaction.
背景技术Background technique
随着信息设备数量的增长,多设备交互的应用场景越来越多。其中,在多设备交互的过程中,多个设备都可以显示对应于同一项服务的用户界面。当其中任意一个设备检测到用户操作,这多个设备都可以根据该用户操作进行相关处理。这样,多个不同的设备就可以相互通知、交换信息、相互控制,从而共同完成一个应用场景。例如,手机将来电通知或即时消息推送到智能手表的屏幕并辅助以震动提醒,智能手表控制手机上播放的音乐等。With the increase in the number of information devices, there are more and more application scenarios for multi-device interaction. Among them, in the process of multi-device interaction, multiple devices can display a user interface corresponding to the same service. When any one of the devices detects a user operation, these multiple devices can perform related processing according to the user operation. In this way, multiple different devices can notify each other, exchange information, and control each other, so as to jointly complete an application scenario. For example, the mobile phone pushes incoming call notifications or instant messages to the screen of the smart watch and assists with vibration reminders, and the smart watch controls the music played on the mobile phone.
目前,多个设备分别安装可以实现同一项服务的应用程序。这多个设备可以运行各自安装的应用程序来实现上述交互的过程。但这种方式需要在多侧安装应用程序,开发成本较高。Currently, multiple devices install applications that can implement the same service. These multiple devices can run their respective installed applications to implement the above-mentioned interaction process. However, this method needs to install applications on multiple sides, and the development cost is relatively high.
发明内容Summary of the invention
本申请提供了一种多设备交互的方法及系统。第一设备中安装有第一应用程序。第二设备可以通过接收来自第一设备中第一应用程序的用户界面UI描述信息,来显示第一应用程序的用户界面并相应作用在该用户界面上的用户操作。这样,第二设备可以在不安装该第一应用程序的情况下,为用户提供第一应用程序的服务,从而减少开发人员在第二设备开发该第一应用程序的开发成本。This application provides a method and system for multi-device interaction. The first application is installed in the first device. The second device can display the user interface of the first application program by receiving the user interface UI description information of the first application program in the first device and act on the user operation on the user interface accordingly. In this way, the second device can provide the user with the service of the first application without installing the first application, thereby reducing the development cost of the developer developing the first application on the second device.
第一方面,本申请实施例提供了一种多设备交互方法,该方法包括:第二设备接收来自第一设备的第一UI描述信息;该第一UI描述信息用于描述第一应用程序的第一UI组件,该第一UI组件是根据该第一应用程序的第一用户界面确定的;该第一UI组件在该第一用户界面上以第一组件属性显示;该第一应用程序为安装在该第一设备上的应用程序;第二设备可以根据第二组件属性以及该第一UI组件的可执行的底层代码实例化该第一UI组件;该第二组件属性是根据该第一UI描述信息确定的,该第一UI组件的可执行的底层代码是根据该第一UI组件的组件类型从组件库中确定出的,该组件库包含用于绘制不同类型的组件的可执行的底层代码;第二设备可以显示第二用户界面,第二用户界面可以包括该第一UI组件。该第一UI组件在第二用户界面中可以以上述第二组件属性显示;其中,该第一组件属性、该第二组件属性均包括组件类型,以及以下一项或多项参数:组件尺寸、组件位置、组件外观。In the first aspect, an embodiment of the present application provides a multi-device interaction method. The method includes: a second device receives first UI description information from a first device; the first UI description information is used to describe the information of the first application. The first UI component, the first UI component is determined according to the first user interface of the first application; the first UI component is displayed on the first user interface with the first component attribute; the first application is The application installed on the first device; the second device can instantiate the first UI component according to the second component attribute and the executable underlying code of the first UI component; the second component attribute is according to the first UI component Determined by the UI description information, the executable underlying code of the first UI component is determined from the component library according to the component type of the first UI component, and the component library contains executables for drawing different types of components Low-level code; the second device can display a second user interface, and the second user interface can include the first UI component. The first UI component can be displayed in the second user interface with the aforementioned second component attribute; wherein, the first component attribute and the second component attribute both include the component type and one or more of the following parameters: component size, Component location, component appearance.
在本申请中,第一设备和第二设备均可以为手机、电脑、智能手表、智能电视、智能汽车等设备。在不同的应用场景中,第一设备和第二设备可以不同。In this application, both the first device and the second device may be devices such as mobile phones, computers, smart watches, smart TVs, and smart cars. In different application scenarios, the first device and the second device may be different.
在一些可能的实现方式中,第一设备可以为智能汽车,第二设备可以为智能手表。其 中,智能汽车中可安装有疲劳驾驶检测系统。当检测到用户疲劳驾驶时,智能汽车可以向智能手表发送包含有警告信息的UI描述信息。智能手表可以在屏幕上显示警告信息并辅助以震动提醒。In some possible implementations, the first device may be a smart car, and the second device may be a smart watch. Among them, a fatigue driving detection system can be installed in a smart car. When it is detected that the user is driving in fatigue, the smart car can send UI description information containing warning information to the smart watch. The smart watch can display warning messages on the screen and assist with vibration reminders.
在另一些可能的实施例中,第一设备可以为手机,第二设备可以为智能手表。当手机收到来电通知或即时消息等,手机可以向智能手表发送与来电通知界面或即时消息等用户界面对应UI描述信息。智能手表可以在屏幕上显示来电通知或即时消息等。In other possible embodiments, the first device may be a mobile phone, and the second device may be a smart watch. When the mobile phone receives an incoming call notification or instant message, the mobile phone can send to the smart watch the UI description information corresponding to the user interface such as the incoming call notification interface or instant message. Smart watches can display incoming call notifications or instant messages on the screen.
在本申请实施例中,第一设备与第二设备建立有通信连接。其中,连接的方式可以包括:经典蓝牙、低功耗蓝牙、近场通信。In this embodiment of the application, the first device establishes a communication connection with the second device. Among them, the connection mode may include: classic Bluetooth, low energy Bluetooth, and near field communication.
在本申请实施例中,第二设备中包含有组件库。第二设备可以通过以下一种或多种方式获取组件库:第二设备从第一设备中获取组件库、第二设备从云端(如内容服务器)中获取组件库、第二设备通过预置的方式存储有组件库。In the embodiment of the present application, the second device includes a component library. The second device can obtain the component library through one or more of the following methods: the second device obtains the component library from the first device, the second device obtains the component library from the cloud (such as a content server), and the second device obtains the component library from the cloud (such as a content server). A component library is stored in the way.
在一些实施例中,第二设备包含的组件库中包含用于绘制部分或全部类型的组件的可执行的底层代码。In some embodiments, the component library included in the second device includes executable low-level codes for drawing some or all types of components.
在本申请实施例中,UI描述信息,如第一UI描述信息,是对用户界面中各组件的描述。其中的数据量比较小。这样第一设备向第二设备传输UI描述信息可以不需要高带宽,从而降低了对数据传输带宽的要求。另外UI描述信息不是处理器直接可执行的程序,可以减少第二设备直接下载可执行的程序带来的不可控的安全隐患。In the embodiment of the present application, the UI description information, such as the first UI description information, is a description of each component in the user interface. The amount of data is relatively small. In this way, the first device may not require high bandwidth to transmit the UI description information to the second device, thereby reducing the requirement for data transmission bandwidth. In addition, the UI description information is not a program directly executable by the processor, which can reduce uncontrollable security risks caused by the direct download of the executable program by the second device.
结合第一方面,上述第一用户界面可以显示在第一设备上。With reference to the first aspect, the above-mentioned first user interface may be displayed on the first device.
例如,第一设备为手机,第二设备为智能手表。当手机接收到来电通知,该来电通知界面可以显示在手机上。并且智能手表可以接收到来自手机的该来电通知界面的UI描述信息。进而,智能手表可以根据该UI描述信息在用户界面上显示该来电通知界面中的组件。例如,接听组件、挂断组件。并且这些组件可以响应用户操作。这样,手机和手表均可显示来电通知界面以提醒用户接听电话。For example, the first device is a mobile phone, and the second device is a smart watch. When the mobile phone receives an incoming call notification, the incoming call notification interface can be displayed on the mobile phone. And the smart watch can receive the UI description information of the incoming call notification interface from the mobile phone. Furthermore, the smart watch may display the components in the incoming call notification interface on the user interface according to the UI description information. For example, answer the component, hang up the component. And these components can respond to user operations. In this way, both the mobile phone and the watch can display an incoming call notification interface to remind the user to answer the call.
结合第一方面,当在第二用户界面中检测到作用于第一UI组件的第一用户操作,第二设备可以改变第一UI组件在第二用户界面中的组件尺寸和/或组件外观。上述组件外观可以包括以下一项或多项:颜色、前景、背景。With reference to the first aspect, when a first user operation acting on the first UI component is detected in the second user interface, the second device can change the component size and/or component appearance of the first UI component in the second user interface. The appearance of the aforementioned components may include one or more of the following: color, foreground, and background.
具体的,上述第一UI组件可以关联有监听器。该监听器可用于监听作用在第一UI组件的用户操作,例如单击、长按、拖拽。当监听器监听到第一UI组件上作用有用户操作,第二设备可以改变第一UI组件的组件尺寸和/或组件外观。即第一UI组件本身的显示状态发生变化。其中,第一UI组件本申请的显示状态可以发生以下一项或多项变化:第一UI组件的大小发生变化、第一UI组件的前景图标发生变化、第一UI组件以及第一UI组件的子组件的大小均发生变化。Specifically, the above-mentioned first UI component may be associated with a listener. The listener can be used to monitor user operations that act on the first UI component, such as click, long press, and drag. When the listener detects that a user operation is acting on the first UI component, the second device can change the component size and/or component appearance of the first UI component. That is, the display state of the first UI component itself changes. Among them, the display state of the first UI component in this application may undergo one or more of the following changes: the size of the first UI component changes, the foreground icon of the first UI component changes, the first UI component and the first UI component change The size of the sub-components changes.
示例性的,当UI描述信息包含对手机主界面上应用程序图标的描述,智能手表可以根据该UI描述信息显示第一设备主界面上的应用程序图标。例如拨号图标、微信图标、Google Maps图标和设置图标等。当检测到作用在Google Maps图标上的单击操作,Google Maps图标可以变大。即Google Maps图标可以通过变大来指示Google Maps图标处于被选中的状态。Exemplarily, when the UI description information includes a description of an application icon on the main interface of the mobile phone, the smart watch may display the application icon on the main interface of the first device according to the UI description information. For example, dial icon, WeChat icon, Google Maps icon and settings icon, etc. When a click operation on the Google Maps icon is detected, the Google Maps icon can become larger. That is, the Google Maps icon can be enlarged to indicate that the Google Maps icon is in a selected state.
也即是说,上述第二用户界面的第一UI组件可以响应用户操作,不同于静态图片。In other words, the first UI component of the aforementioned second user interface can respond to user operations, which is different from a static picture.
结合第一方面,响应于在第二用户界面中检测到的作用在第一UI组件上的用户操作,第二设备可以向第一设备发送第一事件。其中,该第一事件可用于指示该第一用户操作的发生。该第二设备接收来自该第一设备的第二UI描述信息;该第二UI描述信息用于描述该第一应用程序的第二UI组件,该第二UI组件是根据该第一应用程序的第三用户界面确定的;该第二UI组件在该第三用户界面上以第三组件属性显示;第二设备可以根据第四组件属性以及该第二UI组件的可执行的底层代码实例化该第二UI组件。该第四组件属性是根据该第二UI描述信息确定的,该第二UI组件的可执行的底层代码是根据该第二UI组件的组件类型从该组件库中确定出的。第二设备可以显示第四用户界面,该第四用户界面可包括该第二UI组件。该第二UI组件在该第四用户界面可以以上述第四组件属性显示。With reference to the first aspect, in response to the detected user operation on the first UI component in the second user interface, the second device may send the first event to the first device. Wherein, the first event can be used to indicate the occurrence of the first user operation. The second device receives the second UI description information from the first device; the second UI description information is used to describe the second UI component of the first application, and the second UI component is based on the first application The third user interface is determined; the second UI component is displayed on the third user interface with the third component attribute; the second device can instantiate the second UI component according to the fourth component attribute and the executable underlying code of the second UI component The second UI component. The fourth component attribute is determined according to the second UI description information, and the executable underlying code of the second UI component is determined from the component library according to the component type of the second UI component. The second device may display a fourth user interface, and the fourth user interface may include the second UI component. The second UI component may be displayed on the fourth user interface with the above-mentioned fourth component attribute.
也即是说,响应于在第二用户界面中检测到的作用在第一UI组件上的用户操作,第二设备可以跳转至下一个用户界面或者刷新第二用户界面,显示第四用户界面。That is to say, in response to a user operation on the first UI component detected in the second user interface, the second device can jump to the next user interface or refresh the second user interface, and display the fourth user interface .
示例性的,当接收到来自手机来电通知界面的UI描述信息,智能手表可以根据该UI描述信息显示该来电通知界面中的组件。例如接听组件和挂断组件。当检测到作用在智能手表用户界面中挂断组件的用户操作,智能手表可以将指示挂断组件上作用有用户操作的事件发送给手机。进一步,智能手表可以接收到来自手机挂断电话界面的UI描述信息。智能手表可以根据该挂断电话界面的UI描述信息显示挂断电话界面的组件。其中,该挂断电话界面可以显示或者不显示在手机上。Exemplarily, when receiving UI description information from the incoming call notification interface of the mobile phone, the smart watch may display the components in the incoming call notification interface according to the UI description information. For example, answering components and hanging up components. When detecting a user operation that acts on the hang-up component in the smart watch user interface, the smart watch can send an event indicating that the hang-up component has a user operation to the mobile phone. Further, the smart watch can receive the UI description information from the phone hang-up interface of the mobile phone. The smart watch can display the components of the phone hang up interface according to the UI description information of the phone hang up interface. Among them, the hang-up interface may be displayed or not displayed on the mobile phone.
结合第一方面,第二设备可以根据该第一UI组件的组件类型从组件库中查找出该第一UI组件的可执行的底层代码;第二设备可以利用该第一UI组件的可执行的底层代码得到该第一UI组件的组件类型的组件对象;第二设备可以利用该第二组件属性设置该第一UI组件的组件类型的组件对象在第二用户界面中的以下一项或多项参数:组件尺寸、组件位置、组件外观,得到实例化的第一UI组件。With reference to the first aspect, the second device can find the executable low-level code of the first UI component from the component library according to the component type of the first UI component; the second device can use the executable low-level code of the first UI component The underlying code obtains the component object of the component type of the first UI component; the second device can use the second component attribute to set one or more of the following one or more of the component object of the component type of the first UI component in the second user interface Parameters: component size, component position, component appearance, get the first UI component instantiated.
在一些实施例中,第一UI组件内部包括至少一个子组件,第二设备可根据该第一UI组件的组件类型从组件库中查找出该第一UI组件的可执行的底层代码,以及根据该子组件的组件类型从组件库中查找出该子组件的可执行的底层代码;第二设备可以利用该第一UI组件的可执行的底层代码得到该第一UI组件的组件类型的组件对象,以及利用该子组件的可执行的底层代码得到该子组件的组件类型的组件对象;第二设备可以利用该第二组件属性设置该第一UI组件的组件类型的组件对象在第二用户界面中的以下一项或多项参数:组件尺寸、组件位置、组件外观,得到实例化的第一UI组件,以及利用该子组件的组件属性设置该子组件的组件类型的组件对象在第二用户界面中的以下一项或多项参数:组件尺寸、组件位置、组件外观,得到实例化的子组件。In some embodiments, the first UI component includes at least one sub-component, and the second device can find the executable underlying code of the first UI component from the component library according to the component type of the first UI component, and according to The component type of the subcomponent finds the executable underlying code of the subcomponent from the component library; the second device can use the executable underlying code of the first UI component to obtain the component object of the component type of the first UI component , And use the executable underlying code of the subcomponent to obtain the component object of the component type of the subcomponent; the second device can use the second component property to set the component object of the component type of the first UI component in the second user interface One or more of the following parameters in: component size, component position, component appearance, the first UI component to be instantiated, and the component object that uses the component property of the sub-component to set the component type of the sub-component in the second user One or more of the following parameters in the interface: component size, component position, component appearance, get instantiated subcomponents.
结合第一方面,在一种可能的实现方式中,第一UI描述信息可包括上述第一组件属性,该第二设备可根据该第一组件属性以及第二设备的屏幕信息确定该第二组件属性;该屏幕信息包括以下一项或多项:屏幕尺寸、屏幕形状、屏幕分辨率。With reference to the first aspect, in a possible implementation manner, the first UI description information may include the above-mentioned first component attribute, and the second device may determine the second component according to the first component attribute and the screen information of the second device Properties; the screen information includes one or more of the following: screen size, screen shape, and screen resolution.
结合第一方面,在一种可能的实现方式中,第一UI描述信息可包括上述第二组件属性。该第二组件属性可以是有第一设备根据上述第一组件属性以及第二设备的屏幕信息确定的。其中,第二设备可以向第一设备发送第二设备的屏幕信息。With reference to the first aspect, in a possible implementation manner, the first UI description information may include the foregoing second component attribute. The second component attribute may be determined by the first device according to the foregoing first component attribute and screen information of the second device. Wherein, the second device may send the screen information of the second device to the first device.
可以看出,第一UI组件的第二组件属性可以利用第二设备的屏幕信息确定。也即是说, 第一设备或者第二设备可以根据第二设备的屏幕信息,来确定第一UI组件在第二设备上显示的组件尺寸、组件位置。这样,不仅减少了屏幕不适配的问题,而且一套UI描述信息可以适用于多种设备。It can be seen that the second component attribute of the first UI component can be determined by using the screen information of the second device. In other words, the first device or the second device may determine the component size and component position of the first UI component displayed on the second device according to the screen information of the second device. In this way, not only the problem of screen mismatch is reduced, but a set of UI description information can be applied to multiple devices.
在一些实施例中,第一UI组件可以根据第一用户界面中的部分或全部组件来确定。In some embodiments, the first UI component may be determined according to some or all of the components in the first user interface.
示例性的,来电通知界面中可包括头像组件、联系人组件、挂断组件和接听组件。其中,头像组件可以指示联系人的头像。联系人组件可以指示联系人的名字。挂断组件可用于挂断电话,接听组件可用于接听电话。当接收到来电通知界面的UI描述信息,智能手表可以显示该来电通知界面中的组件。其中该来电通知界面中的组件可以具有优先级顺序。即智能手表可以按照上述组件的优先级从高至低的顺序显示这些组件。当智能手表的屏幕尺寸不足以显示来电通知界面中的所有组件时,优先级低的组件可以不显示在智能手表中。例如,挂断组件和接听组件的优先级顺序可以是第一优先级。联系人组件可以的优先级顺序可以是第二优先级。头像组件可以的优先级顺序可以是第三优先级。智能手表可以先显示挂断组件和接听组件,然后显示联系人组件,最后显示头像组件。Exemplarily, the incoming call notification interface may include an avatar component, a contact component, a hang-up component, and an answer component. Among them, the avatar component can indicate the avatar of the contact. The contact component can indicate the name of the contact. The hang-up component can be used to hang up the phone, and the answering component can be used to answer the phone. When receiving the UI description information of the incoming call notification interface, the smart watch can display the components in the incoming call notification interface. The components in the incoming call notification interface may have a priority order. That is, the smart watch can display these components in descending order of their priority. When the screen size of the smart watch is not large enough to display all the components in the incoming call notification interface, components with low priority may not be displayed in the smart watch. For example, the priority order of the hanging up component and the answering component may be the first priority. The priority order that the contact component may be may be the second priority. The priority order that the avatar component can be may be the third priority. The smart watch can first display the hang-up component and the answer component, then display the contact component, and finally display the avatar component.
结合第一方面,第二设备在显示第二用户界面之前,该方法还包括:第二设备可以处于熄屏状态;With reference to the first aspect, before the second device displays the second user interface, the method further includes: the second device may be in a screen off state;
或者,or,
第二设备可以显示第三用户界面,该第三用户界面是第二应用程序的用户界面,该第二应用程序为安装在第二设备上的应用程序。The second device may display a third user interface, the third user interface is a user interface of a second application, and the second application is an application installed on the second device.
结合第一方面,第一应用程序可包括系统应用程序、主屏幕应用程序、第三方应用程序。该第三方应用程序为从第三方应用市场下载安装的应用程序。该系统应用程序例如是拨号应用、短信应用、联系人应用。该第三方应用程序例如是微信应用、运动健康应用、Google Maps应用。With reference to the first aspect, the first application program may include a system application program, a home screen application program, and a third-party application program. The third-party application is an application downloaded and installed from a third-party application market. The system application programs are, for example, a dialing application, a short message application, and a contact application. The third-party applications are, for example, WeChat applications, sports health applications, and Google Maps applications.
也即是说,第二设备可以根据接收到的来自第一设备中系统应用程序用户界面的UI描述信息、主屏幕应用程序用户界面的UI描述信息、第三方应用程序用户界面的UI描述信息,来显示第一设备中系统应用程序的用户界面、主屏幕应用程序的用户界面、第三方应用程序的用户界面,从而在不安装这些应用程序的情况下,通过与第一设备通信来为用户提供这些应用程序的服务。这样,开发人员不必要进行第二设备侧的应用程序开发,从而有效减少开发成本。In other words, the second device may receive UI description information from the user interface of the system application in the first device, UI description information of the main screen application user interface, and UI description information of the third-party application user interface. To display the user interface of the system application in the first device, the user interface of the home screen application, and the user interface of a third-party application, so that the user interface can be provided to the user by communicating with the first device without installing these applications. The services of these applications. In this way, developers do not need to develop application programs on the second device side, thereby effectively reducing development costs.
在本申请实施例中,第一应用程序的第一UI组件可以以第一组件属性显示在第一设备的第一用户界面中,还可以以第二组件属性显示在第二设备的第二用户界面中。该第一组件属性可以与第二组件属性相同。例如,第一设备和第二设备为两个屏幕信息相同的设备,第一UI组件可以以相同的组件尺寸、组件位置和组件外观显示在这两个设备的用户界面上。第一组件竖向可以与第二组件属性不同。例如,第一设备和第二设备分别为手机和智能手表,这两个设备的屏幕信息不相同。第一UI组件显示在手机和智能手表上的组件尺寸、组件位置和组件外观可以不相同。In the embodiment of the present application, the first UI component of the first application can be displayed on the first user interface of the first device with the first component attribute, and can also be displayed on the second user of the second device with the second component attribute. Interface. The first component attribute may be the same as the second component attribute. For example, the first device and the second device are two devices with the same screen information, and the first UI component may be displayed on the user interfaces of the two devices with the same component size, component position, and component appearance. The vertical orientation of the first component may be different from that of the second component. For example, the first device and the second device are a mobile phone and a smart watch, respectively, and the screen information of the two devices is different. The component size, component position, and component appearance of the first UI component displayed on the mobile phone and the smart watch may be different.
第二方面,本申请实施例提供还提供一种多设备交互方法,该方法包括:第一设备检测到第一事件,可以向第二设备发送第一用户界面UI描述信息;该第一UI描述信息可以用于描述第一应用程序的第一UI组件,该第一UI组件是根据该第一应用程序的第一用户 界面确定的;该第一UI组件可以在该第一用户界面上以第一组件属性显示;该第一应用程序为安装在该第一设备上的应用程序;第二设备可以根据第二组件属性以及该第一UI组件的可执行的底层代码实例化该第一UI组件。该第二组件属性可以是根据该第一UI描述信息确定的,该第一UI组件的可执行的底层代码可以是根据该第一UI组件的组件类型从组件库中确定出的,该组件库包含用于绘制不同类型的组件的可执行的底层代码。第二设备可以显示第二用户界面;该第二用户界面包括该第一UI组件。该第一UI组件可以在该第二用户界面中以第二组件属性显示。其中,该第一组件属性、该第二组件属性均包括组件类型,以及以下一项或多项参数:组件尺寸、组件位置、组件外观。In a second aspect, the embodiments of the present application also provide a method for multi-device interaction. The method includes: a first device detects a first event and can send a first user interface UI description information to a second device; the first UI description The information can be used to describe the first UI component of the first application, the first UI component is determined according to the first user interface of the first application; the first UI component can be displayed on the first user interface as the first UI component A component attribute display; the first application is an application installed on the first device; the second device can instantiate the first UI component according to the second component attribute and the executable underlying code of the first UI component . The second component attribute may be determined according to the first UI description information, the executable underlying code of the first UI component may be determined from the component library according to the component type of the first UI component, the component library Contains executable low-level code for drawing different types of components. The second device may display a second user interface; the second user interface includes the first UI component. The first UI component can be displayed in the second user interface with the second component attribute. Wherein, the first component attribute and the second component attribute both include the component type and one or more of the following parameters: component size, component location, and component appearance.
结合第二方面,在一种可能的实现方式中,第一设备可以根据第一预设规则,从多个设备中确定第二设备。这多个设备与第一设备均建立有通信连接。With reference to the second aspect, in a possible implementation manner, the first device may determine the second device from multiple devices according to a first preset rule. These multiple devices have established a communication connection with the first device.
具体的,第一设备可以根据与第一设备之间距离的远近或者这多个设备之间的优先级顺序等方式来确定与之进行交互的第二设备。也即是说,第一设备可以从多个与之建立有通信连接的设备中选择距离最近的一个设备作为第二设备,然后向该被选择的第二设备发送第一应用程序中用户界面的UI描述信息。或者,多个与第一设备建立有通信连接的设备之间有优先级顺序。第一设备可以选择优先级最高的设备作为第二设备,然后向该被选择的第二设备发送第一应用程序中用户界面的UI描述信息。Specifically, the first device may determine the second device to interact with it according to the distance between the first device and the first device or the priority order between the multiple devices. In other words, the first device can select the closest device from a plurality of devices with which it has established a communication connection as the second device, and then send the user interface information in the first application to the selected second device. UI description information. Or, there is a priority order among multiple devices that have established a communication connection with the first device. The first device may select the device with the highest priority as the second device, and then send the UI description information of the user interface in the first application to the selected second device.
示例性的,在用户开车收到来电通知的应用场景中,第一设备可以为手机。其中,智能汽车和用户佩戴的智能手表均与手机建立有通信连接,且在该应用场景中,智能汽车的优先级高于智能手表的优先级。当手机收到来电通知,手机可以向优先级更高的智能汽车发送如来电通知界面的UI描述信息。智能汽车可以根据该UI描述信息在显示屏上显示该来电通知界面中的组件。并且,车载电脑可以响应用户操作(例如触摸操作,声控操作)来接听电话。Exemplarily, in an application scenario where a user receives an incoming call notification while driving, the first device may be a mobile phone. Among them, both the smart car and the smart watch worn by the user have established a communication connection with the mobile phone, and in this application scenario, the priority of the smart car is higher than the priority of the smart watch. When the mobile phone receives the incoming call notification, the mobile phone can send the UI description information such as the incoming call notification interface to the smart car with higher priority. The smart car can display the components in the incoming call notification interface on the display screen according to the UI description information. In addition, the on-board computer can answer calls in response to user operations (such as touch operations, voice control operations).
结合第二方面,在一种可能的实现方式中,第一设备可以检测到第一用户操作。该第一用户操作可用于选择第二设备。第一设备可以确定该第一用户操作选择的设备为第二设备。With reference to the second aspect, in a possible implementation manner, the first device can detect the operation of the first user. The first user operation can be used to select the second device. The first device may determine that the device selected by the first user's operation is the second device.
示例性的,第一设备可以为手机,且该手机与用户的平板、智能手表均建立有通信连接。第一设备可以显示音乐播放界面。响应于将该音乐播放界面的UI描述信息发送至智能手表的用户操作,手机可以将该UI描述信息发送给智能手表。智能手表可以显示该音乐播放界面。其中手机还可以将播放的音乐的音频数据发送给智能手表。这样,智能手表可以播放音乐并响应作用在音乐播放界面上的用户操作。Exemplarily, the first device may be a mobile phone, and a communication connection is established between the mobile phone and the user's tablet and smart watch. The first device can display a music playing interface. In response to a user operation of sending the UI description information of the music playing interface to the smart watch, the mobile phone may send the UI description information to the smart watch. The smart watch can display the music playing interface. The mobile phone can also send the audio data of the played music to the smart watch. In this way, the smart watch can play music and respond to user operations on the music playing interface.
第三方面,本申请实施例提供一种设备,包括显示屏、通信装置、存储器以及处理器。其中:所述显示屏用于显示用户界面;所处存储器用于存储于一个或多个程序;所述处理器用于执行所述一个或多个程序,使得所述设备实现如第一方面中任一可能的实现方式,或如第二方面中任一可能的实现方式。In a third aspect, an embodiment of the present application provides a device including a display screen, a communication device, a memory, and a processor. Wherein: the display screen is used to display a user interface; the memory is used to store one or more programs; the processor is used to execute the one or more programs, so that the device implements any of the A possible implementation, or any possible implementation as in the second aspect.
第四方面,本申请实施例提供一种芯片,该芯片应用于设备,该芯片包括一个或多个处理器,该处理器用于调用计算机指令以使得该设备执行如第一方面中任一可能的实现方式,或如第二方面中任一可能的实现方式。In a fourth aspect, an embodiment of the present application provides a chip that is applied to a device. The chip includes one or more processors for invoking computer instructions to make the device perform any possible Implementation, or any possible implementation as in the second aspect.
第五方面,本申请实施例提供一种包含指令的计算机程序产品,其特征在于,当上述 计算机程序产品在设备上运行时,使得上述设备执行如第一方面中任一可能的实现方式,或如第二方面中任一可能的实现方式。In a fifth aspect, an embodiment of the present application provides a computer program product containing instructions, characterized in that, when the computer program product is run on a device, the device is caused to execute any possible implementation manner in the first aspect, or Such as any possible implementation in the second aspect.
第六方面,本申请实施例提供一种计算机可读存储介质,包括指令,其特征在于,当上述指令在设备上运行时,使得上述设备执行如第一方面中任一可能的实现方式,或如第二方面中任一可能的实现方式。In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions, characterized in that, when the foregoing instructions are executed on a device, the foregoing device executes any possible implementation manner as in the first aspect, or Such as any possible implementation in the second aspect.
可以理解地,上述第三方面提供的设备、第四方面提供的芯片、第五方面提供的计算机程序产品和第六方面提供的计算机可读存储介质均用于执行本申请实施例所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。Understandably, the device provided in the third aspect, the chip provided in the fourth aspect, the computer program product provided in the fifth aspect, and the computer-readable storage medium provided in the sixth aspect are all used to execute the methods provided in the embodiments of the present application. . Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.
附图说明Description of the drawings
图1A是本申请实施例提供的一种用户界面的组件构成的示意图;FIG. 1A is a schematic diagram of the component composition of a user interface provided by an embodiment of the present application;
图1B、图1C是本申请实施例提供的一种用户界面的组件的逻辑关系的结构示意图;FIG. 1B and FIG. 1C are schematic structural diagrams of the logical relationship between components of a user interface provided by an embodiment of the present application;
图2A~图2E、图3A~图3D、图4A以及图4B为本申请实施例提供的多设备交互的一系列用户界面示意图;2A to 2E, 3A to 3D, 4A, and 4B are schematic diagrams of a series of user interfaces for multi-device interaction provided by an embodiment of the application;
图5是本申请实施例提供的一种多设备交互的方法流程图;FIG. 5 is a flowchart of a method for multi-device interaction provided by an embodiment of the present application;
图6A~图6E是本申请实施例提供的一些多设备交互的用户界面示意图;6A to 6E are schematic diagrams of some multi-device interaction user interfaces provided by embodiments of the present application;
图7是本申请实施例提供的一种设备实例化组件的方法流程图;FIG. 7 is a flowchart of a method for instantiating a component of a device according to an embodiment of the present application;
图8是本申请实施例提供的一种设备确定组件与屏幕适配的方法流程图;FIG. 8 is a flowchart of a method for determining whether a device is adapted to a screen according to an embodiment of the present application;
图9A、图9B、图10A以及图10B为本申请实施例提供的组件与设备的屏幕适配的应用场景示意图;9A, FIG. 9B, FIG. 10A, and FIG. 10B are schematic diagrams of application scenarios for adapting components provided by an embodiment of the application to the screen of a device;
图11A~图11C是本申请实施例提供的另一些多设备交互的用户界面示意图;11A to 11C are schematic diagrams of other multi-device interaction user interfaces provided by embodiments of the present application;
图12是本申请实施例提供的一种开发多设备交互系统的结构示意图;FIG. 12 is a schematic diagram of a structure for developing a multi-device interaction system provided by an embodiment of the present application;
图13是本申请实施例提供的另一种开发多设备交互系统的结构示意图;FIG. 13 is a schematic structural diagram of another development multi-device interaction system provided by an embodiment of the present application;
图14是本申请实施例提供的一种设备的结构示意图;FIG. 14 is a schematic structural diagram of a device provided by an embodiment of the present application;
图15是本申请实施例提供的另一种设备的结构示意图。FIG. 15 is a schematic structural diagram of another device provided by an embodiment of the present application.
具体实施方式detailed description
本申请以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“所述”、“上述”、“该”和“这一”旨在也包括复数表达形式,除非其上下文中明确地有相反指示。还应当理解,本申请中使用的术语“和/或”是指并包含一个或多个所列出项目的任何或所有可能组合。The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the specification and appended claims of this application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also Including plural expressions, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" used in this application refers to and includes any or all possible combinations of one or more of the listed items.
目前实现多设备交互的应用场景越来越多。实现多设备交互的现有技术主要有三类。At present, there are more and more application scenarios for realizing multi-device interaction. There are three main types of existing technologies for realizing multi-device interaction.
第一种方式为在多个设备上分别安装可以实现同一项服务的应用程序来实现多设备交互。例如,用户在手机和智能手表上利用微信这一个应用和他人进行通信的应用场景,手机和智能手表上都需要安装微信应用程序。这样,对于同一个应用程序,开发人员需要开发能适用不同设备的应用程序,开发成本较高。The first method is to install applications that can implement the same service on multiple devices to achieve multi-device interaction. For example, in an application scenario where a user uses WeChat to communicate with others on mobile phones and smart watches, the WeChat application needs to be installed on both mobile phones and smart watches. In this way, for the same application, developers need to develop applications that can be applied to different devices, and the development cost is relatively high.
第二种方式为在一个设备上安装应用程序或者云端(如服务器)部署有应用程序,其他设备可以通过动态下载可执行程序(如热补丁)的方式与上述一个设备交互。例如,一个设备安装有应用程序,该应用程序的多个功能分别包含于多个程序包中。当另一个设备要提供该应用程序的某一个功能时,这另一个设备可以运行从上述一个设备中下载的与这一个功能对应的程序包。但执行动态下载的可执行程序时,会存在不可控的安全隐患。The second method is to install an application on a device or deploy an application on the cloud (such as a server), and other devices can interact with the above one device by dynamically downloading an executable program (such as a hot patch). For example, an application is installed on a device, and multiple functions of the application are respectively contained in multiple program packages. When another device wants to provide a certain function of the application, the other device can run the program package corresponding to this function downloaded from the above-mentioned one device. However, there will be uncontrollable security risks when executing dynamically downloaded executable programs.
第三种方式为在一个设备上安装应用程序,这一个设备可以运行所有的应用和服务,并将运行的结果(如像素信息或绘制命令)发送给其他设备。其他设备可以根据这些运行结果进行显示,从而实现多设备交互。但在这种实现方式中,上述一个设备的运行结果没有考虑到其他设备的屏幕大小等信息,可能会出现屏幕不适配的问题。The third method is to install an application on a device. This device can run all applications and services and send the results of the operation (such as pixel information or drawing commands) to other devices. Other devices can display based on these running results to realize multi-device interaction. However, in this implementation manner, the operation result of the above one device does not take into account information such as the screen size of other devices, and the problem of screen mismatch may occur.
本申请实施例提供了一种多设备交互的方法。在该方法中,第一设备中安装有第一应用程序(如拨号应用),第二设备中可以不安装该第一应用程序。当第一设备与第二设备进行交互,第一设备可以将第一应用程序的用户界面的用户界面(User Interface,UI)描述信息发送给第二设备。当得到上述UI描述信息,第二设备可以运行服务程序来解析UI描述信息,并利用组件库实例化UI描述信息中的各组件。当对UI描述信息中的所有组件进行了实例化,第二设备可以根据这些组件之间的逻辑关系在用户界面上显示这些组件。其中,上述组件库中包含有可用于绘制各种组件的可执行的底层代码。进一步的,当检测到作用在第二设备的用户操作,例如,用户的触摸操作、输入文本操作等,第二设备可以将该用户操作反馈给第一设备。第一设备可以对该用户操作进行处理。The embodiment of the present application provides a method for multi-device interaction. In this method, a first application (such as a dial-up application) is installed in the first device, and the first application may not be installed in the second device. When the first device interacts with the second device, the first device may send user interface (UI) description information of the user interface of the first application to the second device. When the aforementioned UI description information is obtained, the second device can run a service program to parse the UI description information, and use the component library to instantiate each component in the UI description information. When all the components in the UI description information are instantiated, the second device can display these components on the user interface according to the logical relationship between these components. Among them, the aforementioned component library contains executable low-level codes that can be used to draw various components. Further, when a user operation acting on the second device is detected, for example, a user's touch operation, text input operation, etc., the second device may feed back the user operation to the first device. The first device can process the user operation.
在一些可能的多设备交互的应用场景中,第一设备可以为智能汽车,第二设备可以为智能手表。其中,智能汽车中可安装有疲劳驾驶检测系统。当检测到用户疲劳驾驶时,智能汽车可以向智能手表发送包含有警告信息的UI描述信息。智能手表可以在屏幕上显示警告信息并辅助以震动提醒。或者,第一设备可以为手机,第二设备可以为智能手表。当手机收到来电通知或即时消息等,手机可以向智能手表发送与来电通知界面或即时消息等用户界面对应UI描述信息。智能手表可以在屏幕上显示来电通知或即时消息等。在这些多设备交互的应用场景中,多设备交互的过程均可使用上述本申请实施例提供的多设备交互的方法。In some possible multi-device interaction application scenarios, the first device may be a smart car, and the second device may be a smart watch. Among them, a fatigue driving detection system can be installed in a smart car. When it is detected that the user is driving in fatigue, the smart car can send UI description information containing warning information to the smart watch. The smart watch can display warning messages on the screen and assist with vibration reminders. Alternatively, the first device may be a mobile phone, and the second device may be a smart watch. When the mobile phone receives an incoming call notification or instant message, the mobile phone can send to the smart watch the UI description information corresponding to the user interface such as the incoming call notification interface or instant message. Smart watches can display incoming call notifications or instant messages on the screen. In these multi-device interaction application scenarios, the process of multi-device interaction can use the above-mentioned multi-device interaction method provided in the embodiment of the present application.
需要进行说明的是,在上述多设备交互的应用场景中,第一设备可以先从多个设备中确定需要进行交互的第二设备,然后向该第二设备发送第一应用程序的UI描述信息。该第二设备中可以不用安装该第一应用程序。当接收到上述来自第一设备的UI描述信息,第二设备可以为用户提供第一应用程序中的服务。It should be noted that in the above-mentioned multi-device interaction application scenario, the first device may first determine the second device that needs to interact from multiple devices, and then send the UI description information of the first application to the second device . The first application program may not need to be installed in the second device. When receiving the aforementioned UI description information from the first device, the second device can provide the user with the service in the first application.
在上述第一设备与第二设备交互的过程中,第一设备中第一应用程序的用户界面可以显示在第二设备上。第二设备可以检测用户操作,并向第一设备反馈该用户操作。然后,第一设备可以处理该用户操作指示的任务。这样,第一设备和第二设备就可以相互通知、交换信息、相互控制。并且第二设备不必要安装第一应用程序,开发人员也不必要进行第二设备侧的应用程序开发,从而有效减少开发成本。During the interaction between the first device and the second device, the user interface of the first application in the first device may be displayed on the second device. The second device can detect the user operation, and feed back the user operation to the first device. Then, the first device can process the task indicated by the user operation. In this way, the first device and the second device can notify each other, exchange information, and control each other. In addition, the second device does not need to install the first application program, and the developer does not need to develop the application program on the second device side, thereby effectively reducing development costs.
与第一设备相比,第二设备可以是计算能力、存储能力或人机交互能力等较弱的轻量级设备,如智能手表。这样,在轻量级设备不安装第一应用程序的情况下,该轻量级设备 也可以为用户提供上述第一应用程序的服务和应用。上述多设备交互的方法不仅减少了开发成本,还降低了对第二设备各种能力,如计算能力、存储能力或人机交互能力等,的要求。Compared with the first device, the second device may be a lightweight device with weaker computing capability, storage capability, or human-computer interaction capability, such as a smart watch. In this way, when the lightweight device does not install the first application, the lightweight device can also provide users with the services and applications of the first application. The aforementioned multi-device interaction method not only reduces development costs, but also reduces the requirements for various capabilities of the second device, such as computing capabilities, storage capabilities, or human-computer interaction capabilities.
在本申请实施例中,上述第一设备和第二设备均可以为手机、电脑、智能手表、智能电视、智能汽车等设备。在上述第一设备与第二设备交互的方法中,第一设备和第二设备均可以为多个设备,本申请实施例对此不作限定。In the embodiment of the present application, the above-mentioned first device and second device may both be devices such as mobile phones, computers, smart watches, smart TVs, and smart cars. In the foregoing method of interaction between the first device and the second device, both the first device and the second device may be multiple devices, which are not limited in the embodiment of the present application.
下面对在介绍多设备交互的方法时涉及的一些概念进行说明。The following describes some concepts involved in the introduction of the method of multi-device interaction.
UI描述信息:符合UI描述格式的文本,用于描述用户界面中各组件的属性,还可以用于描述各组件对输入事件或绑定数据的处理。UI描述信息中可以接入脚本或者字节码。上述UI描述格式为一种文本格式,例如,XML格式或者JSON格式等。UI描述格式定义了对用户界面的各组件进行描述所需要遵循的语法。UI description information: text conforming to the UI description format, used to describe the attributes of each component in the user interface, and can also be used to describe the processing of input events or bound data by each component. Script or bytecode can be inserted in the UI description information. The aforementioned UI description format is a text format, for example, an XML format or a JSON format. The UI description format defines the syntax that needs to be followed to describe each component of the user interface.
UI描述信息可以在第二设备与第一设备或者云端(如应用市场)进行传输。UI描述信息由第二设备加载解析并利用组件库在用户界面上实现其中各组件的显示。The UI description information can be transmitted between the second device and the first device or the cloud (such as the application market). The UI description information is loaded and analyzed by the second device, and the component library is used to implement the display of each component in the user interface.
服务程序:在设备上预置的一个常驻程序或模块。服务程序可用于加载解析UI描述信息,以实现在设备的用户界面上显示UI描述信息中的各组件。服务程序还可以用于调用虚拟机或者脚本引擎,以执行UI描述信息中接入的字节码或者脚本。Service program: A resident program or module preset on the device. The service program can be used to load and parse the UI description information, so as to display the components in the UI description information on the user interface of the device. The service program can also be used to call a virtual machine or a script engine to execute the bytecode or script accessed in the UI description information.
组件:指有独立外观、可响应输入事件以及可以绑定数据的UI基本元素。例如,按钮、滑块、复选框、文本框和图标等。上述输入事件可以为设备检测到的作用于组件上的用户操作,例如触摸操作、输入文本操作等。上述绑定数据可以表示组件与数据建立有对应关系。当检测到与组件绑定的数据变化时,设备可以更新组件。例如,对于设备上用于显示当前时刻的组件,当前时刻发生变化时(如从10:00到10:01),设备可以更新组件上的时刻。或者,当检测到组件发生变化时,设备也可以更新数据。Component: Refers to the basic UI elements that have independent appearance, can respond to input events, and can bind data. For example, buttons, sliders, check boxes, text boxes, icons, etc. The aforementioned input event may be a user operation on the component detected by the device, such as a touch operation, a text input operation, and so on. The above-mentioned binding data may indicate that there is a corresponding relationship between the component and the data. When detecting changes in the data bound to the component, the device can update the component. For example, for a component used to display the current time on the device, when the current time changes (for example, from 10:00 to 10:01), the device can update the time on the component. Alternatively, the device can also update the data when a change in the component is detected.
在本申请实施例中,第二设备在用户界面根据UI描述信息显示的组件关联有监听器。该监听器可用于监听作用在组件上的用户操作,例如单击、长按、拖拽。当监听器监听到组件上作用有用户操作,该组件可以响应该用户操作。具体的响应方式可以包括:该组件本身的显示状态发生变化,例如组件的外观发生变化,且第二设备可以根据该用户操作跳转至下一个用户界面或者刷新当前用户界面。In the embodiment of the present application, the second device is associated with a listener on the component displayed on the user interface according to the UI description information. The listener can be used to monitor user operations that act on the component, such as click, long press, and drag. When the listener detects that a user operation is acting on the component, the component can respond to the user operation. The specific response manner may include: the display state of the component itself changes, for example, the appearance of the component changes, and the second device can jump to the next user interface or refresh the current user interface according to the user operation.
在一些实施例中,响应于作用在第二设备根据UI描述信息显示的组件上的用户操作,该组件的大小可以发生变化。如图2E所示,当UI描述信息包含对第一设备(即手机)主界面上应用程序图标的描述,第二设备(即智能手表)可以根据该UI描述信息显示第一设备主界面上的应用程序图标。例如拨号图标721、微信图标722、Google Maps图标723和设置图标724等。当检测到作用在Google Maps图标723上的单击操作,Google Maps图标723可以变大。也即是说,Google Maps图标723可以通过变大来指示Google Maps图标723处于被选中的状态。In some embodiments, in response to a user operation on a component displayed by the second device according to the UI description information, the size of the component may change. As shown in Figure 2E, when the UI description information contains a description of the application icon on the main interface of the first device (ie mobile phone), the second device (ie smart watch) can display the icon on the main interface of the first device according to the UI description information. Application icon. For example, the dial icon 721, the WeChat icon 722, the Google Maps icon 723, the setting icon 724, and so on. When a click operation acting on the Google Maps icon 723 is detected, the Google Maps icon 723 can become larger. In other words, the Google Maps icon 723 can be enlarged to indicate that the Google Maps icon 723 is in a selected state.
在另一些实施例中,响应于作用在第二设备根据UI描述信息显示的组件上的用户操作,该组件的前景图标可以发生变化。当UI描述信息包含对第一设备音乐播放界面中各组件的描述,第二设备可以根据该UI描述信息显示音乐播放界面上的各组件。例如播放控制键。若该播放控制键初始的前景图标为指示音乐正在播放的图标,响应于作用在前景图标为指 示音乐正在播放的图标的播放控制键的用户操作,播放控制键可以将前景图标变换为指示音乐处于暂停播放状态的图标。也即是说,该播放控制键可以通过变化前景图标的方式指示音乐处于播放或暂停的状态。In other embodiments, in response to a user operation on a component displayed by the second device according to the UI description information, the foreground icon of the component may change. When the UI description information includes a description of each component in the music playing interface of the first device, the second device may display each component on the music playing interface according to the UI description information. For example, playback control keys. If the initial foreground icon of the playback control key is an icon indicating that music is playing, in response to a user operation of the playback control key acting on the foreground icon as an icon indicating that the music is playing, the playback control key can transform the foreground icon to indicate that the music is playing. The icon of the paused playback state. In other words, the playback control key can indicate that the music is in a playing or paused state by changing the foreground icon.
在另一实施例中,响应于作用在第二设备根据UI描述信息显示的组件上的用户操作,该组件的大小以及该组件内部包含的子组件的大小均可以发生变化。当UI描述信息包含对第一设备桌面上应用程序图标的描述,第二设备可以根据该UI描述信息显示第一设备桌面上的应用程序图标。其中,这些应用程序图标可以是桌面中页面组件的子组件。响应于作用在第二设备用户界面中页面组件上的长按操作,该页面组件及其子组件均可以变小。进一步的,响应于作用在页面组件上的拖拽操作,该页面组件及其子组件可以与其它页面组件及其子组件交换显示在第二设备上的位置。In another embodiment, in response to a user operation on a component displayed by the second device according to the UI description information, the size of the component and the size of the subcomponents contained in the component may both change. When the UI description information includes a description of the application icon on the desktop of the first device, the second device may display the application icon on the desktop of the first device according to the UI description information. Among them, these application icons may be subcomponents of page components in the desktop. In response to a long-press operation on the page component in the user interface of the second device, the page component and its subcomponents can all become smaller. Further, in response to a drag operation on the page component, the page component and its subcomponents can exchange positions displayed on the second device with other page components and its subcomponents.
本申请实施例对上述响应用户操作时,组件本身的显示状态发生变化的方式不作限定,组件的显示状态可以发生其他的变换。The embodiment of the present application does not limit the manner in which the display state of the component itself changes in response to the user operation described above, and the display state of the component may undergo other transformations.
可以看出,第二设备根据UI描述信息显示的组件关联有监听器,这些组件可以根据监听器监听到的用户操作进行响应,不同于第二设备根据来自第一设备的绘制命令显示的静态图片。It can be seen that the components displayed by the second device according to the UI description information are associated with listeners. These components can respond based on user operations monitored by the listener, which is different from the static pictures displayed by the second device according to the drawing commands from the first device. .
其中,组件可以包括第一组件和第二组件。该第一组件可以为内部包含有其他组件的组件。该第一组件与这些其他组件之间的关系为父组件和子组件之间的关系。并且该第一组件可以管理其内部子组件的排布方式。该第二组件可以为内部不包含有其他组件的组件。Among them, the component may include a first component and a second component. The first component may be a component that contains other components inside. The relationship between the first component and these other components is the relationship between the parent component and the child component. And the first component can manage the arrangement of its internal sub-components. The second component may be a component that does not contain other components inside.
在本申请实施例中,UI描述信息中可包含对第一组件的属性的描述。第一组件的属性可以包括该第一组件的类型,第一组件的类型可以包括线性布局或者相对布局。例如线性布局可以规定其内部子组件的对齐方式为左对齐、排列方式为从上至下,则该线性布局内部的子组件按照左对齐、从上至下的方式逐个进行排列。第一组件的属性还可以包括该第一组件的期望尺寸、期望位置以及外观(如背景、前景、边框线条)。第一组件的属性还可以包括其内部包含的子组件的尺寸和位置信息。例如,子组件的宽高尽量匹配父组件的宽高、子组件的宽高尽量匹配子组件中内容的宽高等。In the embodiment of the present application, the UI description information may include a description of the attribute of the first component. The attribute of the first component may include the type of the first component, and the type of the first component may include linear layout or relative layout. For example, a linear layout may specify that the alignment of its internal sub-components is left-aligned and the arrangement is top-to-bottom, and the sub-components in the linear layout are arranged one by one in a left-aligned and top-to-bottom manner. The attributes of the first component may also include the desired size, desired position, and appearance (such as background, foreground, border line) of the first component. The attributes of the first component may also include size and position information of the sub-components contained in the first component. For example, the width and height of the child component should match the width and height of the parent component as much as possible, and the width and height of the child component should match the width and height of the content in the child component as much as possible.
在本申请实施例中,UI描述信息中可包含对第二组件的属性的描述。第二组件的属性可以包括第第二组件的类型,第二组件的类型可以包括按钮、滑块、复选框、文本框和图标。第二组件的属性还可以包括该第二组件的期望尺寸、期望位置以及外观(如背景、前景、边框线条)等。In the embodiment of the present application, the UI description information may include a description of the attribute of the second component. The attributes of the second component may include the type of the second component, and the type of the second component may include a button, a slider, a check box, a text box, and an icon. The attributes of the second component may also include the desired size, desired position, and appearance (such as background, foreground, border line) of the second component, and so on.
图1A示例性示出了一个用户界面的组件构成。Fig. 1A exemplarily shows the component composition of a user interface.
如图1A所示,该用户界面上包含组件101、组件102、时间组件103、心率组件104、天气组件105和温度组件106。As shown in FIG. 1A, the user interface includes a component 101, a component 102, a time component 103, a heart rate component 104, a weather component 105, and a temperature component 106.
其中,组件101中包含有组件102、时间组件103和心率组件104,则组件101为第一组件。组件102中包含有天气组件105和温度组件106,则组件102为第一组件。由于时间组件103、心率组件104、天气组件105和温度组件106中不包含子组件,则时间组件103、心率组件104、天气组件105和温度组件106为第二组件。组件101和组件102均可以为线性布局,包含于组件101和组件102内的各子组件可以按照左对齐,从左至右并自动换行的方式进行排列。时间组件103和心率组件均可以为文本框,分别用于显示当前时 间和心率数据。天气组件105可以为图标,用于指示当前的天气状况(如晴天、多云、暴雨等)。温度组件106可以为文本框,用于显示当前的环境温度。Among them, the component 101 includes a component 102, a time component 103, and a heart rate component 104, and the component 101 is the first component. The component 102 includes a weather component 105 and a temperature component 106, and the component 102 is the first component. Since the time component 103, the heart rate component 104, the weather component 105 and the temperature component 106 do not contain sub-components, the time component 103, the heart rate component 104, the weather component 105 and the temperature component 106 are the second components. Both the component 101 and the component 102 can have a linear layout, and the sub-components contained in the component 101 and the component 102 can be arranged in a manner of left-aligned, left-to-right, and automatic line wrapping. Both the time component 103 and the heart rate component can be text boxes, which are used to display the current time and heart rate data, respectively. The weather component 105 may be an icon for indicating current weather conditions (such as sunny, cloudy, heavy rain, etc.). The temperature component 106 can be a text box for displaying the current ambient temperature.
图1B示出了图1A中所示的用户界面的UI描述信息中各组件的逻辑关系。如图1B所示,第一组件101中包含子组件102~104。并且第一组件101的子组件102也为第一组件。其中第一组件102中包含子组件105和子组件106。FIG. 1B shows the logical relationship of the components in the UI description information of the user interface shown in FIG. 1A. As shown in FIG. 1B, the first component 101 includes sub-components 102-104. And the sub-component 102 of the first component 101 is also the first component. The first component 102 includes a sub-component 105 and a sub-component 106.
第二设备(智能手表)可以运行服务程序来解析该UI描述信息,从而确定组件101~106的属性。当实例化第一组件101,第二设备(智能手表)可以结合智能手表的屏幕信息(如形状、尺寸、分辨率等)确定第一组件的尺寸和位置,在智能手表的屏幕上显示如图1A所示的第一组件101。智能手表还可以确定第一组件101中的子组件102~104的排布方式,以及这些子组件在智能手表中的尺寸和位置。当实例化第一组件102,由于智能手表在实例化第一组件101时确定了组件102的尺寸和位置,则智能手表可以确定第一组件102的背景色、边框线条等属性,以及第一组件102中子组件105和子组件106的尺寸和位置。The second device (smart watch) can run a service program to parse the UI description information, so as to determine the attributes of the components 101-106. When the first component 101 is instantiated, the second device (smart watch) can determine the size and position of the first component in combination with the screen information of the smart watch (such as shape, size, resolution, etc.), and display it on the smart watch screen as shown in the figure The first assembly 101 shown in 1A. The smart watch can also determine the arrangement of the sub-components 102 to 104 in the first component 101, and the size and position of these sub-components in the smart watch. When the first component 102 is instantiated, since the smart watch determines the size and position of the component 102 when instantiating the first component 101, the smart watch can determine the background color, border line and other attributes of the first component 102, and the first component 102 in the size and position of the sub-assembly 105 and the sub-assembly 106.
当实例化第二组件103~106,智能手表可以根据这些第二组件的属性,在智能手表的屏幕上显示如图1A所示的时间组件103、心率组件104、天气组件105和温度组件106。When the second components 103 to 106 are instantiated, the smart watch can display the time component 103, the heart rate component 104, the weather component 105 and the temperature component 106 as shown in FIG. 1A on the screen of the smart watch according to the attributes of these second components.
在本申请实施例中,UI描述信息中各组件之间的逻辑关系可以通过UI视图树进行描述。In the embodiment of the present application, the logical relationship between the components in the UI description information can be described through the UI view tree.
图1C示出了一棵UI视图树。该UI视图树可以指示如图1A和图1B中的UI描述信息中各组件之件的逻辑关系。如图1C所示,节点101和节点102可以分别表示组件101和组件102,节点103、节点104、节点105和节点106可以分别表示时间组件103、心率组件104、天气组件105和温度组件106。节点101与节点102、节点103、节点104之间是父节点和子节点的关系。同样的,节点102和节点105、节点106之间是父节点和子节点的关系。Figure 1C shows a UI view tree. The UI view tree may indicate the logical relationship of the components in the UI description information as shown in FIG. 1A and FIG. 1B. As shown in FIG. 1C, node 101 and node 102 may represent component 101 and component 102, respectively, and node 103, node 104, node 105, and node 106 may represent time component 103, heart rate component 104, weather component 105, and temperature component 106, respectively. The relationship between node 101 and node 102, node 103, and node 104 is a parent node and a child node. Similarly, the relationship between the node 102 and the node 105 and the node 106 is a parent node and a child node.
也即是说,当对UI描述信息中的各组件进行了实例化,第二设备可以根据上述UI视图树在用户界面上显示各组件。本申请实施例对上述用户描述UI描述信息中各组件之间的逻辑关系的方式不作限定。That is to say, when each component in the UI description information is instantiated, the second device can display each component on the user interface according to the aforementioned UI view tree. The embodiment of the present application does not limit the manner in which the user describes the logical relationship between the components in the UI description information.
组件库:包含有与各组件对应的可执行的底层代码(如机器码、字节码等)的一个模块。其中,上述可执行的底层代码可用于在用户界面绘制各组件。上述机器码可以直接运行在设备的中央处理器(central processing unit,CPU)上。上述字节码可以运行在设备的虚拟机中。组件库中可执行的底层代码可以包括指令部分和数据部分。当运行服务程序来解析UI描述信息时,设备可以确定组件的属性。进一步的,设备可以根据上述属性中组件的类型从组件库中获取与该组件对应的可执行的底层代码,并根据该组件的其它属性初始化可执行的底层代码的数据部分。当与该组件对应的可执行的底层代码中的数据部分经过初始化,设备运行经过初始化的可执行的底层代码时,设备可以实例化该组件,即在用户界面上绘制出该组件。该组件具有UI描述信息中描述该组件的属性。例如,背景色为灰色、边框线条为黑色且粗细为2px的按钮。Component library: a module that contains executable low-level code (such as machine code, bytecode, etc.) corresponding to each component. Among them, the above executable low-level code can be used to draw various components on the user interface. The above-mentioned machine code can be directly run on the central processing unit (CPU) of the device. The above bytecode can be run in the virtual machine of the device. The executable low-level code in the component library can include an instruction part and a data part. When running the service program to parse the UI description information, the device can determine the attributes of the component. Further, the device can obtain the executable low-level code corresponding to the component from the component library according to the type of the component in the above attribute, and initialize the data part of the executable low-level code according to other attributes of the component. When the data part of the executable low-level code corresponding to the component is initialized and the device runs the initialized executable low-level code, the device can instantiate the component, that is, draw the component on the user interface. The component has attributes that describe the component in the UI description information. For example, a button with a background color of gray, a black border line, and a thickness of 2px.
组件库可以通过预置的方式存储在第一设备或第二设备中。另外,组件库还可以在第一设备下载应用程序时一起下载至第一设备中,或者在第一设备向第二设备发送UI描述信息时一起发送至第二设备中。本申请实施例对此不作限定。The component library can be stored in the first device or the second device in a preset manner. In addition, the component library may also be downloaded to the first device when the first device downloads the application program, or sent to the second device when the first device sends UI description information to the second device. The embodiment of the application does not limit this.
在一些实施例中,上述通过预置的方式或者下载的方式存储在第一设备、第二设备中的组件库可以包含与一部分组件对应的可执行的底层代码。这一部分组件为第一设备、第二设备为用户提供服务,显示相应的用户界面所需要的组件。也即是说,存储在第一设备、第二设备中的组件库可以不必包含与所有组件对应的可执行的底层代码。In some embodiments, the aforementioned component library stored in the first device and the second device in a preset manner or in a download manner may include executable low-level codes corresponding to a part of the components. This part of the components provides services for the first device and the second device for users, and displays the components required by the corresponding user interface. In other words, the component libraries stored in the first device and the second device may not necessarily contain executable low-level codes corresponding to all components.
根据上面对多设备交互的方法以及涉及的一些概念的介绍,可以看出,在第一设备与第二设备交互的应用场景中,第一设备可安装第一应用程序,而第二设备上可无需安装该第一应用程序。这样可以有效减少开发成本。According to the above introduction to the method of multi-device interaction and some concepts involved, it can be seen that in the application scenario where the first device interacts with the second device, the first device can install the first application, and the second device There is no need to install the first application. This can effectively reduce development costs.
此外,在多设备交互时,第一设备可以向第二设备发送第一应用程序中用户界面的UI描述信息。第二设备可以解析UI描述信息来显示上述第一应用程序的用户界面,并将检测在该用户界面上检测到的用户操作向第一设备反馈。第一设备可以处理该用户操作指示的任务。这样用户就可以通过第二设备来间接控制第一设备。其中在第一设备与第二设备之间传递的UI描述信息不是可执行程序,从而减少了不可控的安全隐患。In addition, during multi-device interaction, the first device may send the UI description information of the user interface in the first application to the second device. The second device may parse the UI description information to display the user interface of the first application, and feedback the user operation detected on the user interface to the first device. The first device can process the task indicated by the user operation. In this way, the user can indirectly control the first device through the second device. The UI description information transferred between the first device and the second device is not an executable program, thereby reducing uncontrollable security risks.
第二设备在运行服务程序来解析UI描述信息时,可以获取第二设备自己的屏幕信息(如形状、尺寸、分辨率),进而确定UI描述信息中各组件在第二设备上的尺寸和位置。这样根据设备的屏幕的形状和大小来确定各组件的尺寸和位置,不仅可以减少屏幕不适配的问题,而且这一套UI描述信息可以适用于多种设备。When the second device is running the service program to parse the UI description information, it can obtain the second device’s own screen information (such as shape, size, resolution), and then determine the size and position of each component in the UI description information on the second device . In this way, determining the size and position of each component according to the shape and size of the screen of the device can not only reduce the problem of screen mismatch, but also this set of UI description information can be applied to a variety of devices.
由于第二设备可以解析UI描述信息,绘制用户界面的各组件等高开销的步骤主要依赖于组件库,即第二设备可以直接运行组件库中可执行的底层代码来绘制各组件。这样就降低了对第二设备处理能力的要求。另外,相比于传输较底层的像素信息或者绘制命令,传输UI描述信息占用的带宽更少。由以上两点可以看出,本申请实施例提供的多设备交互的方法很适合包含有轻量级设备的应用场景。Since the second device can parse the UI description information, high-overhead steps such as drawing various components of the user interface mainly rely on the component library, that is, the second device can directly run the executable low-level code in the component library to draw each component. This reduces the requirement on the processing capacity of the second device. In addition, compared to the transmission of lower-level pixel information or drawing commands, the transmission of UI description information occupies less bandwidth. It can be seen from the above two points that the method for multi-device interaction provided by the embodiments of the present application is very suitable for application scenarios that include lightweight devices.
在第一设备与第二设备交互时,第一设备可以向第二设备发送UI描述信息,该UI描述信息可以描述第一应用程序中用户界面各组件的属性。其中,上述第一应用程序可以为系统应用或第三方应用。When the first device interacts with the second device, the first device may send UI description information to the second device, and the UI description information may describe the attributes of the user interface components in the first application. Wherein, the above-mentioned first application program may be a system application or a third-party application.
该系统应用可以为第一设备或第二设备在出厂时预置在设备中的应用程序。例如,主界面应用、拨号应用、信息应用、联系人应用、相机、设置等。The system application may be an application program preset in the device when the first device or the second device leaves the factory. For example, main interface application, dialing application, messaging application, contact application, camera, settings, etc.
该第三方应用可以为第一设备或第二设备从云端(如应用市场)或者其他地方下载安装的应用程序。例如,运动健康、微信、Google Maps等。The third-party application can be an application that the first device or the second device downloads and installs from the cloud (such as an application market) or other places. For example, sports health, WeChat, Google Maps, etc.
下面以第一应用程序为系统应用或者第三方应用为例,介绍第二设备显示第一设备中第一应用程序的用户界面的实施例。Hereinafter, taking the first application as a system application or a third-party application as an example, an embodiment in which the second device displays the user interface of the first application in the first device is introduced.
图2A~图2E示出了第一应用程序为系统应用中的主界面应用时,第二设备显示第一设备的主界面的一些用户界面。2A to 2E show that when the first application is a main interface application in the system application, the second device displays some user interfaces of the main interface of the first device.
第一设备与第二设备进行交互之前,第一设备可以选择与之交互的第二设备,以及第一应用程序。Before the first device interacts with the second device, the first device can select the second device to interact with, and the first application.
本申请实施例以第一设备为手机,第二设备为智能手表来进行说明。第一设备和第二设备均可以为其他的设备,本申请实施例对此不作限定。In the embodiment of the present application, the first device is a mobile phone and the second device is a smart watch. Both the first device and the second device may be other devices, which are not limited in the embodiment of the present application.
如图2A所示,手机可以显示主界面710。主界面710可包括状态栏711、具有常用应用程序表的组件715、日历组件712、天气组件713、导航栏716以及其他应用程序图标714。其中:As shown in FIG. 2A, the mobile phone may display a main interface 710. The main interface 710 may include a status bar 711, a component 715 with a list of commonly used applications, a calendar component 712, a weather component 713, a navigation bar 716, and other application icons 714. in:
状态栏711可包括移动通信信号的一个或多个信号强度组件、无线高保真(wireless fidelity,WiFi)信号的一个或多个信号强度组件、蓝牙组件、电池状态组件以及时间组件。The status bar 711 may include one or more signal strength components of a mobile communication signal, one or more signal strength components of a wireless fidelity (wireless fidelity, WiFi) signal, a Bluetooth component, a battery status component, and a time component.
日历组件712可用于指示当前时间,例如日期、星期几、时分信息等。The calendar component 712 can be used to indicate the current time, such as date, day of the week, hour and minute information, and so on.
天气组件713可用于指示天气类型,例如多云转晴等,还可以用于指示气温等信息。The weather component 713 can be used to indicate the type of weather, such as cloudy to clear, and can also be used to indicate information such as temperature.
具有常用应用程序图标的组件715可包括:拨号图标715A、信息图标715B、联系人图标715C和相机图标715D。具有常用应用程序图标的组件715中可包括更多或更少的应用程序的图标。The component 715 with commonly used application icons may include: a dial icon 715A, an information icon 715B, a contact icon 715C, and a camera icon 715D. The component 715 with commonly used application program icons may include more or fewer application program icons.
其他应用程序图标614可包括:运动健康图标714A、Google Maps图标714B、微信图标713C和设置图标714D。其他应用程序图标714中可以包括更多或更少的应用程序图标。Other application icons 614 may include: sports health icon 714A, Google Maps icon 714B, WeChat icon 713C, and settings icon 714D. The other application icons 714 may include more or fewer application icons.
导航栏716可包括返回组件、主界面组件和呼出任务历史组件等用于系统导航的组件。The navigation bar 716 may include components used for system navigation, such as a return component, a main interface component, and a call-out task history component.
响应于作用在状态栏711上的用户操作,例如从状态栏往下滑的滑动操作,手机可以在主界面710上显示如图2B所示的下拉通知栏组件717。下拉通知栏组件717中可包括联动控制图标717A。联动控制图标717A可用于选择与第一设备交互的第二设备。下拉通知栏组件717中还可以包括更多的内容,例如WiFi信号图标、蓝牙图标、手电筒图标等。本申请实施例对下拉通知栏组件717中的内容不做限定。In response to a user operation on the status bar 711, such as a sliding operation to slide down from the status bar, the mobile phone can display a drop-down notification bar component 717 as shown in FIG. 2B on the main interface 710. The drop-down notification bar component 717 may include a linkage control icon 717A. The linkage control icon 717A can be used to select the second device that interacts with the first device. The drop-down notification bar component 717 may also include more content, such as a WiFi signal icon, a Bluetooth icon, a flashlight icon, and so on. The embodiment of the present application does not limit the content in the drop-down notification bar component 717.
响应于作用在联动控制组件717A的用户操作,例如触摸操作,手机可以自动搜索可以与手机进行交互的第二设备,并在主界面710上显示如图2C所示的联动设备选项组件718。联动设备选项组件718中可包括指示手机搜索到的第二设备的图标,例如,智能手表图标718A、平板图标718B和车载电脑图标718C。其中,联动设备选项组件718中图标指示的各第二设备可以为与手机建立有通信连接(如蓝牙连接)的设备。In response to a user operation on the linkage control component 717A, such as a touch operation, the mobile phone can automatically search for a second device that can interact with the mobile phone, and display the linkage device option component 718 as shown in FIG. 2C on the main interface 710. The linked device option component 718 may include an icon indicating the second device searched by the mobile phone, for example, a smart watch icon 718A, a tablet icon 718B, and a car computer icon 718C. Among them, each second device indicated by the icon in the linked device option component 718 may be a device that has established a communication connection (such as a Bluetooth connection) with a mobile phone.
响应于选择联动设备选项组件718中一个或多个第二设备的用户操作,手机可以将第一应用程序中用户界面的UI描述信息发送给这一个或多个第二设备。In response to a user operation of selecting one or more second devices in the linked device option component 718, the mobile phone may send the UI description information of the user interface in the first application to the one or more second devices.
本申请实施例对用于调出下拉通知栏组件717的用户操作不作限定。The embodiment of the present application does not limit the user operation for calling the drop-down notification bar component 717.
进一步的,当检测到作用于智能手表图标718A的用户操作,例如触摸操作,手机可以确定第二设备为智能手表,并可在主界面710中显示如图2D所示的联动应用选项组件719。Further, when a user operation, such as a touch operation, acting on the smart watch icon 718A is detected, the mobile phone can determine that the second device is a smart watch, and can display a linked application option component 719 as shown in FIG. 2D in the main interface 710.
联动应用选项组件719中可以包括系统应用719A和第三方应用719B。其中,系统应用719A中可包含主界面图标、拨号图标、信息图标和联系人图标等。第三方应用719B中可包含微信图标、运动健康图标和Google Maps图标等。响应于作用在联动应用选项组件719中一个或多个应用程序的图标的用户操作,手机可以将这一个或多个应用程序中用户界面的UI描述信息发送给在图2C中被选择的第二设备。The linkage application option component 719 may include a system application 719A and a third-party application 719B. Among them, the system application 719A may include a main interface icon, a dial icon, an information icon, and a contact icon. The third-party application 719B can include WeChat icons, sports health icons, and Google Maps icons. In response to a user operation acting on the icon of one or more applications in the linked application option component 719, the mobile phone can send the UI description information of the user interface in the one or more applications to the second selected in FIG. 2C. equipment.
示例性的,当确定第二设备为智能手表,且检测到作用于主界面图标的用户操作,手机可以在显示如图2A所示的主界面710时,将主界面710的UI描述信息发送给智能手表。Exemplarily, when it is determined that the second device is a smart watch, and a user operation acting on an icon of the main interface is detected, the mobile phone may send the UI description information of the main interface 710 to the main interface 710 when displaying the main interface 710 as shown in FIG. 2A smart watch.
当接收到主界面710的UI描述信息,智能手表可以显示如图2E所示的用户界面720。用户界面720中可以包括显示在主界面710上的应用程序的图标,如拨号图标721、微信 图标722、Google Maps图标723和设置图标724等。智能手表可以响应于作用在用户界面720中任一个应用程序的图标的用户操作,并向手机反馈该用户操作。手机可以处理该用户操作指示的任务,并向智能手表发送更新的用户界面的UI描述信息。例如,响应于作用在拨号图标721的用户操作,智能手表可以向手机反馈拨号图标721上作用有用户操作。然后手机可以向智能手表发送如图3A所示的用于拨号的用户界面730的UI描述信息。智能手表可以解析用户界面730的UI描述信息,并更新用户界面720,显示如图3B所示的用户界面740。When receiving the UI description information of the main interface 710, the smart watch may display the user interface 720 as shown in FIG. 2E. The user interface 720 may include icons of application programs displayed on the main interface 710, such as a dial icon 721, a WeChat icon 722, a Google Maps icon 723, and a setting icon 724. The smart watch may respond to a user operation of an icon of any application program in the user interface 720, and feedback the user operation to the mobile phone. The mobile phone can process the task indicated by the user's operation, and send the updated UI description information of the user interface to the smart watch. For example, in response to a user operation acting on the dial icon 721, the smart watch may feed back to the mobile phone that a user operation acts on the dial icon 721. Then the mobile phone can send the UI description information of the user interface 730 for dialing as shown in FIG. 3A to the smart watch. The smart watch can parse the UI description information of the user interface 730 and update the user interface 720 to display the user interface 740 as shown in FIG. 3B.
不限于显示在主界面710上的应用程序的图标,用户界面720中还可以包括更多安装在手机上的其他应用程序的图标。It is not limited to the icons of the applications displayed on the main interface 710, and the user interface 720 may also include more icons of other applications installed on the mobile phone.
需要进行说明的是,手机可以多次重新选择或取消与手机进行交互的第二设备以及第一应用程序。在一种可能的实现方式中,当检测到作用在联动控制组件717A上的触摸操作,手机可以显示如图2C的联动设备选项组件718,并进一步显示如图2D所示的联动应用选项组件719。这样可以供用户重新选择第二设备以及第一应用程序。当检测到作用在联动控制组件717A上的长按操作,手机可以取消所有与第二设备的交互。不限于上述实现方式,本申请实施例还可通过其它方式重新选择或取消与手机进行交互的第二设备以及第一应用程序。It should be noted that the mobile phone can reselect or cancel the second device and the first application that interact with the mobile phone multiple times. In a possible implementation, when a touch operation on the linkage control component 717A is detected, the mobile phone can display the linkage device option component 718 as shown in FIG. 2C, and further display the linkage application option component 719 as shown in FIG. 2D . This allows the user to re-select the second device and the first application. When a long press operation on the linkage control component 717A is detected, the mobile phone can cancel all interactions with the second device. Not limited to the foregoing implementation manners, the embodiment of the present application may also reselect or cancel the second device and the first application program that interact with the mobile phone in other manners.
图3A~图3D示出了智能手表显示拨号应用的用户界面的示意图。3A to 3D show schematic diagrams of the smart watch displaying the user interface of the dialing application.
当确定第二设备为智能手表,且检测到作用于图2D中拨号图标的用户操作,则手机在显示如图3A所示的用户界面730时,可以向智能手表发送用户界面730的UI描述信息。智能手表可以显示如图3B所示的用户界面740。When it is determined that the second device is a smart watch, and a user operation acting on the dial icon in FIG. 2D is detected, the mobile phone may send UI description information of the user interface 730 to the smart watch when the user interface 730 shown in FIG. 3A is displayed . The smart watch may display a user interface 740 as shown in FIG. 3B.
如图3A所示,用户界面730中可包括历史通话记录组件731、拨号组件732、电话组件733、联系人组件734和收藏组件735。其中,历史通话记录组件731中可包括在当前时刻之前的通话记录,如9:00与Jane的通话记录等。响应于作用在任一通话记录的用户操作,例如触摸操作,手机可以向该通话记录对应的用户拨号。拨号组件732中可包括拨号键盘,可用于用户输入电话号码并拨出电话。电话组件733可用于手机显示如图3A所示的用户界面730。联系人组件734可用于显示保存在手机中的联系人的联系方式(如手机号码、邮箱等)。收藏组件735可用于显示收藏的联系人的联系方式。As shown in FIG. 3A, the user interface 730 may include a historical call record component 731, a dialing component 732, a telephone component 733, a contact component 734, and a favorite component 735. Among them, the historical call record component 731 may include call records before the current moment, such as the call record with Jane at 9:00. In response to a user operation that acts on any call record, such as a touch operation, the mobile phone can dial a user corresponding to the call record. The dialing component 732 can include a dialing keyboard, which can be used for the user to input a telephone number and make a call. The phone component 733 can be used for a mobile phone to display a user interface 730 as shown in FIG. 3A. The contact component 734 can be used to display the contact information (such as mobile phone number, email address, etc.) of the contact stored in the mobile phone. The favorite component 735 can be used to display the contact information of the favorite contact.
用户界面730中可以包括更多或更少的组件,本申请实施例对此不作限定。The user interface 730 may include more or fewer components, which is not limited in the embodiment of the present application.
手机可以将用户界面730的UI描述信息发送给智能手表。智能手表可以对上述UI描述信息进行解析,并利用组件库实例化上述UI描述信息中的各组件,使得各组件的尺寸和位置与智能手表的屏幕适配。智能手表可以显示如图3B所示的用户界面740。用户界面740中可包括号码组件741、拨号组件743以及手机主界面组件742。其中:The mobile phone can send the UI description information of the user interface 730 to the smart watch. The smart watch can parse the aforementioned UI description information, and use the component library to instantiate each component in the aforementioned UI description information, so that the size and position of each component are adapted to the screen of the smart watch. The smart watch may display a user interface 740 as shown in FIG. 3B. The user interface 740 may include a number component 741, a dial component 743, and a mobile phone main interface component 742. in:
号码组件741可用于显示用户输入的电话号码,例如“131********”。The number component 741 can be used to display the phone number entered by the user, such as "131********".
拨号组件743中可包括拨号键盘,可用于用户输入电话号码并拨出电话。具体的,响应于作用于拨号键盘“1、2、3、4、5、6、7、8、9、*、0、#”的用户操作,智能手表可以在号码组件741上显示对应的符号。当检测到作用在用于拨出电话的组件上的用户操作时,智能手表可以向手机反馈该用户操作,并将号码组件741中的电话号码发送给手机。 手机中用于移动通信的模块可以向基站发送指令来拨出电话。不限于上述方式,本申请实施例中智能手表还可以通过其它的方式拨出电话。The dialing component 743 may include a dialing keyboard, which can be used for the user to input a telephone number and make a call. Specifically, in response to a user operation acting on the dial keypad "1,2,3,4,5,6,7,8,9,*,0,#", the smart watch can display the corresponding symbol on the number component 741 . When a user operation acting on the component for making a call is detected, the smart watch can feed back the user operation to the mobile phone, and send the phone number in the number component 741 to the mobile phone. The mobile communication module in the mobile phone can send instructions to the base station to make a call. It is not limited to the above manner, and the smart watch in the embodiment of the present application may also make a call in other manners.
手机主界面组件742可用于在智能手表上显示手机的主界面。响应于作用在手机主界面组件742的用户操作,例如触摸操作,智能手表可以显示如图2E所示的用户界面720。该用户界面720中的组件可为智能手表根据主界面710的UI描述信息解析得到。这样,当显示用户界面720,智能手表可以根据检测到的用户操作来打开手机的主界面710中包含的任意一个应用程序,从而为用户提供相应的服务。The mobile phone main interface component 742 can be used to display the main interface of the mobile phone on the smart watch. In response to a user operation on the main interface component 742 of the mobile phone, such as a touch operation, the smart watch may display a user interface 720 as shown in FIG. 2E. The components in the user interface 720 can be obtained by analyzing the UI description information of the main interface 710 by the smart watch. In this way, when the user interface 720 is displayed, the smart watch can open any application included in the main interface 710 of the mobile phone according to the detected user operation, so as to provide the user with a corresponding service.
在本申请实施例中,智能手表中可包含有实体按键。当检测到作用于该实体按键的用户操作,智能手表可以显示如图6B所示的智能手表的主界面。本申请实施例对智能手表的主界面中包含的内容不作限定,且对智能手表显示智能手表的主界面的方式不作限定。In the embodiment of the present application, the smart watch may include physical buttons. When a user operation acting on the physical button is detected, the smart watch can display the main interface of the smart watch as shown in FIG. 6B. The embodiment of the present application does not limit the content included in the main interface of the smart watch, and does not limit the manner in which the smart watch displays the main interface of the smart watch.
如图3C所示,当手机利用其中用于移动通信的模块向基站发送指令拨出电话时,手机可以显示用户界面750。用户界面750中可包含指示呼叫联系人名称的组件、录音组件、视频通话组件、挂断组件、扬声器组件等组件。其中,录音组件可以用于对通话进行录音。视频通话组件可用于将当前语音通话转换为视频通话。挂断组件可用于挂断电话。扬声器组件可用于将用于播放声音的模块由听筒切换为扬声器。本申请实施例对用户界面750中包含的组件不作限定。As shown in FIG. 3C, when the mobile phone uses the module for mobile communication to send an instruction to the base station to make a call, the mobile phone can display a user interface 750. The user interface 750 may include components indicating the name of the call contact, a recording component, a video call component, a hang-up component, a speaker component, and other components. Among them, the recording component can be used to record calls. The video call component can be used to convert the current voice call into a video call. The hang-up component can be used to hang up the phone. The speaker assembly can be used to switch the module for playing sound from the earpiece to the speaker. The embodiment of the present application does not limit the components included in the user interface 750.
当第二设备为智能手表,且第一应用程序为拨号应用时,手机可以将用户界面750的UI描述信息发送给智能手表。智能手表可以解析用户界面750的UI描述信息,并利用组件库实例化该UI描述信息中的各组件,使得各组件的尺寸和位置与智能手表的屏幕适配。智能手表可以显示如图3D所示的用户界面760。用户界面760中可包含指示呼叫联系人名称的组件、挂断组件和扬声器组件等。其中,挂断组件可用于挂断电话。扬声器组件可用于将用于播放声音的模块由听筒切换为扬声器。示例性的,响应于作用在用户界面760上挂断组件的用户操作,智能手表可以将该用户操作反馈给手机。然后手机可以利用其中用于移动通信的模块向基站发送指令来挂断电话。这样,用户可以通过智能手表上的挂断组件来控制手机以挂断电话。When the second device is a smart watch and the first application is a dialing application, the mobile phone may send the UI description information of the user interface 750 to the smart watch. The smart watch can parse the UI description information of the user interface 750, and use the component library to instantiate each component in the UI description information, so that the size and position of each component are adapted to the screen of the smart watch. The smart watch may display a user interface 760 as shown in FIG. 3D. The user interface 760 may include a component indicating the name of the call contact, a hang-up component, a speaker component, and the like. Among them, the hang-up component can be used to hang up the phone. The speaker assembly can be used to switch the module for playing sound from the earpiece to the speaker. Exemplarily, in response to a user operation of the hang-up component acting on the user interface 760, the smart watch may feed back the user operation to the mobile phone. Then the mobile phone can use the module for mobile communication to send instructions to the base station to hang up the phone. In this way, the user can control the mobile phone to hang up the call through the hang-up component on the smart watch.
用户界面760中还可以包含手机主界面组件742。这样,响应于作用在手机主界面组件742的用户操作,智能手表可以将用户界面760更新为如图2E所示的用户界面720。即用户可以利用手机主界面组件742从用户界面760直接跳转至用户界面720。The user interface 760 may also include a mobile phone main interface component 742. In this way, in response to a user operation acting on the main interface component 742 of the mobile phone, the smart watch can update the user interface 760 to the user interface 720 as shown in FIG. 2E. That is, the user can use the mobile phone main interface component 742 to jump directly from the user interface 760 to the user interface 720.
如图4A所示,响应于作用在主界面710中Google Maps图标714B的用户操作,手机可以显示用户界面770。用户界面770可包括搜索框组件771、定位组件772、清除组件773、开始导航组件774以及地图组件775。其中,搜索框组件771可用于通过文字或语音的方式输入需要查询的地址信息。定位组件772可用于对用户当前的位置进行定位,并显示在地图组件775中。清除组件773可用于对取消当前显示在地图组件775中的导航路径。开始导航组件774可用于按照当前显示在地图组件775中的导航路径开始为用户导航。地图组件775可用于显示地图信息、用户当前的位置信息以及导航路径等信息。本申请实施例对用户界面770中包含的组件不作限定。As shown in FIG. 4A, in response to a user operation acting on the Google Maps icon 714B in the main interface 710, the mobile phone can display the user interface 770. The user interface 770 may include a search box component 771, a positioning component 772, a clearing component 773, a start navigation component 774, and a map component 775. Among them, the search box component 771 can be used to input the address information that needs to be queried by text or voice. The positioning component 772 can be used to locate the current position of the user and display it in the map component 775. The clearing component 773 can be used to cancel the navigation path currently displayed in the map component 775. The start navigation component 774 can be used to start navigating the user according to the navigation path currently displayed in the map component 775. The map component 775 can be used to display information such as map information, the user's current location information, and navigation paths. The embodiment of the present application does not limit the components included in the user interface 770.
当第二设备为智能手表,且第一应用程序为Google Maps时,手机可以将用户界面770的UI描述信息发送给智能手表。智能手表可以解析用户界面770的UI描述信息,并利用组件库实例化该UI描述信息中的各组件,使得各组件的尺寸和位置与智能手表的屏幕适配。智能手表可以显示如图4B所示的用户界面780。用户界面780可包括地图组件781和开始导航组件782。其中,地图组件781可用于显示地图信息、用户当前的位置信息以及导航路径等信息。开始导航组件782可用于按照当前显示在地图组件781中的导航路径开始为用户导航。示例性的,当检测到作用于用户界面780中开始导航组件782上的用户操作,智能手表可以向手机反馈该用户操作。手机可以根据该用户操作向智能手表发送更新的用户界面的UI描述信息。这样,智能手表就可以在与手机交互的过程中实现为用户导航的功能。When the second device is a smart watch and the first application is Google Maps, the mobile phone can send the UI description information of the user interface 770 to the smart watch. The smart watch can parse the UI description information of the user interface 770, and use the component library to instantiate each component in the UI description information, so that the size and position of each component are adapted to the screen of the smart watch. The smart watch may display a user interface 780 as shown in FIG. 4B. The user interface 780 may include a map component 781 and a start navigation component 782. Among them, the map component 781 can be used to display information such as map information, the user's current location information, and navigation paths. The start navigation component 782 can be used to start navigation for the user according to the navigation path currently displayed in the map component 781. Exemplarily, when a user operation acting on the start navigation component 782 in the user interface 780 is detected, the smart watch may feed back the user operation to the mobile phone. The mobile phone can send the updated UI description information of the user interface to the smart watch according to the user operation. In this way, the smart watch can realize the navigation function for the user in the process of interacting with the mobile phone.
上述第二设备还可以为平板或车载电脑等设备,本申请实施例对此不作限定。The foregoing second device may also be a device such as a tablet or a vehicle-mounted computer, which is not limited in the embodiment of the present application.
下面具体以接收到来电通知的应用场景为例来介绍多设备交互的方法。The following specifically takes the application scenario of receiving incoming call notification as an example to introduce the method of multi-device interaction.
图5示出了一种多设备交互的方法流程图。如图5所示,该方法包括步骤S101~S114。其中,步骤S105~S107为第二设备实例化组件的具体过程。步骤S109~S114为第二设备检测到用户操作后,第一设备和第二设备的交互过程。Figure 5 shows a flow chart of a method for multi-device interaction. As shown in Fig. 5, the method includes steps S101 to S114. Among them, steps S105 to S107 are the specific process of the second device instantiating the component. Steps S109 to S114 are the interaction process between the first device and the second device after the second device detects the user operation.
S101、第一设备与第二设备建立通信连接。S101. The first device establishes a communication connection with the second device.
第一设备可以通过有线或者无线等方式建立通信连接并进行通信。例如,第一设备与第二设备可以通过经典蓝牙、低功耗蓝牙或者近场通信等方式进行通信,本申请实施例对此不作限定。The first device may establish a communication connection and perform communication in a wired or wireless manner. For example, the first device and the second device may communicate through classic Bluetooth, Bluetooth low energy, or near field communication, which is not limited in the embodiment of the present application.
S102、第一设备显示第一用户界面。S102. The first device displays a first user interface.
在第一设备与第二设备进行交互的应用场景中,例如第一设备接收到来电通知、短信或者微信消息等,第一设备安装有第一应用程序(如拨号应用、微信等)。第一设备可以运行第一应用程序来显示第一用户界面(如来电通知界面、短信用户界面等)。In an application scenario where the first device interacts with the second device, for example, the first device receives an incoming call notification, short message, or WeChat message, etc., and the first device is installed with a first application (such as a dial-up application, WeChat, etc.). The first device can run the first application to display the first user interface (such as an incoming call notification interface, a short message user interface, etc.).
示例性的,第一用户界面可以为如图6A所示的用户界面(来电通知界面)21。用户界面21中可包含第一组件210、头像组件211、联系人组件212、挂断组件213以及接听组件214。其中:Exemplarily, the first user interface may be a user interface (incoming call notification interface) 21 as shown in FIG. 6A. The user interface 21 may include a first component 210, an avatar component 211, a contact component 212, a hang-up component 213, and an answer component 214. in:
第一组件210是头像组件211、联系人组件212、挂断组件213和接听组件214的父组件。The first component 210 is the parent component of the avatar component 211, the contact component 212, the hang-up component 213, and the answer component 214.
响应于作用在挂断组件213上的用户操作,例如触摸操作,第一设备可以利用其中用于移动通信的模块向基站发送指令来挂断电话。In response to a user operation on the hang-up component 213, such as a touch operation, the first device can use the module for mobile communication therein to send an instruction to the base station to hang up the phone.
响应于作用在接听组件214上的用户操作,例如触摸操作,第一设备可以利用其中用于移动通信的模块向基站发送指令来接通电话。In response to a user operation, such as a touch operation, acting on the answering component 214, the first device may use the module for mobile communication therein to send an instruction to the base station to connect to the phone.
用户界面21还可以包含更多或更少的组件,本申请实施例对此不作限定。The user interface 21 may also include more or fewer components, which is not limited in the embodiment of the present application.
S103、第一设备向第二设备发送第一UI描述信息。S103: The first device sends the first UI description information to the second device.
第一设备中包含有第一UI描述信息。该第一UI描述信息用于描述第一用户界面中各组件的属性。The first device contains first UI description information. The first UI description information is used to describe the attributes of each component in the first user interface.
当显示第一用户界面,第一设备可以向第二设备发送第一UI描述信息。When the first user interface is displayed, the first device may send the first UI description information to the second device.
示例性的,当第一用户界面为如图6A所示的用户界面21时,第一UI描述信息中可包含对第一组件210、头像组件211、联系人组件212、挂断组件213和接听组件214的属性的描述。第一组件210的属性可以包括第一组件的类型。第一组件210的类型可以为线性布局或者相对布局等。第一组件210的属性还可以包括期望尺寸、期望位置以及外观(如背景、前景、边框线条)等。头像组件211、联系人组件212、挂断组件213和接听组件214的属性可以包括这些组件的类型。这些组件的类型可以为图标、文本框或者按钮等。头像组件211、联系人组件212、挂断组件213和接听组件214的属性还可以包括期望尺寸、期望位置以及外观(如背景、前景、边框线条)等。Exemplarily, when the first user interface is the user interface 21 as shown in FIG. 6A, the first UI description information may include the first component 210, the avatar component 211, the contact component 212, the hang-up component 213, and the answer Description of the attributes of the component 214. The attribute of the first component 210 may include the type of the first component. The type of the first component 210 may be a linear layout or a relative layout. The attributes of the first component 210 may also include a desired size, a desired position, and appearance (such as background, foreground, border line), and the like. The attributes of the avatar component 211, the contact component 212, the hang-up component 213, and the answer component 214 may include the types of these components. The types of these components can be icons, text boxes, buttons, etc. The attributes of the avatar component 211, the contact component 212, the hang-up component 213, and the answer component 214 may also include a desired size, a desired position, and appearance (such as background, foreground, border line), and the like.
在一些实施例中,第一设备向第二设备发送第一UI描述信息之前,第一设备可以先向第二设备发送询问指令。该询问指令可用于确定第二设备是否可以与第一设备进行交互,即第二设备是否可以接收并解析第一UI描述信息。当接收到来自第二设备的确定可以进行交互的信息,第一设备可以向第二设备发送第一UI描述信息。In some embodiments, before the first device sends the first UI description information to the second device, the first device may first send an inquiry instruction to the second device. The query instruction can be used to determine whether the second device can interact with the first device, that is, whether the second device can receive and parse the first UI description information. When receiving the information from the second device that it is determined that interaction is possible, the first device may send the first UI description information to the second device.
示例性的,当第一设备(手机)接收到来电通知,并显示用户界面(来电通知界面)21,手机可以向第二设备(智能手表)发送询问指令。若智能手表中开启了来电通知功能,则智能手表可以向手机发送确定信息。该确定信息可指示智能手表同意与手机进行交互。然后手机可以向智能手表发送第一UI描述信息。若智能手表不可以接收并解析第一UI描述信息,例如,智能手表中的来电通知功能处于关闭状态,或者智能手表中包含有对可处理的业务的优先级的排序,而智能手表正在处理的业务的优先级高于接收并解析第一UI描述信息的优先级,智能手表可以不响应来自手机的询问指令。则在未收到智能手表对手机的询问指令的响应时,手机可以不向智能手表发送第一UI描述信息。Exemplarily, when the first device (mobile phone) receives an incoming call notification and displays a user interface (incoming call notification interface) 21, the mobile phone may send an inquiry instruction to the second device (smart watch). If the call notification function is enabled in the smart watch, the smart watch can send confirmation information to the mobile phone. The determination information may indicate that the smart watch agrees to interact with the mobile phone. Then the mobile phone can send the first UI description information to the smart watch. If the smart watch cannot receive and parse the first UI description information, for example, the call notification function in the smart watch is turned off, or the smart watch contains a priority ordering of the services that can be processed, and the smart watch is processing The priority of the service is higher than the priority of receiving and parsing the first UI description information, and the smart watch may not respond to the inquiry instruction from the mobile phone. Then, when the smart watch does not receive a response to the inquiry instruction of the mobile phone, the mobile phone may not send the first UI description information to the smart watch.
第一设备在向第二设备发送UI描述信息之前,还可以通过其他方式来确定第一设备和第二设备可以进行交互,本申请实施例对此不作限定。Before the first device sends the UI description information to the second device, it may also determine that the first device and the second device can interact in other ways, which is not limited in the embodiment of the present application.
S104、第二设备获取组件库。S104. The second device obtains the component library.
组件库中包含有与各组件(如文本框、按钮等)对应的可执行的底层代码(如机器码、字节码等)。其中,可执行的底层代码可以包括指令部分和数据部分。第二设备可以根据组件的类型从组件库中获取与该组件对应的可执行的底层代码,并根据该组件的属性初始化可执行的底层代码的数据部分。当运行数据部分经过初始化的可执行的底层代码,第二设备可以在用户界面上绘制出该组件。The component library contains executable low-level codes (such as machine code, bytecode, etc.) corresponding to each component (such as text boxes, buttons, etc.). Among them, the executable low-level code can include an instruction part and a data part. The second device can obtain the executable low-level code corresponding to the component from the component library according to the type of the component, and initialize the data part of the executable low-level code according to the attribute of the component. When running the executable low-level code with the initialized data part, the second device can draw the component on the user interface.
组件库可以通过预置的方式存储在第二设备中,还可以随UI描述信息一起发送到第二设备中。其中,第二设备可以接收到来自第一设备、云端(如内容服务器)等设备发送的UI描述信息。也即是说,第二设备可以从第一设备、云端等设备获取组件库。除了上述两种获取组件库的方式,第二设备还可以通过其他方式获取组件库,本申请实施例对此不作限定。The component library can be stored in the second device in a preset manner, and can also be sent to the second device along with the UI description information. Among them, the second device may receive the UI description information sent from the first device, the cloud (such as a content server) and other devices. In other words, the second device can obtain the component library from the first device, cloud and other devices. In addition to the foregoing two ways of obtaining the component library, the second device may also obtain the component library in other ways, which is not limited in the embodiment of the present application.
步骤S104与其他步骤之间没有先后顺序的关系,本申请实施例对步骤S104的发生时间不作限定。There is no sequence relationship between step S104 and other steps, and the embodiment of the present application does not limit the occurrence time of step S104.
S105、第二设备解析第一UI描述信息,确定第一用户界面中各组件的属性。S105. The second device parses the first UI description information, and determines the attributes of each component in the first user interface.
当接收到第一UI描述信息,第二设备可以运行服务程序。该服务程序可用于解析第一UI描述信息。When receiving the first UI description information, the second device can run the service program. The service program can be used to parse the first UI description information.
解析第一UI描述信息,第二设备可以确定第一用户界面中各组件的属性。示例性的,若第一用户界面为如图6A所示的用户界面21,则第二设备可以确定组件210为第一组件,其属性中的类型为线性布局,其属性中的背景色为白色等。第二设备还可以确定组件213为第二组件,其属性中的类型为按钮,其属性指示该按钮关联有图片等。After parsing the first UI description information, the second device can determine the attributes of the components in the first user interface. Exemplarily, if the first user interface is the user interface 21 as shown in FIG. 6A, the second device may determine that the component 210 is the first component, the type in the attribute is linear layout, and the background color in the attribute is white Wait. The second device may also determine that the component 213 is the second component, the type in its attribute is a button, and its attribute indicates that the button is associated with a picture or the like.
S106、第二设备根据第一用户界面中的第一组件的类型从组件库中获取第一组件的可执行的底层代码,并利用第一组件的可执行的底层代码与第一组件的属性,实例化第一组件。S106. The second device obtains the executable low-level code of the first component from the component library according to the type of the first component in the first user interface, and uses the executable low-level code of the first component and the attributes of the first component. Instantiate the first component.
组件库中包含对应多个组件的可执行的底层代码。当确定第一组件的类型(如线性布局、相对布局等),第二设备可以根据该第一组件的类型从组件库中获取与该第一组件对应的可执行的底层代码。The component library contains executable low-level codes corresponding to multiple components. When determining the type of the first component (such as linear layout, relative layout, etc.), the second device can obtain the executable low-level code corresponding to the first component from the component library according to the type of the first component.
组件库中与组件对应的可执行的底层代码包含指令部分和数据部分。当确定第一组件的属性(如背景色为白色,边框线条为2px等),第二设备可以根据该第一组件的属性初始化可执行的底层代码的数据部分。这样,第二设备可以完成对该第一组件的实例化。并且经过实例化的第一组件具有第一UI描述信息中描述该第一组件的属性(如背景色为白色,边框线条为2px等)。The executable low-level code corresponding to the component in the component library includes an instruction part and a data part. When the attributes of the first component are determined (for example, the background color is white, the border line is 2px, etc.), the second device can initialize the data part of the executable underlying code according to the attributes of the first component. In this way, the second device can complete the instantiation of the first component. And the instantiated first component has the attributes describing the first component in the first UI description information (for example, the background color is white, the border line is 2px, etc.).
需要进行说明的是,对于最顶层的第一组件,第二设备可以根据第二设备的屏幕信息(如形状、尺寸、分辨率等),来确定上述最顶层的第一组件的尺寸和位置。上述最顶层的第一组件表示该第一组件不是任何其他组件的子组件,即该第一组件不包含于任何其他组件中。It should be noted that for the topmost first component, the second device can determine the size and position of the topmost first component according to the screen information (such as shape, size, resolution, etc.) of the second device. The above-mentioned top-most first component means that the first component is not a subcomponent of any other components, that is, the first component is not included in any other components.
此外,由于第一组件中包含有子组件,在实例化第一组件时,第二设备还可以根据第一组件的尺寸和位置以及预先设定的规则(如子组件的宽高尽量匹配父组件的宽高、子组件的宽高尽量匹配子组件中内容的宽高等),来确定其中各子组件的尺寸和位置。In addition, because the first component contains child components, when instantiating the first component, the second device can also match the parent component as much as possible according to the size and position of the first component and preset rules (such as the width and height of the child component) The width and height of the sub-component and the width and height of the sub-component should match the width and height of the content in the sub-component as much as possible) to determine the size and position of each sub-component.
这样,第二设备可以将第一用户界面上的组件以合适的尺寸显示在第二设备屏幕的合适的位置上。In this way, the second device can display the components on the first user interface in a suitable size on a suitable position on the screen of the second device.
S107、第二设备根据第一用户界面中的第二组件的类型从组件库中获取第二组件的可执行的底层代码,并利用第二组件的可执行的底层代码与第二组件的属性,实例化第二组件。S107. The second device obtains the executable low-level code of the second component from the component library according to the type of the second component in the first user interface, and uses the executable low-level code of the second component and the attributes of the second component. Instantiate the second component.
当确定第二组件的类型(如按钮、文本框等),第二设备可以根据该第二组件的类型从组件库中获取与该第二组件对应的可执行的底层代码。When determining the type of the second component (such as a button, a text box, etc.), the second device can obtain the executable low-level code corresponding to the second component from the component library according to the type of the second component.
当确定第二组件的属性(如背景色为白色,边框线条为2px等),第二设备可以根据该第二组件的属性初始化可执行的底层代码的数据部分。这样,第二设备可以完成对该第二组件的实例化。并且经过实例化的第二组件具有第一UI描述信息中描述该第一组件的属性(如背景色为白色,边框线条为2px等)。When the attributes of the second component are determined (for example, the background color is white, the border line is 2px, etc.), the second device can initialize the data part of the executable underlying code according to the attributes of the second component. In this way, the second device can complete the instantiation of the second component. And the instantiated second component has the attributes describing the first component in the first UI description information (for example, the background color is white, the border line is 2px, etc.).
S108、第二设备显示实例化的第一UI描述信息中的第一组件和第二组件。S108. The second device displays the first component and the second component in the instantiated first UI description information.
当完成对第一UI描述信息中所有第一组件和所有第二组件的实例化,第二设备可以根据该UI视图树显示实例化第一UI描述信息中的第一组件和第二组件。该UI视图树可以指示第一UI描述信息中各组件之间的逻辑关系。When the instantiation of all the first components and all the second components in the first UI description information is completed, the second device may instantiate the first component and the second component in the first UI description information according to the UI view tree display. The UI view tree may indicate the logical relationship between the components in the first UI description information.
在一些实施例中,该UI视图树可以为某一棵已经存在的UI视图树的一个子节点,即 该第一UI描述信息中的各组件可以显示在已经存在的用户界面的某一个位置处。这个已经存在的用户界面可以为任一个应用程序的用户界面或者桌面等。这一棵已经存在的UI视图树可以指示这个已经存在的用户界面上各组件之间的逻辑关系。In some embodiments, the UI view tree may be a child node of an existing UI view tree, that is, each component in the first UI description information may be displayed in a certain position of an existing user interface . This existing user interface can be the user interface or desktop of any application. This existing UI view tree can indicate the logical relationship between components on this existing user interface.
第二设备可以将该UI视图树作为一个子节点嵌入这一棵已经存在的UI视图树中,并在该子节点在这个已经存在的用户界面上的位置处显示第一UI描述信息中的各组件。The second device can embed the UI view tree as a child node in an existing UI view tree, and display each of the first UI description information at the position of the child node on the existing user interface. Components.
示例性的,第二设备上显示有音乐播放界面。该音乐播放界面中包含有暂停组件。响应于作用在该暂停组件的用户操作,第二设备可以向第一设备发送指示暂停组件上有用户操作的指令,并接收来自第一设备的UI描述信息。该UI描述信息中可包含播放组件。第一UI视图树可以指示该UI描述信息中各组件之间的逻辑关系。第二UI视图树可以指示已经存在的音乐播放界面中各组件之间的逻辑关系。则上述第一UI视图树可以作为一个子节点嵌入第二UI视图树。这样,第二设备可以在音乐播放界面上暂停组件所在的位置处显示播放组件,即将暂停组件替换为播放组件,而该音乐播放界面上其他的组件仍显示在该音乐播放界面上。Exemplarily, a music playing interface is displayed on the second device. The music playing interface contains a pause component. In response to a user operation on the pause component, the second device may send an instruction indicating that there is a user operation on the pause component to the first device, and receive UI description information from the first device. The UI description information may include a playback component. The first UI view tree may indicate the logical relationship between the components in the UI description information. The second UI view tree may indicate the logical relationship between the components in the existing music playing interface. Then the above-mentioned first UI view tree may be embedded in the second UI view tree as a child node. In this way, the second device can display the playback component at the location of the pause component on the music playback interface, that is, replace the pause component with the playback component, and other components on the music playback interface are still displayed on the music playback interface.
在另一些实施例中,该UI视图树可以是一棵单独的UI视图树,即第一UI描述信息中各组件可以单独显示在一个新的用户界面上。In other embodiments, the UI view tree may be a separate UI view tree, that is, each component in the first UI description information may be separately displayed on a new user interface.
第二设备可以单独创建一个新的用户界面,并在这一个新的用户界面上显示第一UI描述信息中的各组件。The second device can create a new user interface separately, and display the components in the first UI description information on the new user interface.
示例性的,如图6B所示,第二设备(智能手表)上显示有用户界面30。用户界面30可包含第一组件301、天气组件301A、运动数据组件301B和时间组件301C。其中,第一组件301是天气组件301A、运动数据组件301B和时间组件301C的父组件。天气组件301A可指示当前天气和当前温度。运动数据组件301B可指示用户的消耗热量、步数以及心率信息。时间组件301C可指示时刻信息、日历信息等。本申请实施例对用户界面30中包含的组件不作限定。当第一设备(手机)接收到来电通知,手机可显示如图6A所示的用户界面21,并向智能手表发送UI描述信息。智能手表可以接收并解析该UI描述信息。当实例化该UI描述信息中的各组件,智能手表可以根据UI视图树在用户界面上显示各组件。该UI视图树可以指示该UI描述信息中各组件之间的逻辑关系。由于可以确定该UI视图树为一棵单独的UI视图树,智能手表可以创建一个新的用户界面,如图6C所示的用户界面31。这样,智能手表可以在用户界面31上显示这一棵UI视图树中的各组件。Exemplarily, as shown in FIG. 6B, a user interface 30 is displayed on the second device (smart watch). The user interface 30 may include a first component 301, a weather component 301A, an exercise data component 301B, and a time component 301C. Among them, the first component 301 is the parent component of the weather component 301A, the motion data component 301B, and the time component 301C. The weather component 301A can indicate the current weather and the current temperature. The exercise data component 301B can indicate the user's calories burned, number of steps, and heart rate information. The time component 301C can indicate time information, calendar information, and the like. The embodiment of the present application does not limit the components included in the user interface 30. When the first device (mobile phone) receives the incoming call notification, the mobile phone can display the user interface 21 as shown in FIG. 6A, and send UI description information to the smart watch. The smart watch can receive and parse the UI description information. When instantiating each component in the UI description information, the smart watch can display each component on the user interface according to the UI view tree. The UI view tree may indicate the logical relationship between the components in the UI description information. Since it can be determined that the UI view tree is a separate UI view tree, the smart watch can create a new user interface, such as the user interface 31 shown in FIG. 6C. In this way, the smart watch can display the components in this UI view tree on the user interface 31.
S109、第二设备检测到作用在组件的上的用户操作。S109. The second device detects a user operation acting on the component.
第一UI描述信息中的各组件可以响应输入事件。上述输入事件可以为作用在组件上的用户操作等。Each component in the first UI description information can respond to input events. The aforementioned input event may be a user operation that acts on the component, etc.
当在用户界面上显示第一UI描述信息中的各组件,第二设备可以检测作用在组件上的用户操作,例如触摸操作。When each component in the first UI description information is displayed on the user interface, the second device can detect user operations on the components, such as touch operations.
在一些实施例中,当检测到用户操作,例如作用在第二设备屏幕上的触摸操作,第二设备可以确定与该用户操作关联的组件。具体的,第二设备可以先确定该触摸操作作用在屏幕上的屏幕坐标,并将该屏幕坐标转换为用户界面上的组件坐标,从而确定触摸操作作用的组件,将该用户操作与组件进行关联。本申请实施例对确定与用户操作关联的组件的方式不作具体限定。In some embodiments, when a user operation is detected, such as a touch operation on the screen of the second device, the second device may determine the component associated with the user operation. Specifically, the second device may first determine the screen coordinates of the touch operation acting on the screen, and convert the screen coordinates into component coordinates on the user interface, thereby determining the component acting on the touch operation, and associating the user operation with the component . The embodiment of the present application does not specifically limit the manner of determining the component associated with the user operation.
示例性的,若第一用户界面为如图6A所示的用户界面21,第一UI描述信息可以描述用户界面21中各组件的属性。当实例化该第一UI描述信息中的各组件,第二设备(智能手表)可以显示如图6C所示的用户界面31。用户界面31中包含第一组件310、联系人组件311、挂断组件312和接听组件313。Exemplarily, if the first user interface is the user interface 21 as shown in FIG. 6A, the first UI description information may describe the attributes of each component in the user interface 21. When each component in the first UI description information is instantiated, the second device (smart watch) can display the user interface 31 as shown in FIG. 6C. The user interface 31 includes a first component 310, a contact component 311, a hang-up component 312, and an answer component 313.
当用户触摸智能手表屏幕上挂断组件312所在的位置时,智能手表可以获取该用户操作作用在屏幕上的屏幕坐标。而用户界面31上的各组件可具有在该用户界面31上的组件坐标。智能手表可以将上述用户操作的屏幕坐标转换为用户界面31上的组件坐标,从而确定上述用户操作关联的组件为挂断组件312。When the user touches the location of the hang-up component 312 on the smart watch screen, the smart watch can obtain the screen coordinates of the user's operation on the screen. Each component on the user interface 31 may have component coordinates on the user interface 31. The smart watch can convert the screen coordinates of the user operation to the component coordinates on the user interface 31, so as to determine that the component associated with the user operation is the hang-up component 312.
S110、第二设备向第一设备发送指令。S110. The second device sends an instruction to the first device.
当确定与用户操作关联的组件,第二设备可以向第一设备发送指令。该指令可以指示第二设备检测到的用户操作。When the component associated with the user operation is determined, the second device may send an instruction to the first device. The instruction may indicate the user operation detected by the second device.
示例性的,第二设备可以向第一设备发送检测到的用户操作的屏幕坐标、用户输入的文字或者音频等内容。如图6C所示,当第二设备(智能手表)检测到作用在用户界面31中挂断组件312的用户操作,例如触摸操作,智能手表可以向手机发送该触摸操作在智能手表的屏幕上作用的屏幕坐标。Exemplarily, the second device may send the detected screen coordinates of the user operation, the text or audio input by the user, and other content to the first device. As shown in FIG. 6C, when the second device (smart watch) detects a user operation that acts on the hang-up component 312 in the user interface 31, such as a touch operation, the smart watch can send the touch operation to the mobile phone and act on the smart watch screen. Screen coordinates.
或者,第二设备可以向第一设备发送与检测到的用户操作关联的组件的信息。如图6C所示,当第二设备(智能手表)检测到作用在用户界面31中挂断组件312的用户操作,例如触摸操作,智能手表可以通过步骤S109中确认与用户操作关联的组件的方式,确定挂断组件312中作用有用户操作。进一步的,智能手表可以向手机发送用于指示挂断组件312上作用有用户操作的指令。该指令可指示手机在移动通信网络中将电话挂断。Alternatively, the second device may send the information of the component associated with the detected user operation to the first device. As shown in FIG. 6C, when the second device (smart watch) detects a user operation that acts on the hang-up component 312 in the user interface 31, such as a touch operation, the smart watch can confirm the component associated with the user operation in step S109. , It is determined that there is a user operation in the hang-up component 312. Further, the smart watch may send an instruction to the mobile phone to indicate that the hang-up component 312 has a user operation. The instruction can instruct the mobile phone to hang up the phone in the mobile communication network.
本申请实施例对第二设备发送给第一设备的指令不作限定,除了上述用于指示被用户操作的组件的信息、第二设备检测到的用户操作的屏幕坐标、用户输入的文字、音频等内容,还可以为其他。The embodiments of the present application do not limit the instructions sent by the second device to the first device, except for the information used to indicate the components operated by the user, the screen coordinates of the user operation detected by the second device, the text input by the user, audio, etc. The content can also be other.
S111、第一设备显示第二用户界面。S111. The first device displays a second user interface.
当接收到来自第一设备的指令,第一设备可以响应该指令并显示第二用户界面。When receiving an instruction from the first device, the first device can respond to the instruction and display the second user interface.
示例性的,如图6A和图6D所示,当第一设备(手机)接收到来电通知,并且接收到来自第二设备(智能手表)的指示挂断电话的指令,手机可以显示用户界面22。用户界面22可包括第一组件210、头像组件211、联系人组件212和通话结束组件217。其中,第一组件210为头像组件211、联系人组件212和通话结束组件217的父组件。通话结束组件217可指示电话已挂断。Exemplarily, as shown in FIGS. 6A and 6D, when the first device (mobile phone) receives an incoming call notification and receives an instruction from the second device (smart watch) to hang up the phone, the mobile phone can display the user interface 22 . The user interface 22 may include a first component 210, an avatar component 211, a contact component 212, and a call ending component 217. Among them, the first component 210 is the parent component of the avatar component 211, the contact component 212, and the call end component 217. The call end component 217 can indicate that the call has been hung up.
此外,手机还可利用手机中用于移动通信的模块向基站发送指令挂断电话的指令,从而在移动通信网络中将电话挂断。手机可以先在移动通信网络中将电话挂断,再显示如图6D所示的用户界面22,也可以先显示如图6D所示的用户界面22再在移动通信网络中将电话挂断,还可以在移动通信网络中将电话挂断的同时显示如图6D所示的用户界面22。本申请实施例对此不作限定。In addition, the mobile phone can also use the mobile communication module in the mobile phone to send an instruction to hang up the phone to the base station, so as to hang up the phone in the mobile communication network. The mobile phone can first hang up the phone in the mobile communication network, and then display the user interface 22 as shown in FIG. 6D, or first display the user interface 22 as shown in FIG. 6D and then hang up the phone in the mobile communication network. The user interface 22 as shown in FIG. 6D can be displayed while hanging up the phone in the mobile communication network. The embodiment of the application does not limit this.
S112、第一设备向第二设备发送第二UI描述信息。S112. The first device sends the second UI description information to the second device.
第二UI描述信息可用于描述第二用户界面中各组件的属性。The second UI description information can be used to describe the attributes of each component in the second user interface.
示例性的,当第二设备(智能手表)检测到作用在如图6C所示的挂断组件312上用户 操作,除了向第一设备(手机)发送挂断电话的指令,智能手表还可以显示指示电话已挂断的用户界面(如图6E所示的用户界面32)。而智能手表中可以不安装拨号应用,那么智能手表可能无法根据检测到的用户操作来更新用户界面。但该智能手表可以与手机进行交互。手机中存储有对应各用户界面的UI描述信息,手机可以向智能手表发送第二UI描述信息。该第二UI描述信息可以描述电话已挂断的用户界面中的各组件。这样,智能手表就可以更新用户界面,显示电话已挂断的用户界面。Exemplarily, when the second device (smart watch) detects a user operation acting on the hang-up component 312 as shown in FIG. 6C, in addition to sending a hang-up instruction to the first device (mobile phone), the smart watch can also display A user interface indicating that the phone has been hung up (the user interface 32 shown in FIG. 6E). However, the dial application may not be installed in the smart watch, and the smart watch may not be able to update the user interface according to the detected user operation. But the smart watch can interact with mobile phones. The mobile phone stores UI description information corresponding to each user interface, and the mobile phone can send the second UI description information to the smart watch. The second UI description information may describe each component in the user interface where the phone has been hung up. In this way, the smart watch can update the user interface to display the user interface that the phone has been hung up.
需要进行说明的是,步骤S111和步骤S112之间没有先后顺序。It should be noted that there is no sequence between step S111 and step S112.
S113、第二设备解析第二UI描述信息,并利用组件库实例化第二UI描述信息中的第一组件和第二组件。S113. The second device parses the second UI description information, and uses the component library to instantiate the first component and the second component in the second UI description information.
当接收到第二UI描述信息,第二设备可以运行服务程序,来解析第二UI描述信息。第二UI描述信息中的组件可以包括第一组件和第二组件。第二设备可以从组件库中获取与组件对应的可执行的底层代码,来实例化第二UI描述信息中的第一组件和第二组件。When receiving the second UI description information, the second device can run a service program to parse the second UI description information. The components in the second UI description information may include a first component and a second component. The second device may obtain the executable underlying code corresponding to the component from the component library to instantiate the first component and the second component in the second UI description information.
示例性的,若第二UI描述信息描述如图6D所示的用户界面22中的各组件,则第二UI描述信息中可包含对第一组件210,头像组件211、联系人组件212和通话结束组件217的属性的描述。其中头像组件211、联系人组件212和通话结束组件217包含于第一组件210中,为第二组件。Exemplarily, if the second UI description information describes each component in the user interface 22 as shown in FIG. 6D, the second UI description information may include the first component 210, the avatar component 211, the contact component 212, and the call The description of the attributes of the component 217 ends. The avatar component 211, the contact component 212, and the call ending component 217 are included in the first component 210 and are the second component.
第二设备解析第二UI描述信息,并利用组件库实例化第一组件和第二组件的具体实现过程可以参考步骤S105~S107,这里不再赘述。The second device parses the second UI description information and instantiates the first component and the second component by using the component library. For the specific implementation process, please refer to steps S105 to S107, which will not be repeated here.
S114、第二设备显示实例化的第二UI描述信息中的第一组件和第二组件。S114. The second device displays the first component and the second component in the instantiated second UI description information.
当实例化第二UI描述信息中的各组件,第二设备可以根据UI视图树显示第二UI描述信息中的各组件。该UI视图树可以指示第二UI描述信息中各组件之间的逻辑关系。该UI视图树可以作为一个子节点嵌入一棵已经存在的UI视图树中,还可以作为一棵单独的UI视图树。When instantiating each component in the second UI description information, the second device may display each component in the second UI description information according to the UI view tree. The UI view tree may indicate the logical relationship between the components in the second UI description information. The UI view tree can be embedded in an existing UI view tree as a child node, or can be used as a separate UI view tree.
示例性的,若第二UI描述信息描述如图6D所示的用户界面22中的各组件,则第二设备(智能手表)在实例化第二UI描述信息中的各组件后,可以显示如图6E所示的用户界面32。用户界面32可以包括第一组件310、联系人组件311和通话结束组件314。其中,第一组件310是联系人组件311和通话结束组件314的父组件。通话结束组件314可指示电话已挂断。Exemplarily, if the second UI description information describes the components in the user interface 22 as shown in FIG. 6D, the second device (smart watch) may display the components in the second UI description information after instantiating each component in the second UI description information. The user interface 32 shown in FIG. 6E. The user interface 32 may include a first component 310, a contact component 311, and a call end component 314. Among them, the first component 310 is the parent component of the contact component 311 and the call end component 314. The call end component 314 can indicate that the call has been hung up.
具体的显示方法可以参考步骤S108,这里不再赘述。For the specific display method, refer to step S108, which will not be repeated here.
根据上述第一设备与第二设备交互的方法可以看出,第二设备可以不安装第一应用程序(如拨号应用、播放音乐的应用程序等),而通过接收和解析第一应用程序中用户界面的UI描述信息,即可为用户提供第一应用程序中的服务。这样可以有效减少开发成本。第二设备可以运行预置的服务程序来解析UI描述信息,该UI描述信息是对用户界面中各组件的描述,而不是可执行的程序。这样不仅降低了对第一设备与第二设备进行数据传输的带宽的要求,而且减少了第二设备直接下载可执行的程序带来的不可控的安全隐患。此外,第二设备在解析UI描述信息时,可以根据第二设备自己的屏幕信息来确定UI描述信息中各组件在第二设备用户界面上的尺寸和位置。这样,不仅减少了屏幕不适配的问题,而且 一套UI描述信息可以适用于多种设备。由于第二设备可以利用组件库中可执行的底层代码来绘制各组件,这就降低了对第二设备处理能力的要求,适用于包含有轻量级设备的应用场景。According to the above-mentioned method of interaction between the first device and the second device, it can be seen that the second device may not install the first application (such as a dial-up application, an application for playing music, etc.), but by receiving and parsing the user in the first application The UI description information of the interface can provide users with the services in the first application. This can effectively reduce development costs. The second device can run a preset service program to parse the UI description information. The UI description information is a description of each component in the user interface, rather than an executable program. This not only reduces the bandwidth requirement for data transmission between the first device and the second device, but also reduces uncontrollable security risks caused by the second device directly downloading executable programs. In addition, when the second device parses the UI description information, it can determine the size and position of each component in the UI description information on the user interface of the second device according to the screen information of the second device itself. In this way, not only the problem of screen mismatch is reduced, but a set of UI description information can be applied to multiple devices. Since the second device can use the executable underlying code in the component library to draw each component, this reduces the requirement on the processing capability of the second device, and is suitable for application scenarios that include lightweight devices.
这里具体以接收到来电通知的应用场景为例来说明第二设备实例化组件的一种实现方法。Here, an application scenario of receiving notification of incoming calls is taken as an example to illustrate an implementation method of the instantiated component of the second device.
当第一设备(手机)接收到来电通知,手机可以向第二设备(智能手表)发送第一UI描述信息。该第一UI描述信息可以描述如图6A所示的用户界面21中的各组件。示例性的,该第一UI描述信息具体可以为:When the first device (mobile phone) receives the incoming call notification, the mobile phone can send the first UI description information to the second device (smart watch). The first UI description information may describe various components in the user interface 21 as shown in FIG. 6A. Exemplarily, the first UI description information may specifically be:
Figure PCTCN2021097004-appb-000001
Figure PCTCN2021097004-appb-000001
图7示出了一种第二设备实例化组件的方法流程图。如图7所示,该方法包括步骤S201~S207。Fig. 7 shows a flow chart of a method for instantiating a component of a second device. As shown in Figure 7, the method includes steps S201 to S207.
S201、第二设备识别UI描述信息中的第一组件。S201. The second device identifies the first component in the UI description information.
以UI描述信息为上述第一UI描述信息进行说明。The description will be made by taking the UI description information as the above-mentioned first UI description information.
第二设备(智能手表)解析该第一UI描述信息,可以先识别第一UI描述信息中的第一组件(如组件210)。The second device (smart watch) parses the first UI description information, and can first identify the first component (such as component 210) in the first UI description information.
若识别到第一组件,智能手表可以执行步骤S202。否则,智能手表执行步骤S205。If the first component is recognized, the smart watch can execute step S202. Otherwise, the smart watch executes step S205.
显然,根据上述第一UI描述信息,智能手表可以识别到第一组件210,并执行步骤S202。Obviously, according to the above-mentioned first UI description information, the smart watch can recognize the first component 210 and execute step S202.
S202、第二设备根据解析得到的第一组件的属性,利用组件库实例化第一组件。S202: The second device uses the component library to instantiate the first component according to the parsed attribute of the first component.
第二设备解析第一UI描述信息,可以得到第一组件的属性。由上述第一UI描述信息对第一组件210的描述,可以确定第一组件210的属性中的类型为线性布局,以及第一组件210的属性中的期望尺寸以及其内部包含的子组件的排布方式。第二设备可以根据第一组件210的属性中的类型从组件库中获取与线性布局对应的可执行的底层代码,并利用第一组件的属性初始化可执行的底层代码的数据部分。这样,第二设备就可以实例化第一组件210,并确定其内部的子组件在第二设备用户界面上的尺寸和位置。The second device parses the first UI description information to obtain the attributes of the first component. From the description of the first component 210 described above by the first UI description information, it can be determined that the type in the attributes of the first component 210 is linear layout, and the expected size in the attributes of the first component 210 and the arrangement of the sub-components contained therein. Cloth way. The second device may obtain the executable low-level code corresponding to the linear layout from the component library according to the type in the attribute of the first component 210, and initialize the data part of the executable low-level code by using the attribute of the first component. In this way, the second device can instantiate the first component 210 and determine the size and position of its internal sub-components on the user interface of the second device.
在上述确定第一组件内部的子组件在第二设备用户界面上的尺寸和位置的过程中,若该第一组件为UI描述信息中最顶层的第一组件,即该第一组件不包含于其他组件中,则第二设备可以结合屏幕的尺寸来确定该第一组件的尺寸以及该第一组件的子组件在第二设备用户界面上的尺寸和位置。In the above process of determining the size and position of the sub-components inside the first component on the user interface of the second device, if the first component is the top-most first component in the UI description information, that is, the first component is not included in the Among other components, the second device can determine the size of the first component and the size and position of the sub-components of the first component on the user interface of the second device in combination with the size of the screen.
需要进行说明的是,当检测到第二设备的屏幕为圆形时,第二设备可以按照如图8所示的方法流程图来确定第一组件的尺寸以及该第一组件的子组件的尺寸和位置。该方法包括步骤S301~S304。It should be noted that when it is detected that the screen of the second device is circular, the second device can determine the size of the first component and the size of the sub-components of the first component according to the method flowchart shown in FIG. 8 And location. The method includes steps S301 to S304.
S301、第二设备将第一组件的子组件的初始外边距的值设置为0。S301: The second device sets the value of the initial margin of the subcomponent of the first component to 0.
子组件的外边距(margin)可以表示该子组件的各边与第一组件的各边之间的距离。其中,margin可以包括上边距、下边距、左边距和右边距。The margin of the sub-component may represent the distance between each side of the sub-component and each side of the first component. Among them, margin can include top margin, bottom margin, left margin and right margin.
S302、第二设备计算各子组件的最大可能宽度和最大可能高度。S302. The second device calculates the maximum possible width and maximum possible height of each subcomponent.
第二设备可以根据各子组件中包含的内容的宽高,以及子组件的期望尺寸来计算各子组件的最大可能宽度(maxWidth)和最大可能高度(maxHeight)。这样,第二设备可以保证宽度为maxWidth和高度为maxHeight的子组件能容纳其包含的内容。The second device may calculate the maximum possible width (maxWidth) and maximum possible height (maxHeight) of each subcomponent according to the width and height of the content contained in each subcomponent and the expected size of the subcomponent. In this way, the second device can ensure that a subcomponent with a width of maxWidth and a height of maxHeight can accommodate the content it contains.
S303、根据子组件的最大可能宽度和最大可能高度,第二设备计算第一组件的宽度和高度。S303. According to the maximum possible width and maximum possible height of the subcomponent, the second device calculates the width and height of the first component.
根据子组件的maxWidth和maxHeight,并按照预先设定的规则,例如,第一组件的尺寸尽量匹配屏幕的尺寸,第一组件的尺寸尽量匹配子组件的尺寸等,第二设备可计算第一组件的宽度(measuredWidth)和高度(measuredHeight)。该measuredWidth和measuredHeight即为第一组件最终的尺寸。该最顶层的第一组件为UI描述信息中最顶层的第一组件。According to the maxWidth and maxHeight of the sub-components, and in accordance with preset rules, for example, the size of the first component should match the size of the screen as much as possible, and the size of the first component should match the size of the sub-component as much as possible. The second device can calculate the first component. The width (measuredWidth) and height (measuredHeight). The measuredWidth and measuredHeight are the final dimensions of the first component. The top-most first component is the top-most first component in the UI description information.
S304、第二设备根据屏幕的尺寸和第一组件的尺寸来调整各子组件的外边距的值,并确定各子组件的尺寸和位置。S304. The second device adjusts the value of the outer margin of each subcomponent according to the size of the screen and the size of the first component, and determines the size and position of each subcomponent.
当确定了第一组件最终的尺寸,第二设备需要计算该第一组件的子组件的尺寸和位置。具体的,子组件的尺寸和位置可以利用子组件的margin值来确定。第二设备可以根据公式Inset=0.146*max[min(measuredWidth,screenWidth),min(measuredHieght,screenHieght)]得到Inset的值,并将该Inset的值设置为新的margin值。其中,screenWidth和screenHieght分别表示屏幕的宽和高。When the final size of the first component is determined, the second device needs to calculate the size and position of the sub-components of the first component. Specifically, the size and position of the sub-component can be determined by the margin value of the sub-component. The second device may obtain the value of Inset according to the formula Inset=0.146*max[min(measuredWidth, screenWidth), min(measuredHieght, screenHieght)], and set the value of Inset to the new margin value. Among them, screenWidth and screenHieght represent the width and height of the screen, respectively.
根据该新的margin的值,第二设备可以确定各子组件的尺寸和位置。According to the new margin value, the second device can determine the size and position of each subcomponent.
示例性的,第一组件210不包含于其他组件内,为最顶层的第一组件。第二设备(智能手表)在实例化第一组件210时,可以根据上述步骤S301~S304确定第一组件210的尺 寸和位置以及第一组件210的子组件211~214在智能手表用户界面上的尺寸和位置。这样,智能手表可以显示如图6C所示的第一组件310以及第一组件的子组件311~313。第一组件310可为经过实例化之后的第一组件210。组件311可为经过实例化之后的联系人组件212。组件312可为经过实例化之后的挂断组件213。组件313可为经过实例化之后的接听组件214。组件310~313的尺寸、位置与智能手表的屏幕适配。Exemplarily, the first component 210 is not included in other components, and is the top-most first component. When the second device (smart watch) instantiates the first component 210, it can determine the size and position of the first component 210 and the subcomponents 211 to 214 of the first component 210 on the smart watch user interface according to the above steps S301 to S304. Size and location. In this way, the smart watch can display the first component 310 and the subcomponents 311-313 of the first component as shown in FIG. 6C. The first component 310 may be the first component 210 after instantiation. The component 311 may be the contact component 212 after instantiation. The component 312 may be the hang-up component 213 after instantiation. The component 313 may be the answering component 214 after instantiation. The sizes and positions of the components 310 to 313 are adapted to the screen of the smart watch.
需要进行说明的是,上述确定各组件的尺寸和位置均表示确定各组件在第二设备用户界面上的尺寸和位置。It should be noted that determining the size and position of each component above means determining the size and position of each component on the user interface of the second device.
由如图8所示的方法流程图可以看出,第二设备在实例化UI描述信息中最顶层的第一组件时,可以结合第二设备的屏幕的尺寸,来确定该第一组件的尺寸以及该第一组件的子组件的尺寸和位置。这样,可以使该第一组件及其子组件与第二设备的屏幕适配,并且可以使得这同一套UI描述信息适用于多种不同的设备。As can be seen from the method flowchart shown in Figure 8, when the second device instantiates the top-most first component in the UI description information, it can determine the size of the first component in conjunction with the size of the second device’s screen. And the size and position of the sub-components of the first component. In this way, the first component and its subcomponents can be adapted to the screen of the second device, and the same set of UI description information can be applied to multiple different devices.
当第二设备的屏幕为圆形时,除了根据图8所示的方法流程图来确定第一组件的尺寸和第一组件的子组件的尺寸和位置,第二设备还可以根据其他使得各组件适配圆形的屏幕的方法来确定各组件的尺寸和位置,本申请实施例对此不作限定。When the screen of the second device is circular, in addition to determining the size of the first component and the size and position of the sub-components of the first component according to the method flowchart shown in FIG. The method of adapting the circular screen to determine the size and position of each component is not limited in the embodiment of the present application.
当检测到第二设备的屏幕为其他形状(如矩形),第二设备可以根据现有技术中使得各组件适配该其他形状的屏幕的方法来确定各组件的尺寸和位置,本申请实施例对此不作赘述。When it is detected that the screen of the second device is of another shape (such as a rectangle), the second device can determine the size and position of each component according to the method of adapting each component to the screen of the other shape in the prior art. This embodiment of the present application I will not go into details about this.
此外,在上述确定第一组件的子组件的尺寸和位置的过程中,若第一组件不是UI描述信息中最顶层的第一组件,即该第一组件是某一个第一组件的子组件。则在实例化上述某一个第一组件时,第二设备已经确定了该第一组件的尺寸和位置。在实例化该第一组件时,第二设备可以确定该第一组件的子组件的尺寸和位置。具体的,根据该第一组件的尺寸、该第一组件的子组件期望的尺寸以及预先设定的规则(如子组件的宽高尽量匹配父组件的宽高、子组件的宽高尽量匹配子组件中内容的宽高),第二设备可以确定该第一组件的子组件的尺寸和位置。In addition, in the above process of determining the size and position of the subcomponent of the first component, if the first component is not the topmost first component in the UI description information, that is, the first component is a subcomponent of a certain first component. When instantiating one of the above-mentioned first components, the second device has already determined the size and position of the first component. When instantiating the first component, the second device can determine the size and position of the sub-components of the first component. Specifically, according to the size of the first component, the desired size of the child components of the first component, and preset rules (such as the width and height of the child component as much as possible to match the width and height of the parent component, and the width and height of the child component as far as possible to match the child The width and height of the content in the component), the second device can determine the size and position of the sub-component of the first component.
S203、第二设备识别UI描述信息中的第二组件。S203: The second device recognizes the second component in the UI description information.
仍以UI描述信息为上述第一UI描述信息进行说明。The description will still be made by taking the UI description information as the above-mentioned first UI description information.
当根据步骤S202对第一组件210进行实例化之后,第二设备(智能手表)可以进一步识别第一UI描述信息中第一组件210的各个子组件。若能识别到还未被实例化的组件,智能手表可以执行步骤S204。当智能手表未能识别到还未被实例化的组件,即该第一组件210的子组件均已被实例化,第二设备可以返回步骤S201,识别第一UI描述信息中的其他第一组件。After the first component 210 is instantiated according to step S202, the second device (smart watch) can further identify the sub-components of the first component 210 in the first UI description information. If a component that has not been instantiated can be identified, the smart watch can execute step S204. When the smart watch fails to identify a component that has not been instantiated, that is, the sub-components of the first component 210 have been instantiated, the second device can return to step S201 to identify other first components in the first UI description information .
S204、第二设备根据解析得到的第二组件的属性,利用组件库实例化第二组件。S204. The second device uses the component library to instantiate the second component according to the parsed attribute of the second component.
当识别到步骤S202中的第一组件的子组件,第二设备可以实例化这些子组件中为第二组件的子组件。即第二设备可以实例化内部不包含有其他组件的子组件。对于为第一组件的子组件,即内部包含有其他组件的子组件,第二设备可以在实例化所有为第二组件的子 组件后,根据步骤S201和步骤S202对为第一组件的子组件进行实例化,并进一步根据步骤S203和步骤S204对这些为第一组件的子组件内部包含的其他组件进行实例化。When identifying the sub-components of the first component in step S202, the second device may instantiate these sub-components as sub-components of the second component. That is, the second device can instantiate sub-components that do not contain other components. For the sub-components of the first component, that is, the sub-components that contain other components, the second device can instantiate all the sub-components of the second component and then compare the sub-components of the first component according to step S201 and step S202. Perform instantiation, and further instantiate other components contained in the sub-components that are the first component according to step S203 and step S204.
具体的,第二设备可以根据子组件的类型,从组件库中确定与该子组件对应的可执行的底层代码,并利用该组件的属性相关的数据初始化可执行的底层代码的数据部分。当运行经过初始化的可执行的底层代码,第二设备可以实例化该子组件,在经过步骤S202确定的该子组件的位置上显示该子组件。该子组件具有UI描述信息中描述该子组件的属性。例如,背景色为灰色、边框线条为黑色且粗细为2px的按钮。Specifically, the second device may determine the executable low-level code corresponding to the sub-component from the component library according to the type of the sub-component, and initialize the data part of the executable low-level code with data related to the attribute of the component. When running the initialized executable low-level code, the second device can instantiate the sub-component, and display the sub-component at the position of the sub-component determined in step S202. The sub-component has attributes that describe the sub-component in the UI description information. For example, a button with a background color of gray, a black border line, and a thickness of 2px.
当完成对一个子组件的实例化,第二设备可以执行步骤S203,识别包含这一个子组件的第一组件内部的其他未被实例化的子组件。第二设备可以循环执行步骤S203和步骤S204,直到该第一组件中所有为第二组件的子组件均被实例化。然后第二设备可以执行步骤S201,来识别UI描述信息中的其他第一组件。若未能识别到其他第一组件,则可以表示第二设备已将所有识别到的第一组件和第二组件均进行了实例化。这样,第二设备可以执行步骤S205。When the instantiation of a sub-component is completed, the second device may perform step S203 to identify other sub-components that are not instantiated in the first component including this sub-component. The second device may perform step S203 and step S204 in a loop until all subcomponents of the second component in the first component are instantiated. Then the second device can perform step S201 to identify other first components in the UI description information. If the other first components are not recognized, it may indicate that the second device has instantiated all the recognized first components and second components. In this way, the second device can execute step S205.
示例性的,若UI描述信息为上述第一UI描述信息,则第二设备(智能手表)可以先识别到头像组件211,并对该头像组件211进行实例化。该头像组件211的类型为图标,属性中包括期望尺寸以及关联的图片信息。智能手表可以根据图标这一类型从组件库中获取与图标对应的可执行的底层代码,并利用头像组件211的属性初始化可执行的底层代码中的数据部分。这样,智能手表就完成了对头像组件211的实例化。Exemplarily, if the UI description information is the aforementioned first UI description information, the second device (smart watch) may first recognize the avatar component 211 and instantiate the avatar component 211. The type of the avatar component 211 is an icon, and the attributes include a desired size and associated picture information. The smart watch can obtain the executable low-level code corresponding to the icon from the component library according to the type of the icon, and use the attributes of the avatar component 211 to initialize the data part of the executable low-level code. In this way, the smart watch completes the instantiation of the avatar component 211.
然后,智能手表可以返回步骤S203继续识别第一组件210中的子组件,如联系人组件212、挂断组件213和接听组件214。智能手表可以按照实例化头像组件211的方法对联系人组件212、挂断组件213和接听组件214进行实例化。Then, the smart watch may return to step S203 to continue to identify the sub-components in the first component 210, such as the contact component 212, the hang-up component 213, and the answer component 214. The smart watch can instantiate the contact component 212, the hanging up component 213, and the answering component 214 according to the method of instantiating the avatar component 211.
当未能识别到第一组件210中还未被实例化且为第二组件的子组件时,即第一组件210中为第二组件的子组件均被实例化,智能手表可以执行步骤S201,来识别第一UI描述信息中是否还存在其他未被实例化的第一组件。其中,上述未被实例化的第一组件可以包括任意第一组件中为第一组件的子组件。When it is not recognized that the first component 210 has not yet been instantiated and is a sub-component of the second component, that is, the sub-components of the second component in the first component 210 are all instantiated, the smart watch may perform step S201, To identify whether there are other first components that have not been instantiated in the first UI description information. Wherein, the aforementioned first component that is not instantiated may include any sub-component of the first component that is the first component.
由于上述第一UI描述信息中没有其他第一组件,智能手表可以执行步骤S205。Since there is no other first component in the above-mentioned first UI description information, the smart watch may execute step S205.
S205、第二设备判断UI描述信息是否解析完成。S205: The second device judges whether the UI description information is parsed.
当第二设备对UI描述信息中的各第一组件和各第二组件进行了实例化,即第二设备识别不到未被进行实例化的组件,第二设备可以判断UI描述信息是否解析完成。When the second device instantiates each first component and each second component in the UI description information, that is, the second device does not recognize the components that have not been instantiated, the second device can determine whether the UI description information has been parsed .
若UI描述信息解析完成,则第二设备可以确定该UI描述信息中各组件之间的逻辑关系,并执行步骤S206。If the analysis of the UI description information is completed, the second device can determine the logical relationship between the components in the UI description information, and execute step S206.
若UI描述信息解析未完成,则第二设备可以执行步骤S207,对UI描述信息作解析失败处理。其中,当UI描述信息中包含不可识别项,例如,未定义的标签或者不符合UI描述格式的UI描述信息等,第二设备不能完成UI描述信息的解析。If the resolution of the UI description information is not completed, the second device may perform step S207 to perform the resolution failure processing on the UI description information. Wherein, when the UI description information contains unrecognizable items, such as undefined tags or UI description information that does not conform to the UI description format, the second device cannot complete the analysis of the UI description information.
S206、第二设备显示实例化的第一组件和第二组件。S206. The second device displays the instantiated first component and the second component.
第二设备显示实例化的第一组件和第二组件的方法可以参考步骤S108,这里不再赘述。For the method for the second device to display the instantiated first component and the second component, refer to step S108, which will not be repeated here.
需要进行说明的是,在一些实施例中,在实例化UI描述信息中的各组件或者在显示UI描述信息中的各组件之前,第二设备可以根据预先设定的过滤规则,将UI描述信息中的一部分组件过滤掉。第二设备可以在用户界面上显示UI描述信息中未被过滤掉的组件。 上述过滤规则可以用于过滤对于各种应用场景下不重要的组件。例如,不能响应输入事件的组件或者未绑定数据的组件等。本申请实施例对上述过滤规则不作具体限定。It should be noted that, in some embodiments, before instantiating each component in the UI description information or before displaying each component in the UI description information, the second device may change the UI description information according to a preset filtering rule. Part of the components in the filter are filtered out. The second device may display the components that are not filtered out in the UI description information on the user interface. The above filtering rules can be used to filter components that are not important for various application scenarios. For example, components that cannot respond to input events or components that are not bound to data, etc. The embodiments of the present application do not specifically limit the foregoing filtering rules.
示例性的,上述第一UI描述信息中包含第一组件210、头像组件211、联系人组件212、挂断组件213和接听组件214。当第二设备(智能手表)接收到第一UI描述信息,智能手表可以结合自己屏幕尺寸的大小,根据过滤规则过滤掉头像组件211。这样,智能手表可以显示如图6C所示的用户界面31。用户界面31中显示有第一组件210、联系人组件212、挂断组件213和接听组件214。Exemplarily, the foregoing first UI description information includes a first component 210, an avatar component 211, a contact component 212, a hang-up component 213, and an answer component 214. When the second device (smart watch) receives the first UI description information, the smart watch can filter out the avatar component 211 according to the filter rule based on the size of its own screen. In this way, the smart watch can display the user interface 31 as shown in FIG. 6C. The user interface 31 displays a first component 210, a contact component 212, a hang-up component 213, and an answer component 214.
S207、第二设备对UI描述信息作解析失败处理。S207. The second device performs a parsing failure process on the UI description information.
上述解析失败处理可以为,第二设备在用户界面上显示解析失败的信息等。本申请实施例对解析失败处理的方法不作具体限定。The foregoing analysis failure processing may be that the second device displays information about the analysis failure on the user interface, etc. The embodiment of the present application does not specifically limit the method for processing the analysis failure.
在另一种实现方式中,第二设备实例化UI描述信息中各组件的顺序可以为该UI描述信息中描述这些组件的顺序。以图6A所示的用户界面21的UI描述信息为例进行说明。该UI描述信息中对这些组件进行描述的先后顺序分别为:第一组件210、头像组件211、联系人组件212、挂断组件213和接听组件214。那么,第二设备可以按照上述先后顺序实例化这些组件,并在用户界面上显示。In another implementation manner, the order in which the second device instantiates the components in the UI description information may be the order in which these components are described in the UI description information. Take the UI description information of the user interface 21 shown in FIG. 6A as an example for description. The order of describing these components in the UI description information is: the first component 210, the avatar component 211, the contact component 212, the hanging up component 213, and the answering component 214, respectively. Then, the second device can instantiate these components in the above sequence and display them on the user interface.
在另一种实现方式中,第二设备实例化UI描述信息中各组件的顺序可以由该UI描述信息中各组件的优先级顺序决定。其中,UI描述信息中各组件的优先级顺序可以为预先设定的。仍以图6A所示的用户界面21的UI描述信息为例进行说明。该UI描述信息中各组件的优先级顺序可以为:第一组件210的优先级最高;挂断组件213和接听组件214的优先级相同,且低于第一组件210的优先级;联系人组件212的优先级低于挂断组件213和接听组件214的优先级;头像组件211的优先级低于联系人组件212的优先级。那么,第二设备可以先实例化第一组件210,然后实例化挂断组件213和接听组件214,再实例化联系人组件212,最后实例化头像组件,并按照上述实例化的顺序在用户界面上逐一显示这些组件。其中,若第二设备的屏幕大小有限,第二设备可以根据自身屏幕的大小显示优先级顺序较高的组件。如图6C所示,由于第二设备(智能手表)的屏幕较小,第二设备可以不在用户界面上显示上述优先级最低的头像组件211。In another implementation manner, the order in which the second device instantiates the components in the UI description information may be determined by the priority order of the components in the UI description information. The priority order of the components in the UI description information can be preset. Still taking the UI description information of the user interface 21 shown in FIG. 6A as an example for description. The priority order of the components in the UI description information can be: the first component 210 has the highest priority; the hang-up component 213 and the answer component 214 have the same priority and are lower than the priority of the first component 210; contact component The priority of 212 is lower than the priority of the hanging up component 213 and the answering component 214; the priority of the avatar component 211 is lower than the priority of the contact component 212. Then, the second device can first instantiate the first component 210, then instantiate the hang-up component 213 and the answer component 214, then instantiate the contact component 212, and finally instantiate the avatar component, and display it in the user interface in the order of the above instantiations. These components are shown one by one. Wherein, if the screen size of the second device is limited, the second device may display components with a higher priority order according to the size of its own screen. As shown in FIG. 6C, since the screen of the second device (smart watch) is small, the second device may not display the above-mentioned avatar component 211 with the lowest priority on the user interface.
本申请实施例对UI描述信息中各组件的优先级顺序不作限定。The embodiment of the present application does not limit the priority order of the components in the UI description information.
需要进行说明的是,上述根据UI描述信息中描述组件的顺序和根据UI描述信息中各组件的优先级顺序来决定实例化组件的顺序的实现方式中,第二设备可以判断UI描述信息是否解析完成,然后根据解析完成的结果决定是进行解析失败处理还是在用户界面上显示经过实例化的组件。上述判断UI描述信息是否解析完成、解析失败处理和显示经过实例化的组件的具体实现过程可以参考图7所示的方法实施例中的步骤S205~S207,这里不再赘述。It should be noted that, in the foregoing implementation of determining the order of instantiating components according to the order of the components described in the UI description information and the priority order of the components in the UI description information, the second device can determine whether the UI description information is parsed Complete, and then decide whether to perform the analysis failure processing or display the instantiated component on the user interface according to the result of the completion of the analysis. For the specific implementation process of judging whether the UI description information is parsed, the parsing failure processing, and displaying the instantiated components can refer to steps S205 to S207 in the method embodiment shown in FIG. 7, which will not be repeated here.
下面介绍UI描述信息中的组件可以适配设备屏幕的实施例。The following describes an embodiment in which the components in the UI description information can be adapted to the device screen.
当检测到作用于主界面710中联系人图标715C的用户操作,第一设备(手机)可以显示如图9A所示的用户界面810。用户界面810中可包括联系人列表组件811以及字母索引 组件812。其中,联系人列表组件811中可指示包含存储在手机中的各联系人的联系方式(如电话号码、邮件)。各联系人的联系方式可以根据联系人名称的首字母按照字母表的顺序进行排列。字母索引组件812中可包含字母表的26个字母,可以用于根据其中一个字母查找名称的首字母为这一个字母的联系人。字母索引组件812中的各字母可以按照字母表的顺序竖直排列。本申请实施例对用户界面810中包含的组件不作限定。When a user operation acting on the contact icon 715C in the main interface 710 is detected, the first device (mobile phone) may display the user interface 810 as shown in FIG. 9A. The user interface 810 may include a contact list component 811 and an alphabetic index component 812. Wherein, the contact list component 811 may indicate the contact information (such as phone number, email) of each contact stored in the mobile phone. The contact information of each contact can be arranged in alphabetical order according to the first letter of the contact's name. The letter index component 812 can contain 26 letters of the alphabet, and can be used to find a contact whose name is the first letter based on one of the letters. The letters in the letter index component 812 can be arranged vertically in the order of the alphabet. The embodiment of the present application does not limit the components included in the user interface 810.
手机可以向第二设备(智能手表)发送用户界面810的UI描述信息。智能手表的屏幕为圆形。当接收到用户界面810的UI描述信息,智能手表可以按照图7和图8所示的方法流程图解析该UI描述信息,并显示如图9B所示的用户界面820。用户界面820中可包括字母索引组件821和联系人查看组件822。其中,字母索引组件821中可包含字母表的26个字母,可以用于根据其中一个字母查找名称的首字母为这一个字母的联系人。例如,响应于作用在字母索引组件821中字母B的用户操作,智能手表可以在联系人查看组件822中显示联系人“爸爸”。进一步的,当检测到作用于联系人查看组件822中“爸爸”的用户操作,智能手表可以在联系人查看组件822中显示联系人“爸爸”的联系方式(如电话号码、邮件)。The mobile phone can send the UI description information of the user interface 810 to the second device (smart watch). The screen of the smart watch is circular. When receiving the UI description information of the user interface 810, the smart watch can parse the UI description information according to the method flowcharts shown in FIGS. 7 and 8 and display the user interface 820 as shown in FIG. 9B. The user interface 820 may include a letter index component 821 and a contact viewing component 822. Among them, the letter index component 821 can contain 26 letters of the alphabet, and can be used to find a contact whose name is the first letter based on one of the letters. For example, in response to a user operation acting on the letter B in the letter index component 821, the smart watch may display the contact “Dad” in the contact viewing component 822. Further, when a user operation acting on "Dad" in the contact viewing component 822 is detected, the smart watch can display the contact information (such as phone number, email) of the contact "Dad" in the contact viewing component 822.
由于智能手表的屏幕为圆形,智能手表可以将字母索引组件821中的各字母按照环形排列的方式显示在用户界面820上。不限于上述环形排列的方式,字母索引组件821中的各字母还可以按照其他与智能手表屏幕适配的方法显示在用户界面820上。Since the screen of the smart watch is circular, the smart watch can display the letters in the letter index component 821 on the user interface 820 in a circular arrangement. Not limited to the above-mentioned circular arrangement, the letters in the letter index component 821 may also be displayed on the user interface 820 according to other methods adapted to the smart watch screen.
当检测到作用于主界面710中运动健康图标714A的用户操作,第一设备(手机)可以显示如图10A所示的用户界面830。用户界面830中可包括户外跑步组件831、登山组件832、自行车组件833、游泳组件834以及步行组件835。其中,上述户外跑步组件831、登山组件832、自行车组件833、游泳组件834以及步行组件835可以分别用于查看用户户外跑步、登山、自行车运动、游泳以及步行的锻炼记录。这些组件可以按照竖直列表的排列方式显示在用户界面830中。用户界面830中可包含更多或更少的指示用户的锻炼记录的组件,本申请实施例对此不作限定。When a user operation acting on the sports health icon 714A in the main interface 710 is detected, the first device (mobile phone) may display a user interface 830 as shown in FIG. 10A. The user interface 830 may include an outdoor running component 831, a mountaineering component 832, a bicycle component 833, a swimming component 834, and a walking component 835. Among them, the outdoor running component 831, mountaineering component 832, bicycle component 833, swimming component 834, and walking component 835 can be used to view the user's outdoor running, climbing, cycling, swimming, and walking exercise records, respectively. These components may be displayed in the user interface 830 in a vertical list arrangement. The user interface 830 may include more or fewer components indicating the user's exercise record, which is not limited in the embodiment of the present application.
手机可以向第二设备(智能手表)发送用户界面830的UI描述信息。智能手表的屏幕为圆形。当接收到用户界面830的UI描述信息,智能手表可以按照图7和图8所示的方法流程图解析该UI描述信息,并显示如图10B所示的用户界面840。用户界面840中可包括户外跑步组件841以及登山组件842等指示用户锻炼记录的组件。The mobile phone can send the UI description information of the user interface 830 to the second device (smart watch). The screen of the smart watch is circular. When receiving the UI description information of the user interface 830, the smart watch can parse the UI description information according to the method flowcharts shown in FIGS. 7 and 8 and display the user interface 840 as shown in FIG. 10B. The user interface 840 may include an outdoor running component 841, a mountain climbing component 842 and other components that indicate the user's exercise record.
由于智能手表的屏幕为圆形,智能手表可以将户外跑步组件841以及登山组件842等组件按照弧形列表的排列方式显示在用户界面840中。不限于上述弧形列表的排列方式,各指示用户锻炼记录的组件还可以按照其他与智能手表屏幕适配的方法显示在用户界面840上。Since the screen of the smart watch is circular, the smart watch can display components such as the outdoor running component 841 and the mountain climbing component 842 in the user interface 840 in an arc-shaped list arrangement. It is not limited to the above-mentioned arrangement of the arc-shaped list, and each component indicating the user's exercise record may also be displayed on the user interface 840 according to other methods adapted to the smart watch screen.
第一设备可以将一个应用场景中涉及的多套UI描述信息一次性全部发送给第二设备。The first device may send multiple sets of UI description information involved in one application scenario to the second device all at once.
在一个多设备交互的应用场景中可能涉及到多套UI描述信息。例如,在接收到来电通知的应用场景中,第一设备向第二设备发送的UI描述信息至少可以包括与用户界面21和用户界面22对应的第一UI描述信息和第二UI描述信息。In a multi-device interaction application scenario, multiple sets of UI description information may be involved. For example, in an application scenario of receiving an incoming call notification, the UI description information sent by the first device to the second device may at least include the first UI description information and the second UI description information corresponding to the user interface 21 and the user interface 22.
在一些实施例中,第一设备可以将一个交互应用场景中涉及的多套UI描述信息一次性全部发送给第二设备。当检测到输入事件并更新用户界面时,第二设备可以在存储的多套UI描述信息中搜索,确定与更新的用户界面对应的UI描述信息。In some embodiments, the first device may send multiple sets of UI description information involved in an interactive application scenario to the second device all at once. When an input event is detected and the user interface is updated, the second device can search multiple sets of stored UI description information to determine the UI description information corresponding to the updated user interface.
仍以接收到来电通知的应用场景为例进行说明。The application scenario of receiving incoming call notification is still taken as an example for description.
如图6A和图6D所示,当接收到来电通知,第一设备(手机)可以显示用户界面21。手机可以向第二设备(智能手表)发送在接收到来电通知的应用场景中涉及的全部UI描述信息。这全部UI描述信息可以包括与用户界面21对应的第一UI描述信息和与用户界面22对应的第二UI描述信息等。As shown in FIGS. 6A and 6D, when receiving an incoming call notification, the first device (mobile phone) may display the user interface 21. The mobile phone can send all UI description information involved in the application scenario of receiving the incoming call notification to the second device (smart watch). All the UI description information may include the first UI description information corresponding to the user interface 21, the second UI description information corresponding to the user interface 22, and so on.
当接收到全部UI描述信息,智能手表可以从中搜索第一UI描述信息。智能手表可以运行服务程序,解析第一UI描述信息,在如图6C所示的用户界面31上显示第一UI描述信息所描述的组件。When all UI description information is received, the smart watch can search for the first UI description information. The smart watch can run a service program, parse the first UI description information, and display the components described by the first UI description information on the user interface 31 as shown in FIG. 6C.
当检测到输入事件,智能手表可以确定与该输入事件关联的组件。例如,当确定与输入事件关联的组件为挂断组件312,智能手表可以从全部UI描述信息中搜索第二UI描述信息。第二UI描述信息可以描述如图6D所示的指示挂断电话的用户界面22中的各组件。此外,智能手表还可以向手机反馈挂断电话的指令。当接收到该挂断电话的指令,手机可以利用用于移动通信的模块向基站发送指令来挂断电话。When an input event is detected, the smart watch can determine the component associated with the input event. For example, when it is determined that the component associated with the input event is the hang-up component 312, the smart watch can search for the second UI description information from all the UI description information. The second UI description information may describe various components in the user interface 22 for instructing to hang up the phone as shown in FIG. 6D. In addition, the smart watch can also feed back the instruction to hang up the phone to the mobile phone. When receiving the instruction to hang up the phone, the mobile phone can use the module for mobile communication to send an instruction to the base station to hang up the phone.
由上述实施例可以看出,第二设备可以存储某一个应用场景中涉及的全部UI描述信息,并在检测到输入事件时,根据与该输入事件关联的组件自动搜索UI描述信息。这样,对第二设备与第一设备的通信连接要求不高,减少了因为第一设备与第二设备之间的通信连接断开而导致的第二设备无法及时响应输入事件的情况。It can be seen from the foregoing embodiment that the second device can store all UI description information involved in a certain application scenario, and when an input event is detected, it automatically searches for the UI description information according to the component associated with the input event. In this way, the requirement for the communication connection between the second device and the first device is not high, which reduces the situation that the second device cannot respond to the input event in time due to the disconnection of the communication connection between the first device and the second device.
第一设备可以将一个应用场景中涉及的多套UI描述信息分次发送给第二设备。The first device may send multiple sets of UI description information involved in one application scenario to the second device in stages.
在一些实施例中,第一设备可以将一个应用场景中涉及到多套UI描述信息分次发送给第二设备。即当第二设备检测到输入事件并根据该输入事件更新用户界面时,第一设备可以将与更新的用户的界面对应的那一套UI描述信息发送给第二设备。In some embodiments, the first device may send multiple sets of UI description information involved in an application scenario to the second device in stages. That is, when the second device detects an input event and updates the user interface according to the input event, the first device may send the set of UI description information corresponding to the updated user interface to the second device.
仍以接收到来电通知的应用场景为例进行说明。The application scenario of receiving incoming call notification is still taken as an example for description.
如图5中所示的多设备交互的方法流程图所示,在步骤S102和步骤S103中,当第一设备(手机)接收到来电通知,手机可以显示如图6A所示的用户界面21,并向第二设备(智能手表)发送第一UI描述信息。该第一UI描述信息可用于描述用户界面21中各组件的属性。当接收到第一UI描述信息,智能手表可以显示如图6C所示的用户界面31。As shown in the flowchart of the method for multi-device interaction shown in FIG. 5, in step S102 and step S103, when the first device (mobile phone) receives an incoming call notification, the mobile phone can display the user interface 21 as shown in FIG. 6A, And send the first UI description information to the second device (smart watch). The first UI description information can be used to describe the attributes of each component in the user interface 21. When the first UI description information is received, the smart watch may display the user interface 31 as shown in FIG. 6C.
当检测到作用在用户界面31中果断组件312上的用户操作,智能手表可以向手机发送指示挂断电话的指令。然后在步骤S111和步骤S112中,手机可以显示如图6D所示的用户界面22,利用手机中用于移动通信的模块向基站发送挂断电话的指令,并向智能手表发送第二UI描述信息。该第二UI描述信息可用于描述用户界面22中各组件的属性。当接收到第二UI描述信息,智能手表可以显示如图6E所示的用户界面32。When a user operation on the decisive component 312 in the user interface 31 is detected, the smart watch can send an instruction to hang up the phone to the mobile phone. Then in step S111 and step S112, the mobile phone can display the user interface 22 as shown in FIG. 6D, use the mobile communication module in the mobile phone to send an instruction to hang up the phone to the base station, and send the second UI description information to the smart watch . The second UI description information can be used to describe the attributes of each component in the user interface 22. When receiving the second UI description information, the smart watch may display the user interface 32 as shown in FIG. 6E.
由上述实施例可以看出,在第一设备与第二设备交互的应用场景中,第二设备可以不存储全部UI描述信息,只需要解析来自第一设备的UI描述信息。并且第二设备可以只向第一设备反馈检测到的输入事件,不用实际处理业务。这样,对第二设备的存储空间和处 理能力要求不高,可以减少第二设备的负担。It can be seen from the foregoing embodiment that in an application scenario where the first device interacts with the second device, the second device may not store all UI description information, but only needs to parse the UI description information from the first device. And the second device can only feed back the detected input event to the first device without actually processing services. In this way, the storage space and processing capability of the second device are not high requirements, and the burden on the second device can be reduced.
第一设备可以响应用户操作选择进行交互的第二设备。The first device may select a second device for interaction in response to a user operation.
在一些实施例中,当第一设备运行第一应用程序,且检测到与被用户选择的第二设备进行交互的指令时,第一设备可以向被用户选择的第二设备发送第一应用程序中用户界面的UI描述信息。In some embodiments, when the first device runs the first application and detects an instruction to interact with the second device selected by the user, the first device may send the first application to the second device selected by the user UI description information of the user interface in the.
图11A~图11C示出了一些多设备交互的应用场景示意图。其中,第一设备为手机,第二设备为智能手表或者平板。11A to 11C show schematic diagrams of some application scenarios of multi-device interaction. Among them, the first device is a mobile phone, and the second device is a smart watch or a tablet.
当运行应用程序音乐播放器时,手机可以显示如图11A所示的音乐播放界面。该音乐播放界面可以包括第一组件410,第一组件410中可以包含联动控制组件411、歌曲信息组件412、专辑封面组件413、歌词组件414、进度条组件415、播放模式组件416、上一首组件417、暂停组件418、下一首组件419和音量组件4110。When the application music player is running, the mobile phone can display the music playing interface as shown in FIG. 11A. The music playing interface may include a first component 410, which may include a linkage control component 411, a song information component 412, an album cover component 413, a lyrics component 414, a progress bar component 415, a play mode component 416, and a previous song. Component 417, pause component 418, next song component 419, and volume component 4110.
其中,联动控制组件411可用于手机与第二设备进行交互。响应于作用在联动控制组件411的用户操作,例如触摸操作,手机可以搜索与手机建立有通信连接的设备,并显示如图11B所示的用户界面。该用户界面包含有第一组件420。第一组件420中可以包含指示设备选项的组件,例如智能手表组件421和平板组件422。第一组件420中包含的设备选项对应的设备为与手机建立有通信连接的设备。Among them, the linkage control component 411 can be used for interaction between the mobile phone and the second device. In response to a user operation on the linkage control component 411, such as a touch operation, the mobile phone can search for devices that have established a communication connection with the mobile phone, and display a user interface as shown in FIG. 11B. The user interface includes a first component 420. The first component 420 may include components indicating device options, such as a smart watch component 421 and a tablet component 422. The device corresponding to the device option included in the first component 420 is a device that has established a communication connection with a mobile phone.
响应于作用在智能手表组件421上的用户操作,例如触摸操作,手机可以向智能手表发送UI描述信息。该UI描述信息中可以包含有对联动控制组件411、歌曲信息组件412、专辑封面组件413、歌词组件414、进度条组件415、播放模式组件416、上一首组件417、暂停组件418、下一首组件419和音量组件4110的属性的描述。In response to a user operation on the smart watch component 421, such as a touch operation, the mobile phone may send UI description information to the smart watch. The UI description information can include the linkage control component 411, the song information component 412, the album cover component 413, the lyrics component 414, the progress bar component 415, the play mode component 416, the previous song component 417, the pause component 418, and the next A description of the attributes of the header component 419 and the volume component 4110.
当接收到UI描述信息,智能手表可以按照图5所示的步骤S105~S108,解析UI描述信息,利用组件库实例化UI描述信息中的组件,并在用户界面上显示如图11C所示的各组件。其中图11C所示的用户界面中可包含歌曲信息组件431、上一首组件432、暂停组件433、下一首组件434、播放模式组件435和音量组件436。When receiving the UI description information, the smart watch can parse the UI description information according to steps S105 to S108 shown in Figure 5, instantiate the components in the UI description information using the component library, and display on the user interface as shown in Figure 11C The components. The user interface shown in FIG. 11C may include a song information component 431, a previous song component 432, a pause component 433, a next song component 434, a play mode component 435, and a volume component 436.
本申请实施例对上述音乐播放界面不作限定,音乐播放界面还可以包含更多或更少的组件。The embodiment of the present application does not limit the foregoing music playing interface, and the music playing interface may also include more or fewer components.
上述第一设备响应用户操作选择进行交互的第二设备的实施例可以与前述图5所示的方法实施例相结合。例如,在图5所示的方法实施例中,当第一设备执行步骤S102,显示第一用户界面,第一设备可以在接收到用于确定第二设备的用户操作后,执行步骤S103,向该第二设备发送第一UI描述信息。该第一UI描述信息用于描述第一用户界面中各组件的属性。The foregoing embodiment of the second device that the first device selects to interact in response to the user's operation may be combined with the foregoing method embodiment shown in FIG. 5. For example, in the method embodiment shown in FIG. 5, when the first device performs step S102 and displays the first user interface, the first device may perform step S103 after receiving a user operation for determining the second device The second device sends the first UI description information. The first UI description information is used to describe the attributes of each component in the first user interface.
第一设备可以智能选择进行交互的第二设备。The first device can intelligently select the second device to interact with.
在一些实施例中,当第一设备运行第一应用程序,且检测到多个设备与第一设备建立有通信连接,第一设备可以根据与第一设备之间距离的远近或者这多个设备之间的优先级顺序等方式来确定与之进行交互的第二设备。也即是说,第一设备可以从多个与之建立有通信连接的设备中选择距离最近的一个设备作为第二设备,然后向该被选择的第二设备发 送第一应用程序中用户界面的UI描述信息。或者,多个与第一设备建立有通信连接的设备之间有优先级顺序。第一设备可以选择优先级最高的设备作为第二设备,然后向该被选择的第二设备发送第一应用程序中用户界面的UI描述信息。In some embodiments, when the first device runs the first application and detects that multiple devices have established a communication connection with the first device, the first device can be based on the distance between the first device or the multiple devices. The second device interacts with it in such a way as the priority order. In other words, the first device can select the closest device from a plurality of devices with which it has established a communication connection as the second device, and then send the user interface information in the first application to the selected second device. UI description information. Or, there is a priority order among multiple devices that have established a communication connection with the first device. The first device may select the device with the highest priority as the second device, and then send the UI description information of the user interface in the first application to the selected second device.
示例性的,在用户开车收到来电通知的应用场景中,第一设备可以为手机。其中,智能汽车和用户佩戴的智能手表均与手机建立有通信连接,且在该应用场景中,智能汽车的优先级高于智能手表的优先级。当手机收到来电通知,手机可以向优先级更高的智能汽车发送如图6A所示的来电通知界面的UI描述信息。智能汽车可以解析该来电通知界面的UI描述信息,并在车载电脑上显示该UI描述信息中的各组件。并且,车载电脑可以响应用户操作(例如触摸操作,声控操作)来接听电话。车载电脑响应用户操作来接听电话的实现方式可以参考图5所示方法实施例中的步骤S109~S114。Exemplarily, in an application scenario where a user receives an incoming call notification while driving, the first device may be a mobile phone. Among them, both the smart car and the smart watch worn by the user have established a communication connection with the mobile phone, and in this application scenario, the priority of the smart car is higher than the priority of the smart watch. When the mobile phone receives the incoming call notification, the mobile phone can send the UI description information of the incoming call notification interface as shown in FIG. 6A to the smart car with higher priority. The smart car can parse the UI description information of the incoming call notification interface, and display the components in the UI description information on the onboard computer. In addition, the on-board computer can answer calls in response to user operations (such as touch operations, voice control operations). For the implementation of the onboard computer answering the phone in response to the user's operation, reference may be made to steps S109 to S114 in the method embodiment shown in FIG. 5.
上述第一设备智能选择进行交互的第二设备的实施例可以与前述图5所示的方法实施例相结合。例如,在图5所示的方法实施例中,当第一设备执行步骤S102,显示第一用户界面,第一设备可以根据与第一设备之间距离的远近或者这多个设备之间的优先级顺序等方式来确定与之进行交互的第二设备,然后执行步骤S103,向该第二设备发送第一UI描述信息。该第一UI描述信息用于描述第一用户界面中各组件的属性。The foregoing embodiment in which the first device intelligently selects the second device for interaction may be combined with the foregoing method embodiment shown in FIG. 5. For example, in the method embodiment shown in FIG. 5, when the first device executes step S102 and displays the first user interface, the first device can be based on the distance to the first device or the priority between the multiple devices. The second device to interact with is determined by means of level sequence, etc., and then step S103 is executed to send the first UI description information to the second device. The first UI description information is used to describe the attributes of each component in the first user interface.
本申请实施例对上述第一设备确定进行交互的第二设备的方式不作限定,除了通过接收用于确定第二设备的用户操作的方式或上述智能选择的方式,第一设备还可以通过其他方式确定进行交互的第二设备。The embodiment of the present application does not limit the manner in which the first device determines the second device to interact with. In addition to the manner of receiving user operations for determining the second device or the manner of smart selection, the first device may also use other methods. Determine the second device to interact with.
下面介绍一种开发多设备交互系统的结构示意图。The following introduces a schematic diagram of the development of a multi-device interactive system.
图12示出了一种开发多设备交互系统的结构示意图。如图12所示,该开发多设备交互系统的结构中可以包括工作站510、云端520、第一设备530和第二设备540。其中:Figure 12 shows a schematic diagram of the development of a multi-device interaction system. As shown in FIG. 12, the structure for developing a multi-device interaction system may include a workstation 510, a cloud 520, a first device 530, and a second device 540. in:
工作站510是开发人员(如设计师、程序员)的开发环境。工作站可以包括模拟器511和设计器512。The workstation 510 is a development environment for developers (such as designers and programmers). The workstation may include a simulator 511 and a designer 512.
设计器512可用于生成UI描述信息。设计器512可以包含文本编辑器以及可视化拖拽组件。上述文本编辑器可用于通过编写文本的方式生成UI描述信息。该UI描述信息符合UI描述格式。上述可视化拖拽组件可被拖拽、更改背景色和边框线条等属性,以可视化用户界面的方式生成UI描述信息。The designer 512 can be used to generate UI description information. The designer 512 may include a text editor and a visual drag-and-drop component. The above text editor can be used to generate UI description information by writing text. The UI description information conforms to the UI description format. The above-mentioned visual drag-and-drop component can be dragged, change attributes such as background color and border line, and generate UI description information in a visual user interface manner.
即开发人员可以利用设计器以编写文本的方式或拖拽可视化拖拽组件的方式,来生成UI描述信息。That is, developers can use the designer to generate UI description information by writing text or dragging and dropping visual components.
除了上述编写文本的方式和拖拽可视化拖拽组件的方式,设计器512还可以通过其他方式生成UI描述信息。例如,设计器512可以通过接收开发人员输入的用户界面的设计稿的方式,生成UI描述信息。本申请实施例对此不作限定。In addition to the way of writing text and the way of dragging and dropping visualized components, the designer 512 may also generate UI description information in other ways. For example, the designer 512 may generate UI description information by receiving a user interface design draft input by a developer. The embodiment of the application does not limit this.
当生成UI描述信息,设计器512可以将UI描述信息发送给模拟器511。When the UI description information is generated, the designer 512 may send the UI description information to the simulator 511.
模拟器511可用于模拟目标设备(如第一设备或第二设备)的输出模块和输入模块。例如,模拟器511可以模拟智能手表的屏幕以及用于响应输入事件(如用户的触摸操作、输入文本操作)的输入模块(如触摸传感器、键盘等)。The simulator 511 can be used to simulate the output module and the input module of the target device (such as the first device or the second device). For example, the simulator 511 can simulate the screen of a smart watch and an input module (such as a touch sensor, a keyboard, etc.) for responding to an input event (such as a user's touch operation and a text input operation).
模拟器511可以提供与目标设备相同的二进制接口。即开发人员可以将模拟器视为目标设备,以检验UI描述信息中的各组件在目标设备屏幕上显示的结果能否达到预期效果,以及当检测到输入事件时,与输入事件关联的组件是否能进行响应。The simulator 511 can provide the same binary interface as the target device. That is, developers can regard the simulator as the target device to verify whether the results displayed on the screen of the target device of each component in the UI description can achieve the expected effect, and whether the component associated with the input event is detected when an input event is detected. Able to respond.
模拟器511可包含服务程序511a和虚拟机/脚本引擎511b。The simulator 511 may include a service program 511a and a virtual machine/script engine 511b.
其中,服务程序511a可用于加载解析UI描述信息。当接收到UI描述信息,模拟器511可运行服务程序511a,得到UI描述信息中各组件的属性。根据组件的属性中的类型,模拟器511可以在组件库中获取与组件对应的可执行的底层代码,并利用组件的属性初始化可执行的底层代码的数据部分。当运行经过初始化的可执行的底层代码,模拟器511可以实例化各组件,并根据各组件之间的逻辑关系在用户界面上显示UI描述信息中的各组件。Among them, the service program 511a can be used to load and parse the UI description information. When receiving the UI description information, the simulator 511 can run the service program 511a to obtain the attributes of each component in the UI description information. According to the type in the attribute of the component, the simulator 511 can obtain the executable low-level code corresponding to the component in the component library, and initialize the data part of the executable low-level code by using the attribute of the component. When running the initialized executable low-level code, the simulator 511 can instantiate each component, and display each component in the UI description information on the user interface according to the logical relationship between the components.
上述组件库可以为预置在模拟器中,或者,可以随UI描述信息一起发送到模拟器中。本申请实施例对模拟器获取组件库的方式不作限定。The aforementioned component library may be preset in the simulator, or may be sent to the simulator along with the UI description information. The embodiment of the present application does not limit the manner in which the simulator obtains the component library.
当检测到作用在模拟器511上的输入事件,模拟器511可以运行服务程序,来确定与该输入事件关联的组件,并搜索与更新的用户界面对应的UI描述信息。模拟器511可以解析上述与更新的用户界面对应的UI描述信息,并在用户界面上显示UI描述信息中的各组件。这样,开发人员就可以在模拟器上检验当第二设备检测到输入事件时,第二设备对该输入事件的响应是否达到预期效果。When an input event acting on the simulator 511 is detected, the simulator 511 can run a service program to determine the component associated with the input event, and search for UI description information corresponding to the updated user interface. The simulator 511 can parse the aforementioned UI description information corresponding to the updated user interface, and display each component in the UI description information on the user interface. In this way, the developer can check on the simulator whether the second device's response to the input event reaches the expected effect when the second device detects the input event.
在一些实施例中,UI描述信息中可以接入脚本或字节码。模拟器511在运行服务程序来解析UI描述信息时,可以将这些脚本或字节码提取出来并送入虚拟机/脚本引擎511b。In some embodiments, a script or bytecode can be inserted into the UI description information. When the simulator 511 runs the service program to parse the UI description information, it can extract these scripts or bytecodes and send them to the virtual machine/script engine 511b.
虚拟机/脚本引擎511a可以表示模拟器51中可只包含有虚拟机、只包含有脚本引擎、包含有虚拟机和脚本引擎或者包含有基于虚拟机的脚本引擎。其中,虚拟机可用于执行字节码。脚本引擎可用于执行脚本。若脚本或字节码中包含对用户界面的各组件的描述,虚拟机/脚本引擎511a可以调用组件库,从组件库中获取并执行可执行的底层代码来实例化各组件。若脚本或字节码中包含了对处理输入事件的描述,则当检测到输入事件时,模拟器511可以在虚拟机/脚本引擎511b中执行描述该输入事件的脚本或字节码。The virtual machine/script engine 511a may indicate that the simulator 51 may include only a virtual machine, only a script engine, a virtual machine and a script engine, or a script engine based on a virtual machine. Among them, the virtual machine can be used to execute bytecode. The script engine can be used to execute scripts. If the script or bytecode contains a description of each component of the user interface, the virtual machine/script engine 511a can call the component library, obtain and execute executable low-level code from the component library to instantiate each component. If the script or bytecode contains a description of processing input events, when an input event is detected, the simulator 511 can execute the script or bytecode describing the input event in the virtual machine/script engine 511b.
需要进行说明的是,脚本或字节码是可执行的程序。虚拟机/脚本引擎511a在执行脚本或字节码时,可以在模拟器内存中被隔离的空间内执行,并对脚本或字节码所要求的各种权限进行控制,还可以捕获并处理在运行时出现的异常情况。这样,可以降低脚本或字节码在执行时可能存在的风险。It should be noted that scripts or bytecodes are executable programs. When the virtual machine/script engine 511a executes a script or bytecode, it can be executed in an isolated space in the simulator memory, and can control various permissions required by the script or bytecode. It can also capture and process Abnormal conditions during operation. In this way, the risks that may exist when the script or bytecode is executed can be reduced.
工作站510还可以包含更多内容,本申请实施例对此不作限定。The workstation 510 may also contain more content, which is not limited in the embodiment of the present application.
当生成UI描述信息,设计器512可以将UI描述信息上传至云端520。When the UI description information is generated, the designer 512 may upload the UI description information to the cloud 520.
云端520可以用于存储UI描述信息以及应用程序等。云端520可以为内容服务器、应用市场等。The cloud 520 may be used to store UI description information and application programs. The cloud 520 may be a content server, an application market, and so on.
第一设备530中可以包含有UI描述信息。该UI描述信息可以为预置的,也可以为通过下载包含有UI描述信息的应用程序得到的。其中第一设备可以从工作站510中的设计器512下载应用程序,或者从云端520中下载应用程序。应用程序中可包含有UI描述信息。The first device 530 may include UI description information. The UI description information may be preset or obtained by downloading an application that contains the UI description information. The first device can download the application program from the designer 512 in the workstation 510 or download the application program from the cloud 520. The application program may contain UI description information.
在一些实施例中,第一设备中可以包含有服务程序和虚拟机/脚本引擎。第一设备在用户界面上显示的各组件为UI描述信息中描述的各组件。即第一设备可以运行服务程序来解析UI描述信息,并调用组件库来实例化UI描述信息中的各组件。其中,第一设备在解析 UI描述信息时,可以先获取第一设备自己的屏幕信息(如形状、尺寸、分辨率等),并根据该屏幕信息来计算各组件的尺寸以及位置。这样可以使得UI描述信息中的各组件与第一设备的屏幕适配。In some embodiments, the first device may include a service program and a virtual machine/script engine. The components displayed on the user interface of the first device are the components described in the UI description information. That is, the first device can run the service program to parse the UI description information, and call the component library to instantiate each component in the UI description information. Wherein, when the first device parses the UI description information, it may first obtain its own screen information (such as shape, size, resolution, etc.) of the first device, and calculate the size and position of each component according to the screen information. In this way, the components in the UI description information can be adapted to the screen of the first device.
在另一些实施例中,应用程序中包含有与第一设备的屏幕适配的用户界面的绘制命令。第一设备可以执行这些绘制命令,从而在用户界面上显示各组件。In other embodiments, the application program contains a drawing command of a user interface adapted to the screen of the first device. The first device can execute these drawing commands to display various components on the user interface.
本申请实施例对第一设备在用户界面上显示各组件的方式不作限定。The embodiment of the present application does not limit the manner in which the first device displays each component on the user interface.
第一设备530可以将一个应用场景涉及的全部UI描述信息一次性或者分次发送给第二设备540。The first device 530 may send all UI description information related to an application scenario to the second device 540 at one time or in batches.
第二设备540可以包含服务程序511a和虚拟机/脚本引擎511b。服务程序511a和虚拟机/脚本引擎511b的说明可以参考对模拟器511中服务程序511a和虚拟机/脚本引擎511b的说明。The second device 540 may include a service program 511a and a virtual machine/script engine 511b. The description of the service program 511a and the virtual machine/script engine 511b can refer to the description of the service program 511a and the virtual machine/script engine 511b in the simulator 511.
第二设备540可以从第一设备530或者从云端520获取UI描述信息。其中,当从第一设备530获取UI描述信息,第二设备540需要与第一设备530建立通信连接。例如,第二设备540可以通过经典蓝牙、低功耗蓝牙或者近场通信等方式与第一设备530建立通信连接。当从云端520获取UI描述信息,第二设备540需要与云端520建立通信连接。例如,第二设备540可以通过开启WiFi并访问互联网的方式与云端520建立通信连接。The second device 540 may obtain the UI description information from the first device 530 or from the cloud 520. Wherein, when the UI description information is obtained from the first device 530, the second device 540 needs to establish a communication connection with the first device 530. For example, the second device 540 may establish a communication connection with the first device 530 in a manner such as classic Bluetooth, Bluetooth low energy, or near field communication. When obtaining UI description information from the cloud 520, the second device 540 needs to establish a communication connection with the cloud 520. For example, the second device 540 may establish a communication connection with the cloud 520 by turning on WiFi and accessing the Internet.
需要进行说明的是,第二设备540中包含有组件库。该组件库可以预置在第二设备中,或者,可以随UI描述信息一起下载至第二设备540。It should be noted that the second device 540 includes a component library. The component library can be preset in the second device, or can be downloaded to the second device 540 along with the UI description information.
第二设备540可以根据如图5所示的方法流程图中的步骤S105~S108,对UI描述信息进行处理,在用户界面上显示UI描述信息中的各组件。这里不再赘述。The second device 540 may process the UI description information according to steps S105 to S108 in the method flowchart shown in FIG. 5, and display the components in the UI description information on the user interface. I won't repeat it here.
在一些实施例中,当未与云端520建立通信连接,或者需要与第一设备530进行交互时,第二设备540可以从第一设备530获取UI描述信息。例如,在如图11A~图11C所示的音乐播放的应用场景中,当检测到与第二设备(智能手表)540进行交互的指令,第一设备(手机)530需要与第二设备540进行交互。智能手表可以接收到来自手机的UI描述信息。智能手表解析该UI描述信息,并根据预先设定的过滤规则,可以在用户界面上显示如图11C所示的第一组件430、歌曲信息组件431、上一首组件432、暂停组件433、下一首组件434、播放模式组件435和音量组件436。这样,用户可以通过该智能手表对手机上播放的音乐进行控制。In some embodiments, when a communication connection with the cloud 520 is not established or interaction with the first device 530 is required, the second device 540 may obtain UI description information from the first device 530. For example, in the music playing application scenario shown in FIGS. 11A to 11C, when an instruction to interact with the second device (smart watch) 540 is detected, the first device (mobile phone) 530 needs to communicate with the second device 540. Interactive. The smart watch can receive the UI description information from the mobile phone. The smart watch parses the UI description information, and according to preset filtering rules, can display the first component 430, the song information component 431, the previous component 432, the pause component 433, and the next as shown in FIG. 11C on the user interface. A song component 434, a play mode component 435, and a volume component 436. In this way, the user can control the music played on the mobile phone through the smart watch.
在上述第二设备从第一设备获取UI描述信息的实施例中,由于第一设备与第二设备之间进行通信的信道功耗较低,第二设备从第一设备获取UI描述信息有利于降低第二设备的功耗。In the foregoing embodiment in which the second device obtains UI description information from the first device, since the channel power consumption for communication between the first device and the second device is low, it is beneficial for the second device to obtain UI description information from the first device. Reduce the power consumption of the second device.
在另一些实施例中,当脱离第一设备530独立工作,且与云端520建立有通信连接时,第二设备540可以从云端520获取UI描述信息。例如,在第二设备(智能手表)540脱离第一设备(手机)530进行音乐播放的应用场景中,智能手表可以利用自己的扬声器播放音乐。智能手表可以不安装应用程序音乐播放器,而是从云端520获取音乐播放器中用户界面的UI描述信息。智能手表还可以从云端获取其他与音乐相关的数据(如音乐的音频)。其中,智能手表获取的UI描述信息可以包括如图11A所示的音乐播放界面对应的UI描述信息以及音乐列表界面对应的UI描述信息等。该音乐列表界面可用于选择在智能手表上播 放的音乐。In other embodiments, when working independently from the first device 530 and a communication connection is established with the cloud 520, the second device 540 may obtain UI description information from the cloud 520. For example, in an application scenario where the second device (smart watch) 540 is separated from the first device (mobile phone) 530 to play music, the smart watch can use its own speaker to play music. The smart watch may not install the application music player, but obtain the UI description information of the user interface in the music player from the cloud 520. Smart watches can also obtain other music-related data (such as music audio) from the cloud. Wherein, the UI description information acquired by the smart watch may include UI description information corresponding to the music playing interface and UI description information corresponding to the music list interface as shown in FIG. 11A. The music list interface can be used to select music to be played on the smart watch.
在上述第二设备从云端获取第一应用程序(如音乐播放器)中用户界面的UI描述信息的实施例中,第二设备不仅可以在不安装第一应用程序的情况下为用户提供第一应用程序中的服务,而且第二设备可以脱离第一设备独立工作。In the foregoing embodiment in which the second device obtains the UI description information of the user interface in the first application (such as a music player) from the cloud, the second device can not only provide the user with the first application without installing the first application; Service in the application, and the second device can work independently from the first device.
下面介绍另一种开发多设备交互系统的结构示意图。The following introduces another structure diagram for the development of a multi-device interactive system.
图13示出了另一种开发多设备交互系统的结构示意图。如图13所示,该开发多设备交互系统的结构中可以包括工作站610、云端620、第一设备630和第二设备640。其中:Figure 13 shows a schematic diagram of another development of a multi-device interactive system. As shown in FIG. 13, the structure for developing a multi-device interaction system may include a workstation 610, a cloud 620, a first device 630, and a second device 640. in:
工作站510和云端520的说明可以分别参考对图12所示的工作站510和云端520的说明。这里不再赘述。For the description of the workstation 510 and the cloud 520, reference may be made to the description of the workstation 510 and the cloud 520 shown in FIG. 12, respectively. I won't repeat it here.
第一设备630中可包含虚拟屏幕631。第一设备630可以预先获取第二设备的640的屏幕信息或者第二设备640中特定窗口的窗口信息(如窗口的形状、尺寸、分辨率),并将第二设备的屏幕信息或者窗口信息设置为虚拟屏幕631的屏幕信息。The first device 630 may include a virtual screen 631. The first device 630 may obtain in advance the screen information of the second device 640 or the window information of a specific window in the second device 640 (such as the shape, size, and resolution of the window), and set the screen information or window information of the second device It is the screen information of the virtual screen 631.
当第一设备630与第二设备640进行交互,第一设备630可以运行服务程序611a对UI描述信息进行解析,并根据虚拟屏幕631的屏幕信息确定UI描述信息中各组件的尺寸。第一设备解析UI描述信息的方法可以参考如图5所示的方法流程图中第二设备解析UI描述信息的方法。When the first device 630 interacts with the second device 640, the first device 630 can run the service program 611a to analyze the UI description information, and determine the size of each component in the UI description information according to the screen information of the virtual screen 631. The method for parsing the UI description information by the first device may refer to the method for parsing the UI description information by the second device in the method flowchart shown in FIG. 5.
第一设备630可以对UI描述信息进行解析,并利用组件库得到实例化的组件。第一设备630可以在虚拟屏幕631上绘制经过实例化的组件,并生成绘制命令。该绘制命令可以用于绘制与虚拟屏幕适配的组件。The first device 630 may parse the UI description information, and use the component library to obtain instantiated components. The first device 630 may draw the instantiated component on the virtual screen 631 and generate a drawing command. The drawing command can be used to draw components that are adapted to the virtual screen.
第一设备630可以将上述绘制命令发送给第二设备640。The first device 630 may send the aforementioned drawing command to the second device 640.
第二设备640中可以包含服务程序611a和虚拟机/脚本引擎611b。当接收到来自第一设备630的绘制命令,第二设备640可以运行服务程序611a来执行这些绘制命令。这样,第二设备640可以在用户界面上显示UI描述信息中的各组件。The second device 640 may include a service program 611a and a virtual machine/script engine 611b. When receiving drawing commands from the first device 630, the second device 640 can run the service program 611a to execute these drawing commands. In this way, the second device 640 can display each component in the UI description information on the user interface.
另外,当检测到作用在第二设备640上的输入事件,第二设备640可以向第一设备630反馈该输入事件。当接收到由第二设备640反馈的输入事件,第一设备630可以实际处理该输入事件对应的业务,并解析UI描述信息,生成绘制命令。其中第一设备630解析的UI描述信息为需要在第二设备640上更新的用户界面对应的UI描述信息。当接收到绘制命令,第二设备640可以运行服务程序611a来执行这些绘制命令。这样,第二设备640可以更新用户界面。In addition, when an input event acting on the second device 640 is detected, the second device 640 may feed back the input event to the first device 630. When an input event fed back by the second device 640 is received, the first device 630 can actually process the service corresponding to the input event, analyze the UI description information, and generate a drawing command. The UI description information parsed by the first device 630 is UI description information corresponding to the user interface that needs to be updated on the second device 640. When receiving drawing commands, the second device 640 can run the service program 611a to execute these drawing commands. In this way, the second device 640 can update the user interface.
根据如图13所示的系统可以看出,由第一设备来解析UI描述信息,并根据第二设备的屏幕信息来生成绘制命令,而第二设备可以直接执行绘制命令来绘制各组件。这样不仅可以解决各组件在第二设备的用户界面上显示的适配问题,还可以减少第二设备在处理上的负担。According to the system shown in FIG. 13, it can be seen that the first device parses the UI description information and generates drawing commands according to the screen information of the second device, and the second device can directly execute the drawing commands to draw each component. This not only solves the problem of adaptation of the components displayed on the user interface of the second device, but also reduces the processing burden of the second device.
在一些实施例中,第一设备630可以预先获取第二设备的640的屏幕信息或者第二设备640中特定窗口的窗口信息(如窗口的形状、尺寸、分辨率),并将第二设备的屏幕信息或者窗口信息设置为虚拟屏幕631的屏幕信息。当第一设备630与第二设备640进行交互时,第一设备630可以解析UI描述信息,并结合虚拟屏幕631的屏幕信息确定该UI描述 信息中各组件显示在虚拟屏幕631上,也即第二设备640的屏幕上,所采用的属性。例如,组件的类型、尺寸、位置、颜色等。然后第一设备630可以将上述确定出组件显示在第二设备640的屏幕上所采用的属性的UI描述信息发送给第二设备640。这样,第二设备640可以根据上述UI描述信息中各组件的显示第二设备640上所采用的属性以及组件库来实例化上述UI描述信息,从而在第二设备640的用户界面上显示上述UI描述信息中的组件。这些组件可以响应用户操作。In some embodiments, the first device 630 may pre-acquire the screen information of the second device 640 or the window information of a specific window in the second device 640 (such as the shape, size, and resolution of the window), and set the The screen information or window information is set as the screen information of the virtual screen 631. When the first device 630 interacts with the second device 640, the first device 630 can parse the UI description information, and combine with the screen information of the virtual screen 631 to determine that each component in the UI description information is displayed on the virtual screen 631, that is, the first device 630 Second, the attributes used on the screen of the device 640. For example, the type, size, location, color, etc. of the component. Then, the first device 630 may send to the second device 640 the UI description information that determines the attribute used by the component to be displayed on the screen of the second device 640. In this way, the second device 640 can instantiate the aforementioned UI description information according to the attributes and component libraries used on the display of the components in the aforementioned UI description information on the second device 640, so as to display the aforementioned UI on the user interface of the second device 640. Describe the components in the information. These components can respond to user actions.
在上述实施例中,第一设备可解析UI描述信息,从而确定UI描述信息中各组件显示在第二设备的屏幕上所采用的属性。进而,第二设备可以只需对该UI描述信息中的组件进行实例化,并显示实例化的组件。这样,也可以在解决各组件在第二设备的用户界面上显示的适配问题以及减少第二设备在处理上的负担。In the foregoing embodiment, the first device may parse the UI description information to determine the attributes used by each component in the UI description information to be displayed on the screen of the second device. Furthermore, the second device may only need to instantiate the components in the UI description information and display the instantiated components. In this way, it is also possible to solve the problem of adaptation of the components displayed on the user interface of the second device and reduce the processing burden of the second device.
下面介绍一种在多设备交互过程中涉及的设备的结构示意图。The following introduces a schematic diagram of the structure of a device involved in the process of multi-device interaction.
第一设备和第二设备均可以为手机、电脑、只能手表、智能电视、汽车等设备。本申请实施例对第一设备和第二设备的类型不作限定。Both the first device and the second device can be devices such as mobile phones, computers, smart watches, smart TVs, and automobiles. The embodiment of the present application does not limit the types of the first device and the second device.
图14示出了一种设备500的结构示意图。该结构示意图既可以是第一设备的结构示意图,也可以是第二设备的结构示意图。FIG. 14 shows a schematic structural diagram of a device 500. The schematic structural diagram may be a schematic structural diagram of the first device or a schematic structural diagram of the second device.
如图14所示,设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,显示屏190以及摄像头191等。其中传感器模块180可以包括压力传感器,陀螺仪传感器,加速度传感器,距离传感器,触摸传感器等。As shown in FIG. 14, the device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, and a battery 142, Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, display screen 190, camera 191, etc. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an acceleration sensor, a distance sensor, a touch sensor, etc.
可以理解的是,本发明实施例示意的结构并不构成对设备100的具体限定。在本申请另一些实施例中,设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the device 100. In other embodiments of the present application, the device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Among them, the different processing units may be independent devices or integrated in one or more processors.
其中,控制器可以是设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the device 100. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏190,摄像头191,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 190, the camera 191, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
无线通信模块160可以提供应用在设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on the device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems. (Global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
示例性的,在本申请实施例中,多个设备在交互时,可以通过无线通信模块160建立无线通信连接,例如BT,NFC等。这样,设备之间可以通过无线通信的信道传输UI描述信息和相关指令、数据等。Exemplarily, in the embodiment of the present application, when multiple devices interact, a wireless communication connection, such as BT, NFC, etc., may be established through the wireless communication module 160. In this way, devices can transmit UI description information and related instructions, data, etc. through wireless communication channels.
移动通信模块150可以提供应用在设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
示例性的,在接收到来电通知的应用场景中,设备100(如手机)可以利用移动通信模块150和基站进行通信,实现接听电话和挂断电话的功能。Exemplarily, in the application scenario of receiving notification of incoming calls, the device 100 (such as a mobile phone) may use the mobile communication module 150 to communicate with the base station to realize the functions of answering and hanging up calls.
显示屏190用于显示图像,视频等。显示屏190包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,设备100可以包括1个或N个显示屏190,N为大于1的正整数。The display screen 190 is used to display images, videos, and the like. The display screen 190 includes a display panel. The display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, the device 100 may include 1 or N display screens 190, and N is a positive integer greater than 1.
摄像头191用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换 成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,设备100可以包括1个或N个摄像头191,N为大于1的正整数。The camera 191 is used to capture still images or videos. The object generates an optical image through the lens and is projected to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the device 100 may include 1 or N cameras 191, and N is a positive integer greater than 1.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the device 100 by running instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function. The data storage area can store data (such as audio data, phone book, etc.) created during the use of the device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
在本申请实施例中,设备的内部存储器121可用于存储服务程序以及组件库等。上述服务程序可用于解析UI描述信息。上述组件库中包含有与各组件对应的可执行的底层代码。当设备100接收到UI描述信息,处理器110可以运行存储在内部存储器121中的服务程序,来解析UI描述信息。当确定该UI描述信息中各组件的类型,处理器110可以加载存储在内部存储器121中的组件库,执行组件库中获取与组件对应的可执行的底层代码,对组件进行实例化。In the embodiment of the present application, the internal memory 121 of the device may be used to store service programs, component libraries, and the like. The above service program can be used to parse the UI description information. The aforementioned component library contains executable low-level code corresponding to each component. When the device 100 receives the UI description information, the processor 110 may run a service program stored in the internal memory 121 to parse the UI description information. When determining the type of each component in the UI description information, the processor 110 may load the component library stored in the internal memory 121, execute the component library to obtain executable low-level code corresponding to the component, and instantiate the component.
设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, and an application processor. For example, music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。设备100可以通过扬声器170A收听音乐,或收听免提通话。The speaker 170A, also called "speaker", is used to convert audio electrical signals into sound signals. The device 100 can listen to music through the speaker 170A, or listen to a hands-free call.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当设备100接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the device 100 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。设备100可以设置至少一个麦克风170C。在另一些实施例中,设备100可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,设备100还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The microphone 170C, also called "microphone", "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C. The device 100 may be provided with at least one microphone 170C. In other embodiments, the device 100 may be provided with two microphones 170C, which can implement noise reduction functions in addition to collecting sound signals. In other embodiments, the device 100 may also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准 接口。The earphone interface 170D is used to connect wired earphones. The earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
触摸传感器,也称“触控面板”。触摸传感器180K可以设置于显示屏190,由触摸传感器与显示屏190组成触摸屏,也称“触控屏”。触摸传感器用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏190提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器也可以设置于设备100的表面,与显示屏190所处的位置不同。Touch sensor, also called "touch panel". The touch sensor 180K may be disposed on the display screen 190, and the touch screen is composed of the touch sensor and the display screen 190, which is also called a “touch screen”. The touch sensor is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. The visual output related to the touch operation may be provided through the display screen 190. In other embodiments, the touch sensor may also be disposed on the surface of the device 100, which is different from the position of the display screen 190.
在本申请实施例中,处理器110可以根据检测到触摸操作的触摸传感器的位置确定该触摸操作在显示屏190上的屏幕坐标,进而将屏幕坐标转换为用户界面的组件坐标,来确定与该触摸操作关联的组件。In the embodiment of the present application, the processor 110 may determine the screen coordinates of the touch operation on the display screen 190 according to the position of the touch sensor that detects the touch operation, and then convert the screen coordinates into the component coordinates of the user interface to determine the Touch the associated component.
图15示例性示出了另一种设备100的结构示意图。Fig. 15 exemplarily shows a schematic structural diagram of another device 100.
如图15所示,设备100可以包括通过总线相互耦合的显示屏910、通信装置920、存储器930以及处理器940。其中:As shown in FIG. 15, the device 100 may include a display screen 910, a communication device 920, a memory 930, and a processor 940 that are coupled to each other through a bus. in:
通信装置920可用于设备100与其他设备交互数据。例如,设备100可以接收到来自其它设备的UI描述信息,以及设备100向其他设备发送用于指示作用在设备100上的用户操作的事件。其中,设备100与其它设备建立有通信连接。存储器930可用于存储一个或多个程序。The communication device 920 can be used for the device 100 to exchange data with other devices. For example, the device 100 may receive UI description information from another device, and the device 100 may send an event for indicating a user operation on the device 100 to the other device. Among them, the device 100 establishes a communication connection with other devices. The memory 930 may be used to store one or more programs.
处理器940可用于执行存储在存储器930中的一个或多个程序,使得设备100可以执行以下操作:The processor 940 may be used to execute one or more programs stored in the memory 930, so that the device 100 can perform the following operations:
设备100可接收来自其它设备的第一UI描述信息。该第一UI描述信息可用于描述第一应用程序的第一UI组件。该第一UI组件可以根据第一应用程序的第一用户界面确定。该第一UI组件可第一用户界面上可以以第一组件属性显示。第一应用程序是安装在其他设备上的应用程序。The device 100 may receive the first UI description information from other devices. The first UI description information can be used to describe the first UI component of the first application. The first UI component may be determined according to the first user interface of the first application. The first UI component can be displayed on the first user interface with the first component attribute. The first application is an application installed on other devices.
设备100可以根据第二组件属性以及第一组件的可执行的底层代码实例化上述第一UI组件。第二组件属性可以根据第一UI描述信息确定。第一UI组件的可执行的底层代码可以根据第一UI组件的组件类型从组件库中确定。该组件库可包含用于绘制不同类型的组件的可执行的底层代码。The device 100 may instantiate the aforementioned first UI component according to the second component attribute and the executable underlying code of the first component. The second component attribute can be determined according to the first UI description information. The executable underlying code of the first UI component may be determined from the component library according to the component type of the first UI component. The component library may contain executable low-level codes for drawing different types of components.
设备100可以利用显示屏910显示第二用户界面。该第二用户界面可包括第一UI组件。第一UI组件可以在第二用户界面中以第二组件属性显示。The device 100 may use the display screen 910 to display the second user interface. The second user interface may include a first UI component. The first UI component may be displayed with the second component attribute in the second user interface.
其中,第一组件属性、第二组件属性可包括组件类型、组件尺寸、组件位置、组件外观。Among them, the first component attribute and the second component attribute may include component type, component size, component location, and component appearance.
在本申请实施例中,第一UI组件可以为第一应用程序中可显示在不同设备用户界面上的组件。第一UI组件可以在第一设备的第一用户界面上以第一组件属性显示。第一UI组件可以在第二设备的第二用户界面上以第二组件属性显示。其中,显示在上述第二用户界面上的第一UI组件可以是根据第二组件属性以及该第一UI组件的可执行的底层代码实例化之后的组件。即前述实施例中所提及的组件。In the embodiment of the present application, the first UI component may be a component in the first application that can be displayed on user interfaces of different devices. The first UI component may be displayed with the first component attribute on the first user interface of the first device. The first UI component may be displayed with the second component attribute on the second user interface of the second device. Wherein, the first UI component displayed on the above-mentioned second user interface may be a component instantiated according to the second component attribute and the executable underlying code of the first UI component. That is, the components mentioned in the foregoing embodiments.
示例性的,如图6A和图6C所示,第一应用程序可以为拨号应用。拨号应用中可包含 有联系人组件、挂断组件、接听组件。这些组件可以表示上述第一UI组件。这些组件可以分别第一组件属性和第二组件属性显示在如图6A所示的手机的用户界面上,和如图6C所示的智能手表的用户界面上。这些组件在手机的用户界面上显示,可以分别为联系人组件213、挂断组件213、接听组件214。这些组件在智能手表的用户界面上显示,可以分别为联系人组件311、挂断组件312、接听组件313。这些组件在智能手表的用户界面上显示的位置、尺寸、颜色等参数可以与在手机的用户界面上显示时不同。Exemplarily, as shown in FIG. 6A and FIG. 6C, the first application program may be a dial-up application. The dial-up application can include a contact component, a hang-up component, and an answer component. These components may represent the aforementioned first UI component. These components can be displayed on the user interface of the mobile phone as shown in FIG. 6A and the user interface of the smart watch as shown in FIG. 6C, respectively, with the first component attribute and the second component attribute. These components are displayed on the user interface of the mobile phone, and can be a contact component 213, a hang-up component 213, and an answer component 214, respectively. These components are displayed on the user interface of the smart watch, and may be a contact component 311, a hang-up component 312, and an answer component 313, respectively. The position, size, color and other parameters of these components displayed on the user interface of the smart watch may be different from those displayed on the user interface of the mobile phone.
另外,第一UI组件可以根据其内部是否包含有子组件划分为前述实施例中所提及的第一组件或第二组件。也即是说,当第一UI组件内部包含有子组件,第一UI组件可以是前述第一组件。当第一UI组件内部不包含有子组件,第一UI组件可以是前述第二组件。第二UI组件的定义可以参考上述对第一UI组件的说明。In addition, the first UI component can be divided into the first component or the second component mentioned in the foregoing embodiment according to whether it contains sub-components. In other words, when the first UI component contains subcomponents, the first UI component may be the aforementioned first component. When the first UI component does not contain subcomponents, the first UI component may be the aforementioned second component. For the definition of the second UI component, please refer to the above description of the first UI component.
在本申请实施例中,第一应用程序、第二应用程序均可以为系统应用程序、主屏幕应用程序、第三方应用程序。系统应用程序可以包括前述实施例所提及的拨号应用、信息应用、联系人应用。主屏幕应用程序可以为前述实施例所提及的主界面应用。第三方应用程序可以包括前述实施例所提及的微信应用、运动健康应用、Google Maps应用。In the embodiment of the present application, both the first application and the second application may be a system application, a home screen application, or a third-party application. The system application program may include the dialing application, the information application, and the contact application mentioned in the foregoing embodiments. The main screen application may be the main interface application mentioned in the foregoing embodiment. The third-party application program may include the WeChat application, the sports health application, and the Google Maps application mentioned in the foregoing embodiment.
在本申请实施例中,第一组件属性可以包含第一UI组件的组件类型以及该第一UI组件在用户界面上显示的组件尺寸、组件位置和组件外观。上述组件类型可以为第一UI组件的类型。例如,按钮、滑块、复选框、文本框和图标等。上述组件尺寸、上述组件位置和上述组件外观可以为第一UI组件的尺寸、位置、外观。该外观例如是背景、前景、边框线条。第二组件属性、第三组件属性和第四组件属性的含义可以参考对第一组件属性的说明。In the embodiment of the present application, the first component attribute may include the component type of the first UI component and the component size, component position, and component appearance displayed on the user interface of the first UI component. The aforementioned component type may be the type of the first UI component. For example, buttons, sliders, check boxes, text boxes, icons, etc. The above-mentioned component size, the above-mentioned component position, and the above-mentioned component appearance may be the size, position, and appearance of the first UI component. The appearance is, for example, background, foreground, border line. For the meaning of the second component attribute, the third component attribute, and the fourth component attribute, please refer to the description of the first component attribute.
在本申请实施例中,第一UI组件的组件类型的组件对象可以为该第一UI组件的组件类型所对应的一类组件。例如按钮、滑块、复选框、文本框和图标。也即是说,若第一UI组件的组件类型是按钮,第二设备利用该第一UI组件的可执行的底层代码得到上述第一UI组件的组件类型的组件对象,可以表示第二设备得到一个按钮。但该按钮在第二设备用户界面上显示的尺寸、位置和外观需要第二设备根据该按钮在第二设备用户界面上显示的属性来确定。In the embodiment of the present application, the component object of the component type of the first UI component may be a type of component corresponding to the component type of the first UI component. For example, buttons, sliders, check boxes, text boxes, and icons. In other words, if the component type of the first UI component is a button, the second device uses the executable underlying code of the first UI component to obtain the component object of the component type of the first UI component, which can indicate that the second device obtains A button. However, the size, position, and appearance of the button displayed on the user interface of the second device need to be determined by the second device according to the attributes of the button displayed on the user interface of the second device.
在本申请实施例中,第一设备中安装有第一应用程序。当检测到一个事件,第一设备可以将第一用户界面的第一UI描述信息发送给第二设备。示例性的,该第一应用程序可以是拨号应用。上述一个事件指来电通知。那么上述第一用户界面可以是来电通知界面。即第一设备将来电通知界面的UI描述信息发送给第二设备,使得第二设备可以通知用户接听电话。In the embodiment of the present application, the first application program is installed in the first device. When an event is detected, the first device may send the first UI description information of the first user interface to the second device. Exemplarily, the first application program may be a dial-up application. The above event refers to incoming call notification. Then the above-mentioned first user interface may be an incoming call notification interface. That is, the first device sends the UI description information of the call notification interface to the second device, so that the second device can notify the user to answer the call.
在本申请实施例中,第二设备显示第二用户界面。该第二用户界面可以是第二设备根据来自第一设备的UI描述信息所显示的用户界面。例如,第一设备将来电通知界面的UI描述信息发送给第二设备。那么上述第二用户界面可以为显示在第二设备上的来电通知界面,其中包含有UI描述信息中所描述的组件。In the embodiment of the present application, the second device displays the second user interface. The second user interface may be a user interface displayed by the second device according to the UI description information from the first device. For example, the first device sends the UI description information of the call notification interface to the second device. Then, the foregoing second user interface may be an incoming call notification interface displayed on the second device, which includes the components described in the UI description information.
上述实施例中所用,根据上下文,术语“当…时”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或 “响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。As used in the above embodiments, depending on the context, the term "when" can be interpreted as meaning "if..." or "after" or "in response to determining..." or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if detected (statement or event)" can be interpreted as meaning "if determined..." or "in response to determining..." or "when detected (Condition or event stated)" or "in response to detection of (condition or event stated)".
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘)等。In the foregoing embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website site, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium, (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state hard disk).
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。A person of ordinary skill in the art can understand that all or part of the process in the above-mentioned embodiment method can be realized. The process can be completed by a computer program instructing relevant hardware. The program can be stored in a computer readable storage medium. , May include the processes of the foregoing method embodiments. The aforementioned storage media include: ROM or random storage RAM, magnetic disks or optical discs and other media that can store program codes.

Claims (20)

  1. 一种多设备交互方法,其特征在于,所述方法包括:A multi-device interaction method, characterized in that the method includes:
    第二设备接收来自第一设备的第一用户界面UI描述信息;所述第一UI描述信息用于描述第一应用程序的第一UI组件,所述第一UI组件是根据所述第一应用程序的第一用户界面确定的;所述第一UI组件在所述第一用户界面上以第一组件属性显示;所述第一应用程序为安装在所述第一设备上的应用程序;The second device receives the first user interface UI description information from the first device; the first UI description information is used to describe the first UI component of the first application, and the first UI component is based on the first application The first user interface of the program is determined; the first UI component is displayed on the first user interface as a first component attribute; the first application is an application installed on the first device;
    所述第二设备根据第二组件属性以及所述第一UI组件的可执行的底层代码实例化所述第一UI组件;所述第二组件属性是根据所述第一UI描述信息确定的,所述第一UI组件的可执行的底层代码是根据所述第一UI组件的组件类型从组件库中确定出的,所述组件库包含用于绘制不同类型的组件的可执行的底层代码;The second device instantiates the first UI component according to the second component attribute and the executable underlying code of the first UI component; the second component attribute is determined according to the first UI description information, The executable low-level code of the first UI component is determined from a component library according to the component type of the first UI component, and the component library contains the executable low-level code for drawing different types of components;
    所述第二设备显示第二用户界面,所述第二用户界面包括所述第一UI组件,所述第一UI组件在所述第二用户界面中以所述第二组件属性显示;The second device displays a second user interface, the second user interface includes the first UI component, and the first UI component is displayed in the second user interface with the second component attribute;
    其中,所述第一组件属性、所述第二组件属性均包括组件类型,以及以下一项或多项参数:组件尺寸、组件位置、组件外观。Wherein, the first component attribute and the second component attribute both include a component type and one or more of the following parameters: component size, component position, component appearance.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    所述第二设备在所述第二用户界面中检测到作用于所述第一UI组件的第一用户操作;The second device detects a first user operation acting on the first UI component in the second user interface;
    所述第二设备改变所述第一UI组件在所述第二用户界面中的组件尺寸和/或组件外观;所述组件外观包括以下一项或多项:颜色、前景、背景。The second device changes the component size and/or component appearance of the first UI component in the second user interface; the component appearance includes one or more of the following: color, foreground, and background.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    在所述第二用户界面中检测到作用于所述第一UI组件的第一用户操作之后,所述第二设备向所述第一设备发送第一事件;其中,所述第一事件用于指示所述第一用户操作的发生;After detecting the first user operation acting on the first UI component in the second user interface, the second device sends a first event to the first device; wherein, the first event is used for Indicating the occurrence of the first user operation;
    所述第二设备接收来自所述第一设备的第二UI描述信息;所述第二UI描述信息用于描述所述第一应用程序的第二UI组件,所述第二UI组件是根据所述第一应用程序的第三用户界面确定的;所述第二UI组件在所述第三用户界面上以第三组件属性显示;The second device receives the second UI description information from the first device; the second UI description information is used to describe the second UI component of the first application, and the second UI component is based on the Determined by the third user interface of the first application; the second UI component is displayed on the third user interface as a third component attribute;
    所述第二设备根据第四组件属性以及所述第二UI组件的可执行的底层代码实例化所述第二UI组件;所述第四组件属性是根据所述第二UI描述信息确定的,所述第二UI组件的可执行的底层代码是根据所述第二UI组件的组件类型从所述组件库中确定出的The second device instantiates the second UI component according to the fourth component attribute and the executable underlying code of the second UI component; the fourth component attribute is determined according to the second UI description information, The executable underlying code of the second UI component is determined from the component library according to the component type of the second UI component
    所述第二设备显示第四用户界面,所述第四用户界面包括所述第二UI组件,所述第二UI组件在所述第四用户界面中以所述第四组件属性显示;The second device displays a fourth user interface, the fourth user interface includes the second UI component, and the second UI component is displayed in the fourth user interface with the fourth component attribute;
    其中,所述第三组件属性、所述第四组件属性均包括组件类型,以及以下一项或多项参数:组件尺寸、组件位置、组件外观。Wherein, the third component attribute and the fourth component attribute both include a component type and one or more of the following parameters: component size, component position, and component appearance.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-3, wherein the method further comprises:
    所述第二设备根据所述第一UI组件的组件类型从所述组件库中查找出所述第一UI组件的可执行的底层代码;The second device searches for the executable underlying code of the first UI component from the component library according to the component type of the first UI component;
    所述第二设备利用所述第一UI组件的可执行的底层代码得到所述第一UI组件的组件类型的组件对象;The second device obtains the component object of the component type of the first UI component by using the executable underlying code of the first UI component;
    所述第二设备利用所述第二组件属性设置所述第一UI组件的组件类型的组件对象在所述第二用户界面中的以下一项或多项参数:组件尺寸、组件位置、组件外观,得到所述实例化的所述第一UI组件。The second device uses the second component attribute to set one or more of the following parameters of the component object of the component type of the first UI component in the second user interface: component size, component position, component appearance To obtain the instantiated first UI component.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述第一UI组件内部包括至少一个子组件;所述方法还包括:The method according to any one of claims 1 to 4, wherein the first UI component includes at least one sub-component; the method further comprises:
    所述第二设备根据所述第一UI组件的组件类型从所述组件库中查找出所述第一UI组件的可执行的底层代码,以及根据所述子组件的组件类型从所述组件库中查找出所述子组件的可执行的底层代码;The second device searches for the executable underlying code of the first UI component from the component library according to the component type of the first UI component, and obtains the executable underlying code of the first UI component from the component library according to the component type of the sub-component Find the executable low-level code of the sub-component;
    所述第二设备利用所述第一UI组件的可执行的底层代码得到所述第一UI组件的组件类型的组件对象,以及利用所述子组件的可执行的底层代码得到所述子组件的组件类型的组件对象;The second device uses the executable low-level code of the first UI component to obtain the component object of the component type of the first UI component, and uses the executable low-level code of the sub-component to obtain the sub-component Component object of component type;
    所述第二设备利用所述第二组件属性设置所述第一UI组件的组件类型的组件对象在所述第二用户界面中的以下一项或多项参数:组件尺寸、组件位置、组件外观,得到所述实例化的所述第一UI组件,以及利用所述子组件的组件属性设置所述子组件的组件类型的组件对象在所述第二用户界面中的以下一项或多项参数:组件尺寸、组件位置、组件外观,得到所述实例化的所述子组件。The second device uses the second component attribute to set one or more of the following parameters of the component object of the component type of the first UI component in the second user interface: component size, component position, component appearance To obtain the instantiated first UI component, and use the component properties of the subcomponent to set the component object of the component type of the subcomponent in the second user interface with one or more of the following parameters : Component size, component position, component appearance, to obtain the instantiated subcomponent.
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述第一UI描述信息包括所述第一组件属性;所述方法包括:The method according to any one of claims 1-5, wherein the first UI description information includes the first component attribute; and the method includes:
    所述第二设备根据所述第一组件属性以及所述第二设备的屏幕信息确定所述第二组件属性;所述屏幕信息包括以下一项或多项:屏幕尺寸、屏幕形状、屏幕分辨率。The second device determines the second component attribute according to the first component attribute and the screen information of the second device; the screen information includes one or more of the following: screen size, screen shape, screen resolution .
  7. 根据权利要求1-5中任一项所述的方法,其特征在于,所述第一UI描述信息包括所述第二组件属性;所述方法包括:The method according to any one of claims 1-5, wherein the first UI description information includes the second component attribute; and the method includes:
    所述第二设备向所述第一设备发送所述第二设备的屏幕信息;所述屏幕信息包括以下一项或多项:屏幕尺寸、屏幕形状、屏幕分辨率;The second device sends the screen information of the second device to the first device; the screen information includes one or more of the following: screen size, screen shape, and screen resolution;
    所述第二组件属性是所述第一设备根据所述第一组件属性以及所述第二设备的屏幕信息确定的。The second component attribute is determined by the first device according to the first component attribute and screen information of the second device.
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述第一UI组件根据所述第一用户界面中的部分或全部组件确定。The method according to any one of claims 1-7, wherein the first UI component is determined according to some or all of the components in the first user interface.
  9. 根据权利要求1-8中任一项所述的方法,其特征在于,所述第二设备显示第二用户界面之前,所述方法还包括:The method according to any one of claims 1-8, wherein before the second device displays the second user interface, the method further comprises:
    所述第二设备处于熄屏状态;The second device is in a screen off state;
    或者,or,
    所述第二设备显示第三用户界面,所述第三用户界面是第二应用程序的用户界面,所述第二应用程序为安装在所述第二设备上的应用程序。The second device displays a third user interface, the third user interface is a user interface of a second application, and the second application is an application installed on the second device.
  10. 根据权利要求1-9中任一项所述的方法,其特征在于,所述第一应用程序包括:系统应用程序、主屏幕应用程序、第三方应用程序;所述第三方应用程序为从第三方应用市场下载安装的应用程序。The method according to any one of claims 1-9, wherein the first application includes: a system application, a home screen application, and a third-party application; the third-party application is a slave Download and install applications from the third-party application market.
  11. 根据权利要求1-10中任一项所述的方法,其特征在于,包括:The method according to any one of claims 1-10, characterized by comprising:
    所述第二设备从所述第一设备获取所述组件库;The second device obtains the component library from the first device;
    或者,or,
    所述第二设备从云端获取所述组件库;The second device obtains the component library from the cloud;
    或者,or,
    所述第二设备中预置有所述组件库。The component library is preset in the second device.
  12. 一种多设备交互方法,其特征在于,所述方法包括:A multi-device interaction method, characterized in that the method includes:
    第一设备检测到第一事件,向第二设备发送第一用户界面UI描述信息;所述第一UI描述信息用于描述第一应用程序的第一UI组件,所述第一UI组件是根据所述第一应用程序的第一用户界面确定的;所述第一UI组件在所述第一用户界面上以第一组件属性显示;所述第一应用程序为安装在所述第一设备上的应用程序;The first device detects the first event and sends the first user interface UI description information to the second device; the first UI description information is used to describe the first UI component of the first application, and the first UI component is based on Determined by the first user interface of the first application; the first UI component is displayed on the first user interface as a first component attribute; the first application is installed on the first device s application;
    所述第二设备根据第二组件属性以及所述第一UI组件的可执行的底层代码实例化所述第一UI组件;所述第二组件属性是根据所述第一UI描述信息确定的,所述第一UI组件的可执行的底层代码是根据所述第一UI组件的组件类型从组件库中确定出的,所述组件库包含用于绘制不同类型的组件的可执行的底层代码;The second device instantiates the first UI component according to the second component attribute and the executable underlying code of the first UI component; the second component attribute is determined according to the first UI description information, The executable low-level code of the first UI component is determined from a component library according to the component type of the first UI component, and the component library contains the executable low-level code for drawing different types of components;
    所述第二设备显示第二用户界面;所述第二用户界面包括所述第一UI组件,所述第一UI组件在所述第二用户界面中以所述第二组件属性显示;The second device displays a second user interface; the second user interface includes the first UI component, and the first UI component is displayed in the second user interface with the second component attribute;
    其中,所述第一组件属性、所述第二组件属性均包括组件类型,以及以下一项或多项参数:组件尺寸、组件位置、组件外观。Wherein, the first component attribute and the second component attribute both include a component type and one or more of the following parameters: component size, component position, component appearance.
  13. 根据权利要求12中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 12, wherein the method further comprises:
    所述第一设备根据第一预设规则,从多个设备中确定所述第二设备;所述多个设备与所述第一设备建立有通信连接;The first device determines the second device from multiple devices according to a first preset rule; the multiple devices have established a communication connection with the first device;
    或者,or,
    所述第一设备检测到第一用户操作,所述第一用户操作用于选择所述第二设备;所述第一设备确定所述第一用户操作选择的设备为所述第二设备。The first device detects a first user operation, and the first user operation is used to select the second device; the first device determines that the device selected by the first user operation is the second device.
  14. 根据权利要求12或13所述的方法,其特征在于,所述方法还包括:The method according to claim 12 or 13, wherein the method further comprises:
    所述第二设备在所述第二用户界面中检测到作用于所述第一UI组件的第二用户操作;The second device detects a second user operation acting on the first UI component in the second user interface;
    所述第二设备改变所述第一UI组件在所述第二用户界面中的组件尺寸和/或组件外观;所述组件外观包括以下一项或多项:颜色、前景、背景。The second device changes the component size and/or component appearance of the first UI component in the second user interface; the component appearance includes one or more of the following: color, foreground, and background.
  15. 根据权利要求14所述的方法,其特征在于,所述方法还包括:The method according to claim 14, wherein the method further comprises:
    在所述第二用户界面中检测到作用于所述第一UI组件的第二用户操作之后,所述第二设备向所述第一设备发送第二事件;其中,所述第二事件用于指示所述第二用户操作的发生;After detecting a second user operation acting on the first UI component in the second user interface, the second device sends a second event to the first device; wherein, the second event is used for Indicating the occurrence of the second user operation;
    所述第一设备向所述第二设备发送第二UI描述信息;所述第二UI描述信息用于描述所述第一应用程序的第二UI组件,所述第二UI组件是根据所述第一应用程序的第三用户界面确定的;所述第二UI组件在所述第三用户界面上以第三组件属性显示;The first device sends second UI description information to the second device; the second UI description information is used to describe the second UI component of the first application, and the second UI component is based on the Determined by the third user interface of the first application; the second UI component is displayed on the third user interface as a third component attribute;
    所述第二设备根据第四组件属性以及所述第二UI组件的可执行的底层代码实例化所述第二UI组件;所述第四组件属性是根据所述第二UI描述信息确定的,所述第二UI组件的可执行的底层代码是根据所述第二UI组件的组件类型从所述组件库中确定出的;The second device instantiates the second UI component according to the fourth component attribute and the executable underlying code of the second UI component; the fourth component attribute is determined according to the second UI description information, The executable underlying code of the second UI component is determined from the component library according to the component type of the second UI component;
    所述第二设备显示第四用户界面;所述第四用户界面包括所述第二UI组件,所述第二UI组件在所述第四用户界面中以所述第四组件属性显示;The second device displays a fourth user interface; the fourth user interface includes the second UI component, and the second UI component is displayed in the fourth user interface with the fourth component attribute;
    其中,所述第三组件属性、所述第四组件属性均包括组件类型,以及以下一项或多项参数:组件尺寸、组件位置、组件外观。Wherein, the third component attribute and the fourth component attribute both include a component type and one or more of the following parameters: component size, component position, and component appearance.
  16. 根据权利要求12-15中任一项所述的方法,所述第一UI描述信息包括所述第一组件属性;所述方法包括:The method according to any one of claims 12-15, wherein the first UI description information includes the first component attribute; the method includes:
    所述第二设备根据所述第一组件属性以及所述第二设备的屏幕信息确定所述第二组件属性;所述屏幕信息包括以下一项或多项:屏幕尺寸、屏幕形状、屏幕分辨率。The second device determines the second component attribute according to the first component attribute and the screen information of the second device; the screen information includes one or more of the following: screen size, screen shape, screen resolution .
  17. 根据权利要求12-15中任一项所述的方法,其特征在于,所述第一UI描述信息包括所述第二组件属性;所述方法包括:The method according to any one of claims 12-15, wherein the first UI description information includes the second component attribute; and the method includes:
    所述第二设备向所述第一设备发送所述第二设备的屏幕信息;所述屏幕信息包括以下一项或多项:屏幕尺寸、屏幕形状、屏幕分辨率;The second device sends the screen information of the second device to the first device; the screen information includes one or more of the following: screen size, screen shape, and screen resolution;
    所述第二组件属性是所述第一设备根据所述第一组件属性以及所述第二设备的屏幕信息确定的。The second component attribute is determined by the first device according to the first component attribute and screen information of the second device.
  18. 一种设备,包括显示屏、通信装置、存储器以及处理器,其特征在于,所述显示屏用于显示用户界面;所处存储器用于存储于一个或多个程序;所述处理器用于执行所述一个或多个程序,使得所述设备实现如权利要求1至11任一项所述的方法。A device including a display screen, a communication device, a memory, and a processor, wherein the display screen is used to display a user interface; the memory is used to store one or more programs; the processor is used to execute all The one or more programs enable the device to implement the method according to any one of claims 1 to 11.
  19. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在设备上运行时,使得所述设备执行如权利要求1至11任一项所述的方法。A computer program product containing instructions, characterized in that, when the computer program product runs on a device, the device is caused to execute the method according to any one of claims 1 to 11.
  20. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在设备上运行,使得所述设备执行如权利要求1至11任一项所述的方法。A computer-readable storage medium, comprising instructions, characterized in that, when the instructions run on a device, the device executes the method according to any one of claims 1 to 11.
PCT/CN2021/097004 2020-05-30 2021-05-28 Multi-device interaction method and system WO2021244452A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010480943.4 2020-05-30
CN202010480943.4A CN111666075B (en) 2020-05-30 2020-05-30 Multi-device interaction method and system

Publications (1)

Publication Number Publication Date
WO2021244452A1 true WO2021244452A1 (en) 2021-12-09

Family

ID=72385390

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/097004 WO2021244452A1 (en) 2020-05-30 2021-05-28 Multi-device interaction method and system

Country Status (2)

Country Link
CN (1) CN111666075B (en)
WO (1) WO2021244452A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666075B (en) * 2020-05-30 2022-04-12 荣耀终端有限公司 Multi-device interaction method and system
CN115150502A (en) * 2021-03-31 2022-10-04 华为技术有限公司 Display method and device of application widget

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107943439A (en) * 2016-10-13 2018-04-20 阿里巴巴集团控股有限公司 Interface Moving method, apparatus, intelligent terminal, server and operating system
CN108228292A (en) * 2017-12-29 2018-06-29 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) A kind of generation method and device at ExtJS interfaces
CN110275754A (en) * 2019-06-28 2019-09-24 百度在线网络技术(北京)有限公司 Exchange method, device, equipment and the storage medium presented for user interface
US20200167135A1 (en) * 2014-06-13 2020-05-28 James L. Bosworth Computing Expression Medium, Development Environment, and Device Communication and Control Architecture
CN111666075A (en) * 2020-05-30 2020-09-15 华为技术有限公司 Multi-device interaction method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106325647B (en) * 2015-06-17 2019-10-18 华为技术有限公司 A kind of UI method of adjustment, device and mobile terminal
CN107402747B (en) * 2016-05-20 2019-08-20 中国科学院声学研究所 A kind of application page dynamic creation method for supporting multiple terminals type
CN107864086B (en) * 2017-09-28 2020-10-02 许若华 Information rapid sharing method, mobile terminal and computer readable storage medium
CN110096275B (en) * 2018-01-30 2023-06-23 阿里健康信息技术有限公司 Page processing method and device
US10635413B1 (en) * 2018-12-05 2020-04-28 Bank Of America Corporation System for transforming using interface image segments and constructing user interface objects

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200167135A1 (en) * 2014-06-13 2020-05-28 James L. Bosworth Computing Expression Medium, Development Environment, and Device Communication and Control Architecture
CN107943439A (en) * 2016-10-13 2018-04-20 阿里巴巴集团控股有限公司 Interface Moving method, apparatus, intelligent terminal, server and operating system
CN108228292A (en) * 2017-12-29 2018-06-29 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) A kind of generation method and device at ExtJS interfaces
CN110275754A (en) * 2019-06-28 2019-09-24 百度在线网络技术(北京)有限公司 Exchange method, device, equipment and the storage medium presented for user interface
CN111666075A (en) * 2020-05-30 2020-09-15 华为技术有限公司 Multi-device interaction method and system

Also Published As

Publication number Publication date
CN111666075B (en) 2022-04-12
CN111666075A (en) 2020-09-15

Similar Documents

Publication Publication Date Title
WO2021013158A1 (en) Display method and related apparatus
US11922005B2 (en) Screen capture method and related device
WO2021017837A1 (en) Card sharing method, apparatus and system
WO2021185244A1 (en) Device interaction method and electronic device
KR102558615B1 (en) Method and electronic device for presenting a video on an electronic device when there is an incoming call
CN113961157B (en) Display interaction system, display method and equipment
WO2022068483A1 (en) Application startup method and apparatus, and electronic device
WO2021244452A1 (en) Multi-device interaction method and system
WO2022127661A1 (en) Application sharing method, and electronic device and storage medium
WO2020259514A1 (en) Method and apparatus for calling service
WO2022057852A1 (en) Method for interaction between multiple applications
WO2023130921A1 (en) Method for page layout adapted to multiple devices, and electronic device
WO2022052878A1 (en) Method for managing push message, and related apparatus
CN114115770A (en) Display control method and related device
WO2017050090A1 (en) Method and device for generating gif file, and computer readable storage medium
CN115756268A (en) Cross-device interaction method and device, screen projection system and terminal
WO2022135157A1 (en) Page display method and apparatus, and electronic device and readable storage medium
WO2022127130A1 (en) Method for adding operation sequence, electronic device, and system
US20230236714A1 (en) Cross-Device Desktop Management Method, First Electronic Device, and Second Electronic Device
WO2023138305A9 (en) Card display method, electronic device, and computer readable storage medium
WO2023045597A1 (en) Cross-device transfer control method and apparatus for large-screen service
WO2023072139A1 (en) Audio playing method, and electronic device and system
WO2022052706A1 (en) Service sharing method, system and electronic device
CN117785340A (en) Card sharing method and device
WO2023030196A1 (en) Device interaction method, electronic device and system

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: 21818137

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21818137

Country of ref document: EP

Kind code of ref document: A1