Service Sharing Method and System, and Electronic Device

This application provides a service sharing method and system, and an electronic device. The method includes: A first device may display a chat interface with a first contact, where the chat interface includes an input box for a chat message. If it is detected that a user inputs a preset symbol into the input box, the first device displays a first device list. If it is detected that the user selects a second device from the first device list, the first device displays a service list provided by the second device, where the service list includes one or more services provided by the second device. If it is detected that the user selects a first service from the service list, the first device sends a first chat message in the chat interface, where the first chat message includes first service content corresponding to the first service selected by the user.

TECHNICAL FIELD

This application relates to the field of terminal technologies, and in particular, to a service sharing method and system, and an electronic device.

BACKGROUND

One or more applications are usually installed in an electronic device such as a mobile phone, and these applications may provide rich application services for a user. For example, a video APP, a music APP, a shopping APP, and the like may be installed in a mobile phone. The video APP is used as an example. The video APP may provide, for a user, application services such as playing, message leaving, and sharing of a video file. For another example, the video APP may further provide, for a user, application services such as latest popular recommendation, favorites, and historical play records.

In a chat scenario, a user may send an application service in an application to a contact in a form of a chat message. For example, when a user watches a TV series A by using a video APP in a mobile phone, as shown inFIG.1(a), the mobile phone may display a play interface101of the TV series A in the video APP. If the user wants to share the TV series A with a contact Sam, the user may tap a share button102in the play interface101. In this case, still as shown inFIG.1(a), the mobile phone may display, in a dialog box103, a sharing manner that can be selected by the user, for example, sharing to a WeChat APP, sharing to a microblog APP, or sharing to a mailbox APP. An example in which the user selects the sharing manner, namely, sharing to the WeChat APP is used. As shown inFIG.1(b), the mobile phone may jump to a contact selection interface104of the WeChat APP. The user may search the contact selection interface104for the contact Sam105, and share the TV series A in the video APP with the contact Sam105. After sharing an application service, namely, the TV series A provided in the video APP with the contact Sam105, the user may further select to stay in the WeChat APP. As shown inFIG.1(c), the mobile phone may display a chat interface106that is in the WeChat APP and that is with the contact Sam105. In the chat interface106, the mobile phone may display, in a form of a chat message107, the TV series A shared by the user in the video APP.

It is clearly that, in the foregoing process of sharing the application service, the user needs to perform continuous selection, and correspondingly, the mobile phone also needs to perform continuous application switching and page jumping, to share an application service in an application with a corresponding contact, so that a process of pushing the application service is complex.

SUMMARY

This application provides a service sharing method and system, and an electronic device. An electronic device may quickly share, with a contact, a service provided by another electronic device, so that a user can use, across devices, services provided by different electronic devices.

To achieve the foregoing objective, this application uses the following technical solutions.

According to a first aspect, this application provides a service sharing method. The method includes: When a user chats with a first contact by using a chat APP, a first device may display a chat interface with the first contact, where the chat interface may include an input box for a chat message. If it is detected that the user inputs a preset symbol, for example, a reminder symbol “@” into the input box, the first device may display a first device list, where the first device list includes one or more electronic devices associated with the first device, and the user may select, from the first device list, a specific device in which a service that needs to be shared is located. If it is detected that the user selects a second device from the first device list, the first device may display a service list provided by the second device, where the service list includes one or more services provided by the second device, and the user may select, from the service list, specific content of a service that is shared with the first contact, for example, My Favorites and Latest Popular. If it is detected that the user selects a first service from the service list, the first device may send a first chat message in the chat interface, where the first chat message includes first service content corresponding to the first service selected by the user.

The first contact may be a friend, a group, a stranger, an official account, an applet, a robot, a chat assistant, or the like in the chat APP. This is not limited in this application.

It may be learned that when chatting with a contact, the user can trigger, by inputting a preset symbol, an electronic device (for example, the first device) to display a related electronic device in the chat APP for the user to select. After the user selects an electronic device (for example, the second device), the first device may display, in the chat APP, the one or more services provided by the second device for the user to select. After the user selects a service, the first device may share specific service content of the service with the contact in a form of a chat message, so that the first device may share, with the contact, a service provided by another electronic device, to implement cross-device sharing of an application service. In addition, in an entire sharing process, the user does not need to jump from the chat APP to another application or another electronic device, so that operations in the entire sharing process are simple, to improve user experience.

In a possible implementation, before that the first device displays a first device list, the method further includes: The first device obtains one or more electronic devices that access a same local area network as the first device; or the first device obtains one or more electronic devices that are logged in to by using a same account as the first device. Further, the first device may present the obtained one or more electronic devices in the first device list for the user to select, so that the user can select, by inputting the preset symbol, a device in which a service that needs to be shared is located.

In a possible implementation, before that the first device displays a service list provided by the second device, the method further includes: The first device obtains a service list corresponding to the second device. For example, the first device may obtain, by interacting with the second device, the service list including the one or more services provided by the second device. For another example, the first device may obtain, by interacting with a first server, the service list including the one or more services provided by the second device. Certainly, the service list corresponding to the second device may be further pre-stored in the first device. This is not limited in embodiments of this application.

In a possible implementation, before that the first device sends a first chat message in the chat interface, the method further includes: The first device obtains first service content corresponding to the first service. For example, the first device may obtain, by interacting with the second device, the first service content corresponding to the first service. For another example, the first device may obtain, by interacting with a second server, the service list including the one or more services provided by the second device. The first server may be the same as or different from the second server.

In a possible implementation, that the first device displays a first device list includes: The first device may display the first device list in the chat interface, that is, after the user inputs the preset symbol into the input box in the chat interface, the first device may continue to display the first device list in the chat interface without performing page jumping; or the first device may jump from the chat interface to a reminder interface, and display the first device list in the reminder interface. Certainly, the reminder interface may further include another contact such as a friend of the user or an official account. This is not limited in embodiments of this application.

In a possible implementation, the reminder interface may be in a folded state or an expanded state. When the reminder interface is in the folded state, the reminder interface may block some content in the chat interface, so that the user can view the first device list in the folded reminder interface, and can also view content in the chat interface. When the reminder interface is in the folded state, the user can further display the reminder interface in the expanded state by tapping a preset expand button, so that the reminder interface fully blocks the chat interface.

In a possible implementation, that the first device displays a service list provided by the second device includes: The first device may display, in the reminder interface, the service list provided by the second device; or the first device may not only display, in the reminder interface, the service list provided by the second device, but also display, in the reminder interface, service content of each service in the service list. In this way, after selecting the second device, the user can preview, in the reminder interface, specific service content of each service provided by the second device, to selectively select a corresponding service and share the service with a contact in the chat interface. Certainly, the first device may alternatively display, in the chat interface, the service list provided by the second device. This is not limited in embodiments of this application.

In a possible implementation, in response to an operation of selecting a second device from the first device list by the user, the method further includes: The first device displays an application list provided by the second device, where the application list includes one or more applications. That the first device displays a service list provided by the second device includes: The first device displays, in response to an operation of selecting a first application from the application list by the user, a service list provided by the first application in the second device. In other words, after selecting the second device, the user can first select an application by which a service is provided and needs to be shared and that is in the second device, and then select a service that is in the application and that is to be shared, so that the user can share the service with the contact by using the application as a dimension.

In a possible implementation, the first service content corresponds to a first play link. After that the first device sends a first chat message in the chat interface, the method further includes: detecting, by the first device, a first enable operation of enabling the first service content by the user in the first chat message; and in response to the first enable operation, enabling the first service content through the first play link. In other words, after the user shares the first service content with the contact in a form of a chat message, the user can also enable the shared first service content.

In a possible implementation, the enabling the first service content through the first play link includes: If the first play link is a local link of the first service content in the first device, the first device enables the first service content in the first device based on the first play link; or if the first play link is an external link of the first service content in the second device, the first device indicates the second device to enable the first service content based on the first play link. In other words, the user can enable, in the first device this time, the first service content shared with the contact, or can enable, in the second device, the first service content shared with the contact.

In a possible implementation, the first chat message further includes a first play button and a second play button that correspond to the first service content, the first play button corresponds to the local link of the first service content in the first device, and the second play button corresponds to the external link of the first service content in the second device. Therefore, when the first enable operation is an operation of tapping the first play button by the user, the first device may enable the first service content in the first device based on the first play link. When the first enable operation is an operation of tapping the second play button by the user, the first device may indicate the second device to enable the first service content based on the first play link. In this way, the user can quickly enable the first service content in the chat interface, and does not need to perform page jumping and selection for a plurality of times.

In a possible implementation, the method further includes: The first device displays, in the chat interface, a second chat message sent by the first contact, where the second chat message includes second service content corresponding to a second service, and a device providing the second service is associated with a device sending the second chat message. In other words, the chat APP in the first device may also receive the second service content shared by the first contact in a form of a chat message, where the second service content may be a service provided by an electronic device of the first contact. The first contact may be a friend in the chat APP, or may be a member in a group.

Subsequently, if the first device detects a second enable operation of enabling the second service content by the user in the second chat message, the first device may play the second service content in a target device in response to the second enable operation. In this way, a receiver of the chat message may also enable the service content in the chat message, and the entire enabling process does not need to jump to another application or device, so that the user can use, across devices, services provided by applications in different electronic devices.

In a possible implementation, after that the first device detects a second open operation of enabling the second service content by the user in the second chat message, the method further includes: The first device displays a second device list, where the second device list includes one or more electronic devices associated with the first device, and the user may select, from the second device list, the target device to enable the second service content; and in response to an operation of selecting a third device from the second device list, the first device determines the third device as the target device.

In a possible implementation, that the first device displays, in the chat interface, a second chat message sent by the first contact includes: The first device determines whether the second service content corresponding to the second service includes video content. If the video content is included, when the first device displays the second chat message in the chat interface, the second chat message may include the second service content and a video identifier corresponding to the second service content. The user may learn, by using the video identifier, that the second service content is the video content, and the user may also enable the second service content by triggering the video identifier. If the video content is not included, when the first device displays the second chat message in the chat interface, a video identifier corresponding to the second service content may not be displayed in the second chat message.

In a possible implementation, that the first device displays, in the chat interface, a second chat message sent by the first contact includes: The first device determines that the second service content corresponding to the second service includes video content. Further, the first device may determine, from one or more electronic devices associated with the first device, one or more candidate devices having a video play function. Further, when displaying the second chat message in the chat interface, the first device may display the second service content and identifiers of the one or more candidate devices in the second chat message. In this way, the user can trigger, by selecting an identifier of a corresponding candidate device, the first device to determine the target device for enabling the second service content this time.

In a possible implementation, the target device may be the first device. In this case, that the first device plays the second service content in a target device includes: The first device may jump from the chat interface to a play interface of the second service content, and enable the second service content in the play interface. For example, the first device may jump from the chat interface to a related interface of an application that provides the second service content, and enable the second service content. Alternatively, the first device may enable the second service content in the chat interface in a form of a small window. In this way, when enabling, in the chat APP, a service shared by a contact, the user does not need to leave a chat interface in a current chat APP, and can further enjoy service content in the service, to improve user experience.

In a possible implementation, after that the first device plays the second service content in a target device, the method further includes: The first device may display, in the chat interface, a prompt message indicating that the second service content is successfully played in the target device. Certainly, if the first device does not successfully play the second service content in the target device, the first device also displays, in the chat interface, a prompt message indicating that the second service content is not successfully enabled.

In a possible implementation, that the first device sends a first chat message in the chat interface includes: The first device displays, in the chat interface, the first chat message and a first user avatar that sends the first chat message, where the first user avatar includes an identifier of the second device. After that the first device sends a first chat message in the chat interface, if the first device displays, in the chat interface, a third chat message and a second user avatar that sends the third chat message, and if the third chat message is unrelated to a service provided by the second device, the second user avatar may not include the identifier of the second device. In other words, when the chat message includes a service provided by a device, an identifier of the device may be added to a user avatar corresponding to the service, to notify the user that the service in the chat message is from a related device.

According to a second aspect, this application provides an electronic device, including a memory, a display, and one or more processors, where the memory, the display, and the processor are coupled. Certainly, the electronic device may further include an input device such as a touch sensor (the touch sensor and the display may be integrated into a touchscreen) or a mouse. The memory is configured to store computer program code, and the computer program code includes computer instructions. When the electronic device runs, the processor is configured to execute one or more computer instructions stored in the memory, so that the electronic device performs the service sharing method according to any one of the first aspect.

According to a third aspect, this application provides a service sharing system. The sharing system includes a first device and a second device. The first device displays a chat interface with a first contact, where the chat interface includes an input box for a chat message. The first device displays a first device list in response to an operation of inputting a preset symbol into the input box by a user, where the first device list includes one or more electronic devices associated with the first device. In response to an operation of selecting the second device from the first device list by the user, the first device displays a service list provided by the second device, where the service list includes one or more services provided by the second device. The first device sends a first chat message in the chat interface in response to an operation of selecting a first service from the service list by the user, where the first chat message includes first service content corresponding to the first service.

In a possible implementation, the sharing system may further include at least one of a first server, a second server, or a third server. When the sharing system includes the first server, the first device may be configured to obtain, from the first server, one or more electronic devices associated with the first device. When the sharing system includes the second server, the first device may be configured to obtain, from the second server, a service list corresponding to the second device. When the sharing system includes the third server, the first device may be configured to obtain, from the third server, the first service content corresponding to the first service.

In a possible implementation, the sharing system further includes a third device, and the third device may be configured to receive the first chat message sent by the first device.

According to a fourth aspect, this application provides a computer-readable storage medium, including computer instructions. When the computer instructions are run on the foregoing electronic device, the electronic device is enabled to perform the multi-screen collaboration method according to any one of the foregoing implementations.

According to a fifth aspect, this application provides a computer program product. When the computer program product runs on the foregoing electronic device, the electronic device is enabled to perform the multi-screen collaboration method according to any one of the foregoing implementations.

It may be understood that the electronic device, the sharing system, the computer-readable storage medium, and the computer program product provided in the foregoing aspects are all applied to the corresponding methods provided above. Therefore, for beneficial effects that can be achieved by the electronic device, the sharing system, the computer-readable storage medium, and the computer program product, refer to the beneficial effects in the corresponding systems or methods provided above. Details are not described herein again.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

The following describes implementations of embodiments in detail with reference to accompanying drawings.

A service sharing method provided in embodiments of this application may be applied to a sharing system200. The sharing system200may include one or more electronic devices and one or more servers. The electronic device may be specifically a mobile phone, a tablet computer, a television (which may also be referred to as a smart screen, a large-screen device, or the like), a notebook computer, an ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), a handheld computer, a netbook, a personal digital assistant (Personal Digital Assistant, PDA), a wearable electronic device, a vehicle-mounted device (which may also be referred to as an automobile head unit), a virtual reality device, or the like. This is not limited in embodiments of this application.

For example, as shown inFIG.2, the sharing system200includes a mobile phone201, a television202, and a server203. The mobile phone201and the television202may interact with each other by accessing a same communication network. For example, the mobile phone201and the television202may be located in a same Wi-Fi network, and interact with each other by using the Wi-Fi network. For another example, the mobile phone201and the television202may be logged in to by using a same account (for example, a Huawei account), and interact with each other by using a server corresponding to the account. The server may be the server203in the sharing system200, or may be another server.

An application (referred to as a chat APP subsequently) having a chat function may be installed in the mobile phone201. A user may use the chat APP to exchange a chat message with a chat object in the chat APP such as an added friend, a group, or an unadded stranger. Certainly, the user may also use the chat APP to exchange a chat message with a chat object such as an official account, a robot, or an applet provided by the chat APP. In subsequent embodiments, a chat object with which a user exchanges a chat message in a chat APP is uniformly referred to as a contact.

Applications such as a music APP and a video APP may be installed in the television202. The video APP is used as an example. The video APP provides application services such as playing, sharing, message leaving, and adding-to-favorites of various video files. The user can enable the video APP in the television to use these application services provided by the video APP. To be specific, the application service is a service business provided by an application for the user to implement a specific function. When running an application service, the video APP in the television may upload service content in the application service to the server203. For example, if the user adds a TV series A to favorites when the video APP in the television is running, the video APP may add the TV series A to favorites content of the user in response to an adding-to-favorites operation of the user, and notify the server203that the TV series A is added to the favorites content of the user, so that the server203updates the favorites content of the user in the video APP.

In some embodiments, in addition to providing an application service related to an application for the user, the television202may further provide one or more services related to the device, namely, the television202for the user. For example, the television202may further provide, for the user, a device service, namely, a function such as volume controlling, brightness controlling, channel switching, power-off, or power-on of the television202, or the television202may further provide, for the user, a system service such as a voice assistant or taking a screenshot. This is not limited in embodiments of this application.

In embodiments of this application, when using the chat APP in the mobile phone201to chat with a contact, the user may share a service provided by the television202with the corresponding contact. The service may be the foregoing application service, system service, or device service. In subsequent embodiments, an example in which the application service in the television202is shared is used for description.

For example, as shown inFIG.3, the mobile phone201may display a chat interface301with a contact (for example, a contact Sam) in the chat APP, and the chat interface301includes an input box302for a chat message. If the user wants to share, with the contact Sam, a related application service provided by the video APP in the television202, the user may output a preset symbol into the input box302. For example, the preset symbol may be “@”. The user may input the preset symbol into the input box302by using a keyboard, a button, a voice, or another manner. This is not limited in embodiments of this application. In some embodiments, the preset symbol may also be referred to as a reminder symbol. In subsequent embodiments, an example in which the reminder symbol is used as the preset symbol is used for description.

After detecting that the user inputs the reminder symbol “@” into the input box302, the mobile phone201may obtain an electronic device currently associated with the mobile phone201. The electronic device associated with the mobile phone201may be specifically one or more electronic devices that are logged in to by using a same account as the mobile phone201, or one or more electronic devices that access a same communication network (for example, a Wi-Fi network or a Bluetooth network) as the mobile phone201. Certainly, the electronic device associated with the mobile phone201may be another electronic device, for example, an electronic device bound to a familiarity number with the mobile phone201, or an electronic device that handles a same service as the mobile phone201. This is not limited in embodiments of this application.

For example, the mobile phone201may detect another electronic device located in a same Wi-Fi network as the mobile phone201. For another example, the mobile phone201may obtain, from a server (for example, the server203), another electronic device that is logged in to by using a same account as the mobile phone201. Further, as shown inFIG.4, the mobile phone201may display one or more detected electronic devices in a selection interface401(which may also be referred to as a reminder interface) in the chat APP. For example, the mobile phone201may display the detected television202, television203, and speaker204in the selection interface401. In this way, the user can select, from the selection interface401, an electronic device of which an application service is to be shared. Certainly, the selection interface401may further include a contact in the chat APP. This is not limited in embodiments of this application.

For example, the user selects the television202from the selection interface401. After the mobile phone201detects that the user taps the television202in the selection interface401, it indicates that the user wants to share an application service provided by the television202with the contact Sam. As shown inFIG.5, the mobile phone201may return to the chat interface301, and input, into the input box302of the chat interface301, “the television202” selected by the user. In addition, the mobile phone201may display, in the chat interface301, one or more application services provided by the television202. For example, the mobile phone201may display, near the input box302, three application services: “My Favorites”501, “Latest Popular”502, and “Historical Play”503, provided by the video APP in the television202for the user to select.

For example, a developer may preset, in the server203, application service lists corresponding to electronic devices of different types. For example, for a large-screen electronic device of a television type, it may be set that a corresponding application service list includes the three application services: “My Favorites”501, “Latest Popular”502, and “Historical Play”503. The three application services may be from the video APP. For another example, for an audio output device of a speaker type, it may be set that a corresponding application service list includes two application services: “Frequently Listen” and “Best Album”. The two application services may be from the music APP. After the mobile phone201detects that the user selects the television202from the selection interface401, the mobile phone201may send a request to the server203to request to obtain an application service list corresponding to the television202. Further, in response to the request, the server203may obtain a corresponding application service list based on a device type of the television202, and send the obtained application service list to the mobile phone201. In this way, the mobile phone201may display an application service in the application service list in the chat interface301shown inFIG.5.

Still as shown inFIG.5, the user may select, from the three application services: “My Favorites”501, “Latest Popular”502, and “Historical Play”503, a specific application service that needs to be shared with the contact Sam. For example, if it is detected that the user selects the application service “My Favorites”501, the mobile phone201may send a query instruction corresponding to “My Favorites”501to the server203, so that the server203may query, based on the query instruction, specific favorites content that is added to favorites by the user by using the video APP in the television202. For example, the user adds a TV series A, a TV series B, and a movie C to favorites. Further, the server203may send the queried specific favorites content to the mobile phone201. After the mobile phone201receives the specific favorites content that is sent by the server203and that corresponds to “My Favorites”501, as shown inFIG.6, the chat APP in the mobile phone201may send the favorites content to the contact Sam in a form of a chat message601. In this case, the mobile phone201may display, in the chat interface301, the chat message601including the foregoing favorites content.

It may be learned that, when the user chats with a contact, by entering the reminder symbol “@”, the user can trigger the mobile phone201to quickly display a related electronic device in the chat APP for the user to select. After the user selects an electronic device, the mobile phone201may continue to display, in the chat APP, an application service provided by the electronic device for the user to select. After the user selects an application service, the chat APP may share specific service content of the application service with the contact in a form of a chat message, so that the mobile phone201may share an application service in another electronic device with the contact, to implement cross-device sharing of the application service. In addition, in an entire sharing process, the user does not need to jump from the chat APP to another application or another electronic device, so that operations in the entire sharing process are simple, to improve user experience.

It should be noted that, in addition to sharing the application service provided by the video APP in the television202with the contact, an application service provided by another application in the television202may also be shared with the contact. For example, it may be preset in the server203that an application service list corresponding to an electronic device of a television type further includes a latest game provided in a game APP. In this way, after obtaining the application service list, the mobile phone201may further display an option “Latest Game” in the chat interface. If the user selects the option “Latest Game”, the mobile phone201may interact with the server203to obtain a latest game provided by the game APP in the television202, and send a link of the game to the mobile phone201, so that the mobile phone201may share the latest game provided by the game APP in the television202with the contact in a form of a chat message.

In addition, in addition to setting the reminder symbol to “@”, a person skilled in the art may set one or more other characters as the reminder symbol based on actual experience or an actual application scenario. For example, the reminder symbol may be “#”, “+”, or “+device”. This is not limited in embodiments of this application.

A specific method for sharing an application service with a contact is described in subsequent embodiments with reference to specific examples, and therefore details are not described herein again.

An example in which the mobile phone201is used as an electronic device in the sharing system200is still used.FIG.7is a schematic diagram of a structure of the mobile phone201.

The mobile phone201may include a processor110, an external memory interface120, an internal memory121, a universal serial bus (universal serial bus, USB) interface130, an antenna1, an antenna2, a mobile communication module150, a wireless communication module160, an audio module170, a speaker170A, a receiver170B, a microphone170C, a headset jack170D, a sensor module180, and the like.

It can be understood that the structure shown in this embodiment of the present invention does not constitute a specific limitation on the mobile phone201. In some other embodiments of this application, the mobile phone201may include more or fewer components than those shown in the figure, or some components may be combined, or some components may be split, or there may be a different component layout. The components shown in the figure may be implemented by hardware, software, or a combination of software and hardware.

A wireless communication function of the mobile phone201may be implemented through the antenna1, the antenna2, the mobile communication module150, the wireless communication module160, the modem processor, the baseband processor, and the like.

The mobile phone201implements a display function by using the GPU, a display194, the application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display194and the application processor. The GPU is configured to perform mathematical and geometrical calculation, and is configured to render an image. The processor110may include one or more GPUs that execute program instructions to generate or change display information.

The mobile phone201may implement a photographing function by using the ISP, a camera193, the video codec, the GPU, the display194, the application processor, and the like.

The digital signal processor is configured to process a digital signal, and may process another digital signal in addition to a digital image signal. For example, when the mobile phone201selects a frequency, the digital signal processor is configured to perform Fourier transform on frequency energy, and the like.

The video codec is configured to compress or decompress a digital video. The mobile phone201may support one or more video codecs. In this way, the mobile phone201can play or record videos in a plurality of coding formats, for example, moving picture experts group (moving picture experts group, MPEG)-1, MPEG-2, MPEG-3, and MPEG-4.

The internal memory121may be configured to store computer-executable program code. The executable program code includes instructions. The processor110runs the instructions stored in the internal memory121, to perform various function applications of the mobile phone201and data processing. The internal memory121may include a program storage area and a data storage area. The program storage area may store an operating system, an application required by at least one function (for example, a voice playing function or an image playing function), and the like. The data storage area may store data (such as audio data and an address book) and the like created during use of the mobile phone201. In addition, the internal memory121may include a high-speed random access memory, or may include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory, or a universal flash storage (universal flash storage, UFS).

The mobile phone201may implement an audio function such as music playing or recording by using the audio module170, the speaker170A, the receiver170B, the microphone170C, the headset jack170D, the application processor, and the like.

The speaker170A, also referred to as a “loudspeaker”, is configured to convert an audio electrical signal into a sound signal. The mobile phone201may be used to listen to music or answer a call in a hands-free mode over the speaker170A.

The receiver170B, also referred to as an “earpiece”, is configured to convert an audio electrical signal into a sound signal. When the mobile phone201answers a call or receives voice information, the receiver170B may be put close to a human ear to listen to a voice.

The microphone170C, also referred to as a “mike” or a “mic”, is configured to convert a sound signal into an electrical signal. When making a call or sending voice information, a user may make a sound near the microphone170C through the mouth of the user, to input a sound signal to the microphone170C. At least one microphone170C may be disposed in the mobile phone201. In some other embodiments, two microphones170C may be disposed in the mobile phone201, to collect a sound signal and further implement a noise reduction function. In some other embodiments, three, four, or more microphones170C may alternatively be disposed in the mobile phone201, to collect a sound signal, implement noise reduction, identify a sound source, implement a directional recording function, and the like.

The sensor module180may include a pressure sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, an optical proximity sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

Certainly, the mobile phone201may further include a charging management module, a power management module, a battery, a button, an indicator, one or more SIM card interfaces, and the like. This is not limited in this embodiment of this application.

A software system of the mobile phone201may use a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In this embodiment of this application, an Android system of a layered architecture is used as an example to describe a software structure of the mobile phone201.

FIG.8is a block diagram of the software structure of the mobile phone201according to an embodiment of this application.

As shown inFIG.8, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

The window manager is used to manage a window program. The window manager may obtain a size of a display, determine whether there is a status bar, perform screen locking, take a screenshot, and the like.

The content provider is used to store and obtain data, and enable the data to be accessed by an application. The data may include a video, an image, an audio, calls that are made and answered, a browsing history and bookmarks, an address book, and the like.

The view system may be used to construct a display interface of an application. Each display interface may include one or more controls. Generally, the controls may include interface elements such as an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, and a widget (Widget).

The phone manager is used to provide a communication function of the mobile phone201, for example, management of a call status (including answering, declining, or the like).

The resource manager provides various resources for an application, such as a localized character string, an icon, a picture, a layout file, and a video file.

The notification manager enables an application to display notification information in a status bar, and may be used to convey a notification message. The notification manager may automatically disappear after a short pause without requiring user interaction. For example, the notification manager is used to notify download completion, give a message notification, and the like. The notification manager may alternatively be a notification that appears in a top status bar of the system in a form of a graph or a scroll bar text, for example, a notification of an application that is run in a background, or may be a notification that appears on a screen in a form of a dialog window. For example, text information is displayed in the status bar, an alert sound is played, vibration is generated, or an indicator light blinks.

As shown inFIG.8, the system library may include a plurality of function modules, for example, SurfaceFlinger (SurfaceFlinger), a media library (Media Library), a three-dimensional graphics processing library (for example, OpenGL ES), and a 2D graphics engine (for example, SGL). The SurfaceFlinger is used to manage a display subsystem and provide integration of 2D and 3D layers for a plurality of applications. The media library supports playback and recording in a plurality of commonly used audio and video formats, static image files, and the like. The media library may support a plurality of audio and video encoding formats, for example, MPEG-4, H.264, MP3, AAC, AMR, JPG, and PNG. The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, composition, layer processing, and the like. The 2D graphics engine is a drawing engine for 2D drawing.

The kernel library includes two parts: a function that needs to be called in Java language and a kernel library of Android.

The kernel layer is a layer between hardware and software. The kernel layer includes at least a camera driver, an audio driver, a sensor driver, and the like. This is not limited in this embodiment of this application.

In an embodiment of this application, as shown inFIG.9, a chat APP having a chat function is installed at an application layer of the mobile phone201. For example, the chat APP may be a system-level application built in the mobile phone201, or may be a third-party application such as a WeChat APP or a microblog APP. The chat APP in the mobile phone201interacts with a server (for example, a cloud server901shown inFIG.9), and may share an application service provided by an application in another electronic device (for example, the television202) with a contact in the chat APP.

The cloud server901may store application service lists corresponding to different electronic devices. For example, an application service list corresponding to an electronic device of a television type includes three application services: “My Favorites”, “Latest Popular”, and “Historical Play”. The three application services may be from a video APP in a television. For example, the three application services: “My Favorites”, “Latest Popular”, and “Historical Play” all are from a video APP1in the television. Alternatively, the two application services: “My Favorites” and “Latest Popular” are from the video APP1in the television, and the application service “Historical Play” is from a video APP2in the television.

In addition, the video APP in the television202may dynamically update specific service content of the three latest application services: “My Favorites”, “Latest Popular”, and “Historical Play” to the cloud server901. For example, when a user adds a new TV series to favorites in the video APP in the television202, the television202may indicate the cloud server901to add the TV series to favorites content corresponding to “My Favorites”.

In this case, when the chat APP detects that the user uses a preset reminder symbol “@” in a chat interface with a contact to remind an electronic device, for example, the user inputs “@television202”, the chat APP may send a query request1to the cloud server901, to request the cloud server901to query an application service corresponding to the television202. Further, the cloud server901may query, in response to the query request1, the application service corresponding to the television202, including the three application services: “My Favorites”, “Latest Popular”, and “Historical Play”. In addition, the cloud server901may send the queried application service to the chat APP, and the chat APP presents the three application services: “My Favorites”, “Latest Popular”, and “Historical Play” to the user, so that the user may further select and share a specific application service in the television202with the contact.

For example, if the user selects the application service “My Favorites” in the chat APP, the chat APP may send a query request2to the cloud server901, to request the cloud server901to query specific favorites content of the application service “My Favorites” in the television202. The cloud server901may send, in response to the query request2, favorites content corresponding to “My Favorites” in the television202to the chat APP, and the chat APP sends the favorites content to the contact in a form of a chat message, to share the favorites content of the video APP in the television202to the contact in the chat APP in the mobile phone201, so as to implement a cross-device application service sharing function.

After the chat APP in the mobile phone displays the favorites content of the video APP in the chat message, a sender of the chat message may open the corresponding favorites content by operating the chat message. In addition, a receiver of the chat message may also open the corresponding favorites content by operating the chat message. This is described in detail in subsequent embodiments, and therefore details are not described herein again.

It should be noted that the cloud server901may include one or more servers. For example, as shown inFIG.10, the cloud server901may include a cloud server A corresponding to the chat APP, and the cloud server A stores correspondences between different electronic devices and different application service lists. The chat APP may send the query request1to the cloud server A, to request the cloud server A to query an application service corresponding to an electronic device (for example, the television202) selected by the user. In addition, still as shown inFIG.10, the cloud server901may further include a cloud server B corresponding to the video APP. The cloud server B may provide various video data for the video APP, and record specific service content of an application service such as playing and adding to favorites executed by the user when the user uses the video APP in the television202. When the chat APP may send the query request2to the cloud server A to request to query specific favorites content of the application service “My Favorites” in the television202, the cloud server A may obtain the specific favorites content from the cloud server B and send the specific favorites content to the chat APP. Certainly, the cloud server901may further include another server. For example, the cloud server901may further include a cloud server C, and the cloud server C may be configured to maintain account information registered and logged in by the user on each electronic device. This is not limited in this embodiment of this application.

A chat APP in a mobile phone is still used as an example. The following describes in detail the service sharing method provided in embodiments of this application with reference to the accompanying drawings.

For example, a user may use the chat APP to chat with a contact in the chat APP. For example, a user Amy may open a group named “Family” in the chat APP. In response to the operation, as shown inFIG.11, a mobile phone1(namely, a mobile phone of the user Amy) may display a chat interface1101that is in the chat APP and that is with the “Family” group, and the chat interface1101includes an input box1102for a chat message and a send button1103. In some embodiments, the mobile phone1may further display, in the chat interface1101, a shortcut menu1104used to input a chat message. For example, the shortcut menu1104may include a preset reminder symbol “@”1105, and the reminder symbol “@”1105may be used to establish an association with a contact or an electronic device in the chat message. The preset reminder symbol may alternatively be another character. This is not limited in embodiments of this application. In addition, the shortcut menu1104may further include one or more of a picture adding button, an emoticon adding button, or a positioning button.

In embodiments of this application, when the user wants to share an application service in the mobile phone1or another electronic device with the “Family” group, the user may associate the corresponding electronic device by using the reminder symbol “@”1105. For example, after the chat APP detects that the user taps the reminder symbol “@”1105in the shortcut menu1104, the chat APP may trigger the mobile phone1to detect an electronic device that currently accesses a same communication network as the mobile phone1. For example, the mobile phone1may send a query request1to a first server, so that the first server may query, in response to the query request1, an electronic device that is logged in to by using a same account as the mobile phone1. For example, if the mobile phone1, a television1, a television2, and a speaker3all are logged in to by an account whose account name is “123”, the first server may send device identifiers of the television1, the television2, and the speaker3to the mobile phone1. Certainly, the first server may also send a device identifier of the mobile phone1to the mobile phone1. The first server may be one or more servers that are operated by a mobile phone manufacturer and that are configured to maintain user account information. For example, the first server may be the cloud server C.

Further, the mobile phone1may transfer the received one or more device identifiers to the chat APP, and the chat APP displays a corresponding device list based on the received device identifier. For example, as shown inFIG.12(a), the chat APP may jump from the chat interface1101to a reminder interface1201, and display, in the reminder interface1201, a device list1202of electronic devices that access a same communication network as the mobile phone1. For example, the device list1202may include three electronic devices: a television1, a television2, and a speaker3. Alternatively, the device list1202may include the mobile phone1(namely, local device). The user may select, from the device list1202, an electronic device of which an application service is to be shared. In some embodiments, the chat APP may also display another contact in the chat APP in the reminder interface1201, for example, a recently contacted friend, group, or applet. Similarly, the user may select, from the reminder interface1201, a contact that needs to be reminded in a chat message.

In some embodiments, as shown inFIG.12(b), when displaying the device list1202, the chat APP may further display, in a folded state, the reminder interface1201in which the device list1202is located. In other words, a part of the reminder interface1201is displayed at an upper layer of the chat interface1101, and the other part of the reminder interface1201is not displayed. When the reminder interface1201is in the folded state, an expand button1203is further set in the reminder interface1201. If it is detected that the user taps the expand button1203, the chat APP may expand the reminder interface1201, to present the full reminder interface1201shown inFIG.12(a).

When there are a plurality of electronic devices in the device list1202, the plurality of electronic devices may be ranked based on a use frequency or a latest use order by the user. In some embodiments, it may be set that a maximum of a specific quantity (for example, three) of electronic devices are displayed in the device list1202. When it is found through query that a quantity of the electronic devices is greater than three, the user may trigger, by using an expand button (for example, a “More . . . ” button) in the device list1202, the chat APP to display more electronic devices.

It can be learned that, after the user inputs the reminder symbol “@” in the chat interface that is in the chat APP and that is with the contact, the chat APP may be triggered to present, in the interface, one or more electronic devices available to the user for selection by the user, to implement a function of directly @ a related device during chatting with the contact. In other words, during chatting, the user may quickly initiate a process of sharing an application service in a related device by using a method for @ the related device.

In addition, after the user inputs the reminder symbol “@”, if the user continues to input another character into the input box1102, the chat APP may hide the device list1202. Alternatively, if the user continues to input another character into the input box1102, the chat APP may retrieve the electronic device from the device list1202based on a character input by the user after “@”. For example, the chat APP may display, in the device list1202, a retrieved electronic device that includes the character input by the user. This is not limited in embodiments of this application.

An example in which the device list1202includes the television1, the television2, and the speaker3is still used, if it is detected that the user taps the television1in the device list1202, it indicates that the user wants to share an application service in the television1with the “Family” group. Further, the chat APP may send a query request2to a second server, so that the second server may query, in response to the query request2, an application service corresponding to the television1.

The second server may be one or more servers configured to operate the chat APP. For example, the second server may be the cloud server A shown inFIG.10. If the chat APP is a built-in system-level application of the mobile phone1, the second server may be the same as the first server. The second server stores correspondences between electronic devices of different types, different application service lists, and corresponding operation instructions. For example, as shown in Table 1, an application service list corresponding to an electronic device of a television type includes three application services: “Latest Popular”, “My Favorites”, and “Historical Play”; and an application service list corresponding to an electronic device of a speaker type includes two application services: “New Song Express” and “Historical Play”. Each application service corresponds to an operation instruction, and the operation instruction is used to obtain specific service content of a corresponding application service.

TABLE 1ElectronicApplicationdeviceservice listOperation instructionTelevisionLatest popularQuery a list of latest popularvideos in a video APPMy favoritesQuery favorites content in thevideo APPHistorical playQuery the latest five play recordsin the video APPSpeakerNew song expressQuery a list of latest popular musicin a music APPHistorical playQuery the latest 10 play records inthe music APP. . .. . .. . .

In this case, after the user taps the television1in the device list1202, the chat APP may add an identifier of the television1to the query request2, and send the query request2to the second server. After receiving the query request2, the second server may determine, based on the identifier of the television1in the query request2, that the television1is an electronic device of a television type. In this way, the second server may find, in the correspondence shown in Table 1, an application service list and an operation instruction that correspond to the television. Alternatively, the chat APP may identify, based on the identifier of the television1, that the television1is an electronic device of a television type. In this way, the chat APP may request, in the query request2, the second server to query an application service list and an operation instruction that correspond to the electronic device of the television type. Subsequently, the second server may send the application service list and the operation instruction that correspond to the television to the chat APP in the mobile phone1.

In some other embodiments, when the chat APP is started in the mobile phone1, the correspondence shown in Table 1 may be obtained from the second server. In this case, after the user taps the television1in the device list1202, the chat APP may query, based on the correspondence obtained by the mobile phone1, the application service list and the operation instruction that correspond to the electronic device of the television type. This is not limited in embodiments of this application.

Alternatively, the correspondences between different electronic devices and different application service lists shown in Table 1 may be stored in the mobile phone1in advance. Subsequently, after the user inputs the reminder symbol “@” in the chat interface1101in the chat APP, and taps the television1in the device list1202, the chat APP may query, in a correspondence locally stored in the mobile phone1, an application service list and an operation instruction that correspond to the electronic device of the television type. In this case, the mobile phone1does not need to interact with the server to obtain a specific application service supported by the television1.

Alternatively, after the mobile phone1detects that the user taps the television1in the device list1202, the mobile phone1may also send a query request to the television1based on the identifier of the television1. The television1may query, in response to the query request sent by the mobile phone1, an application service supported by the television1. For example, the television1may determine that the television1supports the three application services: “Latest Popular”, “My Favorites”, and “Historical Play”, so that the television1may send the queried application service to the chat APP in the mobile phone1.

As shown inFIG.13(a), when obtaining that the application services supported by the television1include “Latest Popular”, “My Favorites”, and “Historical Play”, the chat APP may jump back to the chat interface1101with the “Family” group, and display “Latest Popular”1301, “My Favorites”1302, and “Historical Play”1303in the chat interface1101. In this way, the user may select, from the chat interface1101, to specifically share an application service in the television1with a contact in the “Family” group. For example, the chat APP may display the three application services: “Latest Popular”1301, “My Favorites”1302, and “Historical Play”1303near the input box1102in the chat interface1101, so that the user can conveniently tap these application services.

Alternatively, as shown inFIG.13(b), when obtaining that the application services supported by the television1include “Latest Popular”, “My Favorites”, and “Historical Play”, the chat APP may continue to stay in the reminder interface1201, and display “Latest Popular”1301, “My Favorites”1302, and “Historical Play”1303in the reminder interface1201. For example, the chat APP may display a second-level menu near an option of the television1in the reminder interface1201, and the second-level menu includes the three application services: “Latest Popular”1301, “My Favorites”1302, and “Historical Play”1303.

An example in which the user selects the application service “My Favorites”1302is used. After detecting that the user selects “My Favorites”1302, the chat APP may send, to a third server corresponding to the video APP, a first operation instruction corresponding to “My Favorites”1302, that is, an operation instruction of “querying favorites content in the video APP”. The third server may be configured to provide, for a user who logs in to the video APP, an application service used when the video APP is used in each electronic device. For example, the third server may be the cloud server B shown inFIG.10.

For example, the chat APP may send the first operation instruction to the first server or the second server, and the first server or the second server identifies that the first operation instruction is a request for requesting to query the video APP in the television1. Further, the first server or the second server may further send a query request to the third server corresponding to the video APP, to request the third server to query favorites content that is added to favorites when the user uses the video APP in the television1. For example, the third server may query that when a user whose account name is “123” logs in to the video APP in the television1, favorites content in the video APP includes a TV series A, a TV series B, and a movie C. Further, the third server may send play links of the TV series A, the TV series B, and the movie C to the chat APP in the mobile phone by using the first server or the second server. The play links may include play links of the TV series A, the TV series B, and the movie C in the television1, or may include play links of the TV series A, the TV series B, and the movie C in the mobile phone. Certainly, the third server may further send video information such as video names, thumbnails, and play duration of the TV series A, the TV series B, and the movie C to the chat APP in the mobile phone1.

Further, as shown inFIG.14(a), after obtaining the favorites content, the chat APP in the mobile phone1may automatically send a chat message1401in the chat interface1101, where the chat message1401may display specific favorites content in a manner of a menu. For example, the menu in the chat message1401includes an option1402of the TV series A, an option1403of the TV series B, and an option1404of the movie C. The option1402corresponds to a play link1of the TV series A, the option1403corresponds to a play link2of the TV series B, and the option1404corresponds to a play link3of the movie C.

In addition, when sending the chat message1401, the chat APP may further send, to the “Family” group, chat content “@television1” that has been input by the user into the input box1102, that is, display a chat message1400in the chat interface1101. In this way, a contact receiving the chat message1401may learn, based on the chat message1400, that an application service recommended in the chat message1401is an application service used by the user in the television1.

Similarly, it may be set that a maximum of a specific quantity (for example, three) of service content of application services may be displayed in the chat message1401. When a quantity of favorites content in the application service “My Favorites” obtained by the chat APP is greater than three options, the user may trigger, by using an expand button in the chat message1401, the chat APP to display more favorites content.

Alternatively, as shown inFIG.14(b), after obtaining the favorites content, the chat APP in the mobile phone1may send the chat message1401in the chat interface1101, where the chat message1401may display specific favorites content in a manner of a card (or card group). For example, the chat message1401includes a card group including a card of the TV series A, a card of the TV series B, and a card of the movie C. When performing a slide operation on the chat message1401, the user may trigger the chat APP to sequentially display different cards in the card group. Similarly, the card of the TV series A corresponds to the play link1of the TV series A, the card of the TV series B corresponds to the play link2of the TV series B, and the card of the movie C corresponds to the play link3of the movie C.

In addition, still as shown inFIG.14(b), when sending the chat message1401, the chat APP may further add an identifier1405of the television1to an avatar of a sender of the chat message1401. In this way, a contact receiving the chat message1401may learn, based on the identifier1405, that an application service recommended in the chat message1401is an application service used by the user in the television1. In embodiments of this application, a specific form and a display effect of the identifier1405are not limited.

It can be learned that, in the foregoing process of sharing the application service, the user may select, by inputting the reminder symbol @ in the chat APP, a specific electronic device and a related application service provided by the electronic device, to send, in a manner of a chat message, the application service selected by the user to the contact. In this process, the user does not need to leave the chat APP or switch an electronic device that is being operated, and can quickly share an application service in another electronic device with the contact. In other words, the user can implement cross-device application service sharing without switching an application and an electronic device, so that the process of sharing the application service is faster.

In some other embodiments, as shown inFIG.15(a), after the chat APP displays the device list1202in the reminder interface1201, if it is detected that the user selects the television1from the device list1202, the chat APP may obtain three application services corresponding to the television1, namely, “Latest Popular”1301, “My Favorites”1302, and “Historical Play”1303, and the chat APP may further obtain specific service content of each of the three application services, for example, a list of latest popular videos in the video APP in “Latest Popular”1301, favorites content in the video APP in “My Favorites”1302, and latest five play records in the video APP in “Historical Play”1303. For a method for obtaining the application service and the specific service content in the application service by the chat APP, refer to the related descriptions in the foregoing embodiments. Details are not described herein again.

Further, as shown inFIG.15(b), the chat APP may display, in the reminder interface1201, various application services provided by the television1and the specific service content of the application services. For example, if the user taps “My Favorites”1302, the chat APP may display, in the reminder interface1201, service content1501of the application service “My Favorites”1302. For example, the service content1501includes the option1402of the TV series A, the option1403of the TV series B, and the option1404of the movie C. In this way, when selecting the electronic device, the user may preview specific service content of each application service in the electronic device, and the user may select and share an application service with a contact in a targeted manner.

For example, a button1502for sending all is set in the service content1501. The user previews the service content1501, and if the user wants to send all the service content1501to the contact, the user may tap the button1502. If it is detected that the user taps the button1502, the chat APP may send all favorites content to the contact in a form of a chat message in the form ofFIG.14(a)orFIG.14(b). For another example, the user may alternatively select an option from the service content1501, for example, the option1402of the TV series A, the option1403of the TV series B, or the option1404of the movie C. Further, the chat APP may send the option selected by the user to the contact in a form of a chat message.

In some other embodiments, in addition to selecting the electronic device and the application service in the electronic device, the user may further select a specific application from which the application service comes by inputting the reminder symbol “@” in the chat APP. For example, after the chat APP displays the device list1202in the reminder interface1201or the chat interface1101, if it is detected that the user selects the television1from the device list1202, as shown inFIG.16(a), the chat APP may further obtain one or more applications from which the application service provided by the television1comes, and display the obtained application (for example, a first video APP1601and a second video APP1602) in the reminder interface1201or the chat interface1101.

For example, the second server may store correspondences among electronic devices of different types, different applications, different application service lists, and corresponding operation instructions. For example, as shown in Table 2, an electronic device of a television type provides a first video APP and a second video APP. The first video APP supports two application services: “Latest Popular” and “My Favorites”, and the second video APP supports an application service “Historical Play”. An operation instruction associated with a corresponding application is set for each application service, and the operation instruction may be used to obtain service content of the application service from a server of the corresponding application. In this case, the chat APP may obtain, from the correspondences stored in the second server, applications corresponding to the television1, including the first video APP and the second video APP.

In this way, the user may select, from the chat interface1101shown inFIG.16(a), and share an application service in the first video APP1601, or select and share an application service in the second video APP1602. For example, the user selects the first video APP1601. As shown inFIG.16(b), the chat APP may further display, in the chat interface1101, application services supported by the first video APP1601, namely, two application services: “Latest Popular”1603and “My Favorites”1604. Subsequently, the user may continue to select, according to the method in the foregoing embodiments, an application service that needs to be shared, so that the chat APP may obtain, from a corresponding application, service content of the application service selected by the user, and share the service content with the contact in a form of a chat message.

The foregoing embodiments are described by using an example in which the user shares, in the chat APP, an application service in another electronic device with a contact. It may be understood that the user may also share, in the chat APP, an application service in the mobile phone1(that is, local device) with the contact.

For example, after the user inputs the reminder symbol “@” into the input box1102in the chat interface1101, in addition to displaying another electronic device that is found through querying and that accesses the same communication network as the mobile phone1, as shown inFIG.17(a), the chat APP may further display an option of the mobile phone1in the device list1202in the reminder interface1201, that is, a local device1701. In other words, the user may select, by inputting the reminder symbol “@”, the application service provided on the local device, and share the application service provided on the local device with the contact.

If it is detected that the user taps the local device1701, as shown inFIG.17(b), the chat APP may display, in the reminder interface1201, one or more application services provided by the mobile phone1. Certainly, the chat APP may alternatively display, in the chat interface1101, one or more application services provided by the mobile phone1. This is not limited in embodiments of this application.

For example, one or more application services that can be shared with a contact may be preset in the mobile phone1. For example, it may be set that two application services “My Favorites”1702and “My Follow”1703that are from the video APP and that are in the mobile phone1may be used to be shared with a contact in the chat APP, and it may be set that an application service “Latest Game”1704that is from the game APP and that is in the mobile phone1may be used to be shared with a contact in the chat APP. In this case, when the chat APP detects that the user taps the local device1701in the device list1202, the chat APP may display, based on the application service preset in the mobile phone1, the three application services: “My Favorites”1702, “My Follow”1703, and “Latest Game”1704in the reminder interface1201shown inFIG.17(b).

For another example, an application service list and an operation instruction that correspond to an electronic device of a mobile phone type may also be stored in the second server. In this case, when the chat APP detects that the user taps the local device1701in the device list1202, the chat APP may interact with the second server according to the method in the foregoing embodiments, to obtain one or more application services supported by the mobile phone1, and display the one or more application services in the reminder interface1201shown inFIG.17(b).

Subsequently, the user may select, from the application services displayed in the chat interface1101, an application service that needs to be shared with a contact. For example, if the user selects the application service “My Follow”1703, as shown inFIG.17(c), the chat APP may obtain specific follow content that is in the video APP in the mobile phone1and that corresponds to “My Follow”1703. In this way, the chat APP may send the obtained follow content to the “Family” group in a form of a chat message1705, to share the application service in the mobile phone1with a contact in the “Family” group. In this sharing process, the user does not need to jump from the chat APP to an interface of another APP to perform an operation, so that the process of sharing the application service is faster and more convenient, and user experience is improved.

In some embodiments, still as shown inFIG.14(a)orFIG.14(b), after the user (for example, the user Amy) sends the chat message1401to the “Family” group in the chat interface1101by using the chat APP in the mobile phone1, both a sender (namely, the user Amy) of the chat message1401and a receiver (namely, the contact in the “Family” group) of the chat message1401may select favorites content in the chat message1401, and open the favorites content. In other words, after the user shares the application service with the contact in the chat APP in a form of a chat message, both the user and the contact may trigger the chat message to enable a corresponding application service.

For example, as shown inFIG.18(a), the chat message1401displayed by the chat APP in the mobile phone1in the chat interface1101includes service content corresponding to the application service “My Favorites”, namely, specific favorites content. For example, the chat message1401includes the option1402of the TV series A, the option1403of the TV series B, and the option1404of the movie C that are added to favorites by the user in the video APP in the television1. The option1402corresponds to the play link1of the TV series A, the option1403corresponds to the play link2of the TV series B, and the option1404corresponds to the play link3of the movie C.

The play link1of the TV series A is used as an example. The play link1of the TV series A may be a play link (namely, a local link) of the TV series A in a video APP in a mobile phone, or may be a play link (namely, an external link) of the TV series A in a video APP in a television. Regardless of whether the play link1is the local link or the external link, the play link1may carry a package name (package name) of the video APP and a video link of the TV series A in the video APP. For example, the play link1may be a deep link (deep link).

When the play link1is the local link, if it is detected that the user (that is, the sender of the chat message1401) taps the option1402, the mobile phone1may run a corresponding video APP based on the package name of the video APP in the play link1, and open the TV series A in the video APP based on the video link of the TV series A in the play link1. For example, the chat APP in the mobile phone1may invoke a startActivity interface, and transfer the play link1as an input parameter to the startActivity interface, so that the startActivity interface may run a corresponding video APP and open a corresponding TV series A based on the play link1. In this case, as shown inFIG.18(b), the mobile phone1may display a play interface1801of the TV series A in the video APP, so that the sender of the chat message1401may enable a corresponding application service in the mobile phone1by using the sent chat message1401.

When the play link1is the external link, if it is detected that the user (namely, the sender of the chat message1401) taps the option1402, the mobile phone1may send a service request to the first server, where the service request carries the identifier of the television1and the play link1. After receiving the service request, the first server may send a play instruction to the television1based on the identifier of the television1, where the play instruction carries the play link1. As shown inFIG.18(c), after the television1receives the play instruction, the television1may run the video APP based on the play link1in the play instruction, and open a play interface1802of the TV series A in the video APP. Similarly, the television1may also invoke a startActivity interface, and transfer the play link1as an input parameter to the startActivity interface, so that the startActivity interface may run a corresponding video APP and open a corresponding TV series A based on the play link1.

In this way, in the chat APP, the user may not only share an application service in another electronic device across devices, but also directly trigger, in the chat APP, the electronic device that provides the application service to enable the application service. The user may enable, in a corresponding electronic device, an application service selected by the user without jumping to a plurality of pages in the mobile phone or switching between a plurality of devices.

Alternatively, when the play link1is the external link, after the mobile phone1detects that the user taps the option1402, if the mobile phone1and the television1are located in a same local area network, the mobile phone1may directly send a play instruction to the television1, where the play instruction carries the play link1. Similarly, after the television1receives the play instruction, as shown inFIG.18(c), the television1may run the video APP based on the play link1in the play instruction, and open the play interface1802of the TV series A in the video APP, so that the sender of the chat message1401may enable a corresponding application service in the television1by using the sent chat message1401.

In some embodiments, the play link1of the TV series A obtained by the chat APP in the mobile phone1may include both the local link of the TV series A and the external link of the TV series A in the television1. In this case, as shown inFIG.19(a), when the chat APP displays the chat message1401in the chat interface1101, a first play button1901and a second play button1902may be set in the option1402of the TV series A. The first play button1901may correspond to the local link of the TV series A, and the second play button1902may correspond to the external link of the TV series A. If it is detected that the user taps the first play button1901, as shown inFIG.18(b), the mobile phone1may display the play interface1801of the TV series A in the video APP based on the local link. If it is detected that the user taps the second play button1902, as shown inFIG.18(c), the mobile phone1may indicate, based on the external link, the television1to display the play interface1802of the TV series A in the video APP.

Alternatively, when the play link1of the TV series A includes both the local link of the TV series A and the external link of the TV series A in the TV set1, as shown inFIG.19(b), when the chat APP displays the option1402of the TV series A in the chat message1401, it may be set that an identifier1903of a television in the option1402corresponds to the external link, and another area in the option1402corresponds to the internal link. If it is detected that the user taps the identifier1903of the television in the option1402, as shown inFIG.18(c), the mobile phone1may indicate, based on the external link, the television1to display the play interface1802of the TV series A in the video APP. If it is detected that the user taps the another area in the option1402, as shown inFIG.18(b), the mobile phone1may display, based on the local link, the play interface1801of the TV series A in the video APP.

Alternatively, it may alternatively be set that when the user inputs a different gesture to the option1402of the TV series A in the chat message1401, the chat APP may trigger the TV series A to be played locally in the mobile phone1or in the television1. For example, when the user taps the option1402of the TV series A in the chat message1401, the mobile phone1may display the play interface1801of the TV series A in the video APP based on the local link. When the user double-taps the option1402of the TV series A in the chat message1401, the mobile phone1may indicate, based on the external link, the television1to display the play interface1802of the TV series A in the video APP. This is not limited in embodiments of this application.

In addition, after the mobile phone1successfully indicates, based on the external link, the television1to display the play interface1802of the TV series A in the video APP, the television1may send a response message indicating successful play to the mobile phone1. For example, the television1may send the response message indicating successful play to the mobile phone1by using the first server. In this case, as shown inFIG.20(a), the chat APP in the mobile phone1may display, in the chat interface, a prompt message2001indicating that the user (for example, the user Amy) successfully opens the TV series A in the television1, to prompt that the contact Amy in the “Family” group is watching the TV series A in the television1.

Correspondingly, if an exception such as a disconnection or a fault occurs on the television1, the mobile phone1cannot successfully indicate the television1to display the play interface1802of the TV series A in the video APP. For example, if the chat APP in the mobile phone1does not receive, within preset duration, the response message that is sent by the television1and that indicates successful play, the chat APP may determine that an application service selected by the user cannot be enabled in the television1. In this case, as shown inFIG.20(b), the chat APP in the mobile phone1may display, in the chat interface, a prompt message2002indicating that the television1cannot enable the application service. Certainly, the mobile phone1may further automatically use the video APP in the mobile phone1to open the TV series A, so that the user can enable the application service in the mobile phone1.

In some embodiments, after the user Amy sends the chat message1401to the “Family” group in the chat interface1101by using the chat APP in the mobile phone1, in addition to the sender (namely, the user Amy) of the chat message1401, the receiver (namely, a contact in the “Family” group) of the chat message1401may also enable a corresponding application service by using the chat message1401.

For example, a contact Sam is a member in the “Family” group, and the contact Sam may receive, by using a chat APP in a mobile phone (referred to as a mobile phone2) of the contact Sam, the chat message1401sent by Amy. As shown inFIG.21(a), after the contact Sam opens a chat interface2101that is in the chat APP and that is with the “Family” group by using the mobile phone2, the chat APP may display, in the chat interface2101, the chat message1401sent by Amy. The chat message1401includes the service content corresponding to the application service “My Favorites” used by Amy in the television1, namely, the option1402of the TV series A, the option1403of the TV series B, and the option1404of the movie C.

For example, if it is detected that the user (the user in this case is the contact Sam) taps the option1402, it indicates that the contact Sam wants to enable service content corresponding to the option1402. In this case, the chat APP may obtain one or more electronic devices that currently access a same communication network as the mobile phone2. For example, if the contact Sam logs in to the mobile phone2with an account whose name is “456”, the mobile phone2may send a query request3to the first server, so that the first server may query, in response to the query request3, another device to which the account whose name is “456” is logged in. For example, the device to which the account whose name is “456” is logged in includes a television A, a speaker B, and a speaker C. Further, as shown inFIG.21(b), the mobile phone2may display a device list2102in the chat interface2101, where the device list2102includes the television A, the speaker B, and the speaker C. Certainly, the device list2102may further include the mobile phone2of Sam, namely, a local device.

Certainly, similar to that the mobile phone1obtains the one or more electronic devices that access the same communication network as the mobile phone1, the mobile phone2may further query, in a currently accessed Wi-Fi network in a manner such as broadcast, an electronic device that accesses a same Wi-Fi network as the mobile phone2. This is not limited in embodiments of this application.

In this case, if it is detected that the user selects an electronic device from the device list2102, for example, selects the television A, it indicates that the user wants to use the television A to open the TV series A corresponding to the option1402. In this case, the mobile phone2may send the play link1corresponding to the TV series A to the television A. For example, the mobile phone2may send the play link1to the television A by using the first server. Further, as shown inFIG.21(c), the television A may enable a corresponding video APP based on the play link1, and display a play interface2103of the TV series A in the video APP. In this way, after the user receives the application service shared by the contact in the chat APP, the user may directly select a corresponding electronic device in the chat APP to enable the application service. The user may enable the application service shared by the contact in the corresponding electronic device without jumping to a plurality of pages in the mobile phone or switching between a plurality of devices, so that the user can use the application service shared by the contact more quickly.

Alternatively, in some embodiments, as shown inFIG.22(a), when the chat APP in the mobile phone2displays the chat message1401sent by Amy, the chat APP may further identify whether the service content in the chat message1401is video content. For example, the play link1corresponding to the option1402in the chat message1401includes a package name of a video APP, and the chat APP may determine, by identifying the package name of the video APP, that the option1402is video content. In this case, the chat APP may display an identifier2201of a television in the option1402, to indicate to play the TV series A in the option1402by using an electronic device of a television type.

In this case, if it is detected that the user (namely, Sam) selects the identifier2201of the television from the option1402of the chat message1401, the chat APP may obtain an electronic device whose device type is a television in electronic devices that currently access a same communication network as the mobile phone2. Further, as shown inFIG.22(b), the chat APP may display one or more obtained televisions in the device list2102, and the user selects a television that is used to enable the application service in the option1402. For example, if the user selects the television A from the device list2102, the chat APP may indicate the television A to enable the video APP, so as to play the TV series A in the play option1402.

In some embodiments, when the chat APP in the mobile phone2displays the chat message1401sent by the Amy, the chat APP may identify that the service content in the chat message1401is video content. In this way, the chat APP may further obtain one or more televisions that currently access a same communication network as the mobile phone2. If there is no television that currently accesses the same communication network as the mobile phone2, as shown inFIG.23(a), when displaying the chat message1401sent by Amy, the chat APP may not display the identifier2201of the television in the option1402, the option1403, and the option1404. Subsequently, if it is detected that the user taps an option in the chat message1401, for example, taps the option1402, as shown inFIG.23(b), the chat APP may indicate a local device (namely, the mobile phone2) to enable a video APP, and display the play interface2202of the TV series A in the video APP.

Alternatively, when the chat APP displays the chat message1401sent by Amy, it may be set that when the user inputs different gestures to the option1402in the chat message1401, the TV series A may be triggered to be played locally in the mobile phone2or in a television. Alternatively, it may be set that when the user inputs a preset gesture in different areas of the option1402in the chat message1401, the TV series A may be triggered to be played locally in the mobile phone2or in a television. This is not limited in embodiments of this application.

In some embodiments, an example in which the user selects the option1402in the chat message1401to play the TV series A in the local device is still used. After the chat APP identifies that the service content in the option1402selected by the user in the chat message1401is the video content, as shown inFIG.24, the mobile phone may further play, in a form of a small window2301(which may also be referred to as a LiveWindow) in the chat interface2101, the TV series A corresponding to the option1402. In this way, when enabling, in the chat APP, the application service shared by the contact, the user does not need to leave the chat interface2101in the current chat APP, and can further enjoy the service content in the application service, to improve user experience.

For example, a LiveWindow processing module is disposed in the mobile phone2, and the LiveWindow processing module may be disposed at an application layer of the mobile phone2in a form of an APK file, or the LiveWindow processing module may run at an application framework layer of the mobile phone2. When the chat APP in the mobile phone2detects that the user taps the option1402in the chat message1401, the chat APP may identify, by using the play link1corresponding to the option1402, that the service content in the option1402is video content. Further, as shown inFIG.25, the chat APP may send, to the LiveWindow processing module, the package name of the video APP carried in the play link1and the video link of the TV series A in the video APP. The LiveWindow processing module may create a TextureView, configured to display a small window2301, and the LiveWindow processing module may create a virtual screen2401, configured to store an interface drawn when the video APP is running. Further, the LiveWindow processing module may open the video link by using the video APP based on the package name of the video APP and the video link of the TV series A in the video APP. In addition, the LiveWindow processing module may draw, on the virtual screen2401, a play interface2402of the TV series A when the video APP is running. Further, the LiveWindow processing module may extract a video element2403in the play interface2402from the virtual screen2401, and input the extracted video element2403into the small window2301. Finally, as shown inFIG.24, the LiveWindow processing module may superimpose the small window2301to an upper layer of the chat interface2101for display, so that the TV series A may be played in the chat interface2101in the chat APP in a form of the small window2301.

In some embodiments, a function button such as pause playing, full-screen playing, entering an application, or closing a small window may be further set in the small window2301by the mobile phone2. The user may control, by operating these function buttons, the TV series A that is from the video APP and that is played in the small window2301.

Certainly, a person skilled in the art may also design another manner to enable the application service shared by the contact in the mobile phone2locally. For example, the user still taps the option1402in the chat message1401. As shown inFIG.26(a), the mobile phone2may further display the play interface of the TV series A in the video APP in a floating window2501in a form of a floating window. Alternatively, as shown inFIG.26(b), the mobile phone2may further enter a split-screen mode, display the chat interface2101in the chat APP in a window1, and display a play interface2502of the TV series A in the video APP in a window2. This is not limited in embodiments of this application.

In addition, in the foregoing embodiments, an example in which the user receives, in the chat APP, the chat message sent by the contact in the “Family” group and enables the application service in the chat message is used for description. It may be understood that the user may also receive, in the chat APP, a chat message that includes an application service and that is sent by another contact, for example, receive a chat message that includes an application service and that is sent by a friend, a stranger, an official account, or a robot in the chat APP. This is not limited in embodiments of this application.

It should be noted that the user receiving the chat message1401may locally enable a related service in the chat message1401in the mobile phone according to the foregoing methods. Similarly, the user sending the chat message1401may also locally enable the related service in the chat message1401in the mobile phone according to the foregoing methods. This is not limited in embodiments of this application.

In some other embodiments, after the user enables, in the chat APP by using an electronic device, the application service in the chat message, the chat APP may further generate and store an operation record of the user this time. For example, the operation record may include information such as service content of the application service, an electronic device that enables the application service, or a time point at which the application service is enabled.

For example, when the user Sam selects, in the chat interface2101, the television A to open the TV series A that is in the chat message1401and that corresponds to the option1402, the chat APP in the mobile phone2may generate an operation record1. The operation record1may include the play link1of the TV series A, and a play device that is the television A.

In the chat APP, an electronic device of a user may alternatively be added to a contact list of the user as a contact. As shown inFIG.27, if the user Sam opens, in the chat APP, a chat interface2601with the television A, the chat APP may display, in the chat interface2601in a form of a dialog, a record of an operation performed by the user on the television A. For example, the chat interface2601may include a chat message2602sent by the television A. The chat message2602corresponds to the operation record1, and the chat message2602includes a card of the TV series A that is being played by the television A. In addition, the chat APP may further set buttons such as pause playing, cancel playing, and cycle playing in the chat message2602, so that the user can control, in the chat message2602, an application service that is being enabled in the television A. Certainly, the chat APP may further display, in a form of a chat message based on the recorded operation record, another application service executed by the user in the television A. This is not limited in embodiments of this application.

In addition, the foregoing embodiments are described by using an example in which the user shares a related application service in the video APP with the contact in the chat APP, and the user and the contact enable the application service locally in the mobile phone or in another electronic device. It may be understood that the user may also share a related application service in another application with the contact in the chat APP, and the user and the contact may also enable an application service of another application locally in the mobile phone or in another electronic device. This is not limited in embodiments of this application.

As shown inFIG.28, an embodiment of this application discloses an electronic device, for example, the mobile phone1or the mobile phone2in the foregoing embodiments. The electronic device may specifically include a display2807, one or more processors2802, a memory2803, a communication module2808, one or more applications (not shown), and one or more computer programs2804. The foregoing components may be connected through one or more communication buses2805. The one or more computer programs2804are stored in the memory2803and are configured to be executed by the one or more processors2802. The one or more computer programs2804include instructions, and the instructions may be used to perform related steps performed by the mobile phone in the foregoing embodiments. The electronic device may further include an input device such as a touch sensor2806(the touch sensor2806and the display2807may be integrated into a touchscreen2801) or a mouse.

Based on the descriptions of the foregoing implementations, it may be clearly understood by a person skilled in the art that, for ease and brevity of description, division of the foregoing function modules is merely used as an example for illustration. In actual application, the foregoing functions may be allocated to different function modules and implemented based on a requirement, that is, an internal structure of an apparatus is divided into different function modules, to implement all or some of the functions described above. For a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments, and details are not described herein again.

The foregoing descriptions are merely specific implementations of embodiments of this application, but are not intended to limit the protection scope of embodiments of this application. Any variation or replacement within the technical scope disclosed in embodiments of this application shall fall within the protection scope of embodiments of this application. Therefore, the protection scope of embodiments of this application shall be subject to the protection scope of the claims.