WO2022028494A1 - Multi-device data collaboration method and electronic device - Google Patents

Multi-device data collaboration method and electronic device Download PDF

Info

Publication number
WO2022028494A1
WO2022028494A1 PCT/CN2021/110646 CN2021110646W WO2022028494A1 WO 2022028494 A1 WO2022028494 A1 WO 2022028494A1 CN 2021110646 W CN2021110646 W CN 2021110646W WO 2022028494 A1 WO2022028494 A1 WO 2022028494A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
data
document editing
application
interface
Prior art date
Application number
PCT/CN2021/110646
Other languages
French (fr)
Chinese (zh)
Inventor
庾能国
马红欣
冯鹏
胡俊
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022028494A1 publication Critical patent/WO2022028494A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems

Definitions

  • the embodiments of the present application relate to the field of communication technologies, and in particular, to a method and electronic device for data collaboration among multiple devices.
  • Office is the main usage scenario of personal computer (PC), and document creation is one of the main scenarios of office.
  • the main way of creating a current document is that the user sits in front of the computer and uses a keyboard or a stylus to input into a corresponding document editing application, such as word/txt and other software with a long text editing function.
  • the editing operation method of long text based on personal computer is single, and relies on the user to sit in front of the computer for a long time for input, cannot change the creation scene, and cannot meet the user's needs for the change of the manuscript creation scene.
  • Embodiments of the present application provide a multi-device data collaboration method and an electronic device, which are used in a manuscript creation scene, and can meet the scene change requirements of a user in manuscript creation.
  • an embodiment of the present application provides a multi-device data collaboration method, which is applied to a second electronic device, and the second electronic device can run a first document editing application.
  • the second electronic device displays the first document editing box of the first document editing application on the second electronic device in response to the first operation on the first document editing application of the second electronic device; the second electronic device displays the first document editing box of the first document editing application on the second electronic device;
  • the electronic device sends a first notification message to the first electronic device, where the first notification message is used to establish data cooperation between the first electronic device and the second electronic device; the second electronic device receives the first electronic device The sent first text data is displayed on the first document edit box.
  • the second electronic device can send the first notification message to the first electronic device in response to the first operation on the first document editing application of the second electronic device, so that the first electronic device can Establishing data collaboration with the second electronic device, the method is simple and convenient to establish data collaboration, effectively reduces the operational difficulty of establishing data collaboration, and improves the convenience and applicability of users for creating documents in various scenarios. There is no need for the user to open the corresponding data collaboration interface simultaneously on the second electronic device and the first electronic device to actively establish a data collaboration scenario, which improves user experience.
  • a possible implementation considering the user's personalized customization of the first document editing application corresponding to the triggering of the data collaboration scenario, and avoiding false triggering of the data collaboration scenario when data collaboration is not used, can configure document editing for the document editing application.
  • the whitelist makes the first document editing application an application in the document editing whitelist configured by the user. Thus, the user's experience of using data collaboration is improved.
  • the first operation includes at least one of the following: an operation of opening the first document editing application, an operation of clicking a document editing box in the first document editing application, switching the first document editing application. An operation of a document editing application, an operation of switching the document editing box in the first document editing application.
  • the second electronic device can determine the scene in which the user wants to enter the document editing through the above operation of the user in the first document editing application, thereby triggering the establishment of data collaboration with the first electronic device, which can reduce the user's active triggering of data collaboration
  • the tedious operation brought by the scene in addition, for users who have not used the data collaboration scene, they can also trigger data collaboration with the first electronic device without perception, which is beneficial for the user to successfully establish the data collaboration scene and improve the user's use of data collaboration. experience.
  • a first search device interface may also be displayed on the second electronic device; the first search device interface is used to at least one electronic device to which the second electronic device establishes a communication connection; the second electronic device, in response to the confirmation operation acting on the first electronic device in the at least one electronic device on the first search device interface, determines to send the The first electronic device that described the first notification message.
  • the second electronic device may establish a communication connection with at least one electronic device, at this time, the second electronic device may display at least one electronic device to the user by displaying the first checking device interface, so as to respond to the The confirmation operation of the first electronic device in the at least one electronic device on the first search device interface, to determine the first electronic device selected by the user, so that based on the needs of the user, a search between the second electronic device and the first electronic device Establish data collaboration and improve the flexibility and adaptability of data collaboration.
  • a possible implementation manner is to receive a communication connection request from the first electronic device; the communication connection request is realized by using a near field communication technology; establish a communication connection with the first electronic device, and the second electronic device A first connection message is displayed on the device; the first connection message is used to prompt the user to establish a communication connection between the second electronic device and the first electronic device.
  • the communication connection between the first electronic device and the second electronic device is realized by using the near field communication technology, which is not limited to the way that the first electronic device and the second electronic device must be in the same local area network to establish the communication connection, thereby reducing the need for communication between different electronic devices.
  • the difficulty of establishing a communication connection improves the compatibility of establishing data collaboration between different electronic devices, and improves the diversity and flexibility of scenarios for realizing data collaboration.
  • the second electronic device after the second electronic device sends the first notification message to the first electronic device, it can also receive a first response message sent by the first electronic device, where the first response message is used to confirm the first notification message.
  • the electronic device establishes data cooperation with the second electronic device; thus, the second electronic device can display the first response message on the second electronic device.
  • the first electronic device can send the first response message to the second electronic device, so that the second electronic device determines that the first electronic device and the second electronic device have established data cooperation. Further, the second electronic device displays the first response message, so that the user can determine that the second electronic device and the first electronic device have successfully established data cooperation, thereby improving user experience.
  • the second electronic device includes multiple document editing applications; a second notification message is sent to the first electronic device; the second notification message is used to notify the second electronic device of including the plurality of document editing applications; receiving a switching message sent by the first electronic device; the switching message is used to instruct the second electronic device to switch the focus of the second electronic device from the first document editing application to a second document editing application; switch the focus to the second document editing box of the second document editing application on the second electronic device; receive the third text data sent by the first electronic device, in the first electronic device The third text data is displayed on the second document edit box.
  • the user needs to perform data collaboration in the document editing boxes in the multiple document editing applications.
  • data collaboration in the editing box by sending a switching message to the second electronic device, so that the second electronic device switches the focus to the second document editing box of the second document editing application according to the switching message, so as to realize the The data collaboration scenario in which the third text data is entered in the second document editing box.
  • the applicability of data collaboration is improved.
  • the second electronic device and/or the first electronic device may interrupt the data collaboration scenario due to other events, in this application, when determining to restore the data collaboration scenario, the second electronic device may The data collaboration is resumed in the document editing application, and the third document editing application is the document editing application corresponding to the interruption of the data collaboration between the first electronic device and the second electronic device; thus, it avoids the user input caused by the interruption of the data collaboration.
  • the second text data is lost, which effectively improves the user experience.
  • a third document editing application is displayed on the second electronic device; the second electronic device receives the second text data of the first electronic device, and the third The second text data is displayed on the third document editing box of the document editing application; the second text data is text data generated by the first electronic device when the data collaboration is interrupted.
  • the first condition is: in response to a first switching operation on the application, the first switching operation is used to switch the focus of the second electronic device to the third document editing application; or, receiving the first switching operation A restore data cooperation message of an electronic device, where the restore data cooperation message is used to request to restore the data cooperation between the first electronic device and the second electronic device.
  • the user can perform the first switching operation on the second electronic device, or the user can trigger the recovery data cooperation scene through the recovery data cooperation message sent by the user from the first electronic device to the second electronic device, so that the second The electronic device displays the third document editing application, and receives the second text data sent by the first electronic device. Since the second text data is text data generated by the first electronic device when data collaboration is interrupted, for the user, the The interruption does not affect the data collaboration process, avoids the risk of data loss caused by interruption of data collaboration, and improves the user experience of using data collaboration.
  • a switched interface is displayed on the second electronic device; the second switching operation is used to The focus is switched out of the third document editing application.
  • a second notification message is sent to the first electronic device through the second electronic device; the second notification message is used to notify the second electronic device that the data cooperation between the second electronic device and the first electronic device is interrupted.
  • the second electronic device determines that the first electronic device and the second electronic device discontinue data cooperation in response to the second switching operation of the document editing application.
  • the second electronic device is triggered to send the second notification message to the first electronic device, so that the first electronic device can store the second text data generated when the data cooperation is interrupted, so as to avoid data loss caused by the interrupted data cooperation.
  • the second electronic device receives an interruption notification message of the first electronic device, where the interruption notification message is used to notify the second electronic device that the data cooperation with the first electronic device is interrupted.
  • the second electronic device determines that the first electronic device has interrupted the data collaboration through the interruption notification message, so as to prevent the second electronic device from being unaware of the interruption of the data collaboration, and improve the user experience of the data collaboration process.
  • a possible implementation manner before the second electronic device receives the second text data of the first electronic device, may also send a third notification message to the first electronic device; the third notification message is used to notify the first electronic device of An electronic device resumes data cooperation with the second electronic device.
  • the second electronic device can send a third notification message to the first electronic device when it is determined to restore the data collaboration scene, so as to notify the first electronic device that the data line collaboration scene is restored, thereby improving the efficiency of restoring the data collaboration scene, so that The first electronic device can send the second text data to the second electronic device to reduce delay and improve user experience.
  • the second electronic device may also send a third request message to the first electronic device; the third request message is used to request recovery data cooperation between the first electronic device and the second electronic device; receiving a recovery data cooperation message sent by the first electronic device; the recovery data cooperation message is used to confirm recovery of the first electronic device and the second electronic device Data collaboration for electronic devices.
  • the second electronic device can send the third request message to the first electronic device, so that the user confirms on the first electronic device whether to resume the data collaboration scenario, and after receiving the resume data collaboration scenario sent by the first electronic device After the message, the second electronic device determines to restore the data collaboration scenario, thereby triggering the display of the third document editing box, so as to receive the second text data sent by the first electronic device, and the user confirms the restoration of data collaboration to improve the recovery of the second electronic device.
  • the accuracy of the data collaboration timing improves the smoothness of the user's use of the second electronic device and the first electronic device.
  • the present application provides a method for multi-device data collaboration, which is applied to a first electronic device.
  • the first electronic device receives a first notification message from the second electronic device and displays a first prompt box; the first notification The message is used to request the first electronic device to establish data cooperation with the second electronic device; the first prompt box includes at least one of the following: first prompt information and a first control; in response to acting on the first The first user operation of the control displays a data collaboration interface; collects first voice data, converts the first voice data into first text data, and displays the first text data on the data collaboration interface; responds to the second The user operates to send the first text data to the second electronic device.
  • the first user operation may be a user's confirmation operation on the first control
  • the second user operation may be a user's confirmation operation on the data collaboration interface.
  • the first electronic device can receive the first notification message of the second electronic device, and prompt the user whether to establish data collaboration through a first prompt box, and in response to the operation of the first control, in the first prompt box
  • the data cooperation interface is displayed on an electronic device, so that the first voice data input by the user is collected, converted into first text data and sent to the second electronic device, so as to realize the data cooperation between the first electronic device and the second electronic device .
  • the process of establishing data collaboration between the first electronic device and the second electronic device is simple, and the method of sending the first notification message by the second electronic device reduces the operational difficulty of establishing data collaboration and improves the user experience in various scenarios. The ease and applicability of authoring documents.
  • the data collaboration interface further includes: editing controls; identifying the first voice data as initial text data, and displaying the initial text data on the data collaboration interface;
  • the third user operation of the editing control determines the editing instruction for the initial text data, and displays the edited initial text data on the data collaboration interface; in response to the confirmation operation acting on the data collaboration interface, all The edited initial text data is used as the first text data.
  • the recognized initial text data can be edited through the editing control of the data collaboration interface, the operability of the user inputting the text data through voice can be improved, and the format of the initial text data can also be edited through the editing control, whereby, an editing instruction for the initial text data is generated, displayed as the state of the edited initial text data, the editing ability of the text data is improved, and the operation convenience of data cooperation for inputting text on the second electronic device is improved.
  • the first text data includes: initial text data and an editing instruction for the initial text data.
  • the second electronic device displays the editing instruction of the initial text data on the second electronic device as editing After the state of the initial text data, improve the applicability of data collaboration.
  • the first electronic device may also receive a first confirmation message sent by the second electronic device, where the first confirmation message is used to indicate that the second electronic device has successfully received the first text data; thus, the first electronic device can delete the first text data displayed on the data collaboration interface.
  • the first electronic device can delete the first text data displayed on the data collaboration interface, which can improve the input voice data and the user experience.
  • the operability of editing the text data displayed on the data collaboration interface can reduce the occupation of the memory and improve the performance for the first electronic device.
  • the first electronic device further includes a short-range wireless communication device; before the first electronic device receives the first notification message from the second electronic device, the When the distance of the device meets the first distance threshold, a communication connection request is sent to the second electronic device through near field communication; the first electronic device establishes a communication connection with the second electronic device, and displays a first connection message; the first electronic device A connection message is used to prompt the user to establish a communication connection between the second electronic device and the first electronic device.
  • the first electronic device when the distance between the short-range wireless communication device of the first electronic device and the short-range wireless communication device of the second electronic device satisfies the first distance threshold, the first electronic device can be activated.
  • Establishing a communication connection with the second electronic device does not limit the fact that the first electronic device and the second electronic device are located in the same local area network, which improves the convenience and application scope of the user's use of data collaboration.
  • the first distance threshold may be set according to the short-range wireless communication device, or may be determined according to other methods, which is not limited herein.
  • the first electronic device may also send a first response message to the second electronic device; the first response message is used to confirm Establishing a data collaboration between the first electronic device and the second electronic device.
  • the user confirms the establishment of data cooperation, that is, the operation of the first control sends a first response message to the second electronic device, so that the second electronic device determines that the first electronic device and the second electronic device establish data cooperation.
  • the second electronic device includes multiple document editing applications; the first electronic device may also receive an application notification message of the second electronic device, and display the multiple document editing applications on the data collaboration interface.
  • controls of a plurality of document editing applications the application notification message is used to indicate that the second electronic device includes the plurality of document editing applications; in response to a switching operation of the controls acting on the plurality of document editing applications, to the The second electronic device sends a switching message; the switching operation is used to instruct the second electronic device to switch the focus from the first document editing application to the second document editing application; the switching message is used to instruct the second electronic device to switch the The focus of the second electronic device is switched to the second document editing box of the second document editing application; the second voice data is collected, the second voice data is converted into third text data, and the data is displayed on the data collaboration interface. third text data; sending the third text data to the second electronic device in response to a confirmation operation acting on the data collaboration interface.
  • the first electronic device can display the controls of multiple document editing applications on the data collaboration interface through the received application notification message, so as to respond to the
  • the operation of the controls of multiple document editing applications enables the user to switch between multiple document editing applications based on the first electronic device, for example, switching from the first document editing application to the second document editing application, and by sending the second electronic device
  • the device sends a switching message to cause the second electronic device to switch the focus to the second document editing box of the second document editing application, thereby implementing a data collaboration scenario of inputting third text data in the second document editing box.
  • the data collaboration function can be applied to scenarios of multiple document editing applications, and the applicability of data collaboration is improved.
  • the first electronic device caches second text data; the second text data is stored in the text data displayed on the data cooperation interface; the second condition is used to indicate that the data cooperation between the first electronic device and the second electronic device is interrupted; when the third condition is met, the data cooperation interface is displayed, and the The second text data is displayed on the data cooperation interface; the third condition is used to instruct the data cooperation recovery between the first electronic device and the second electronic device; the first electronic device reports to the second electronic device The device sends the second text data.
  • the first electronic device caches the text data displayed on the data collaboration interface, so as to avoid the loss of text input by the user due to the interruption of the data collaboration scene , when the data collaboration is restored, that is, when the third condition is met, the first electronic device sends the second text data to the second electronic device, so as to avoid the loss of the second text data input by the user caused by the interruption of the data collaboration, and cannot be transmitted to the second electronic device.
  • Electronic equipment effectively improve the user experience.
  • the second condition is: the first electronic device receives a second notification message sent by the second electronic device, and the second notification message is used to notify the second electronic device and the The data cooperation of the first electronic device is interrupted; or, the first electronic device displays the switched application interface on the first electronic device in response to the switching application operation of the first electronic device; the switching application operation uses in starting the switched application on the first electronic device.
  • the first electronic device may determine that the data cooperation has been interrupted through the second notification message sent to the first electronic device. In addition, it may also be that in the first electronic device, in response to the switching application operation of the first electronic device, it is determined that the data cooperation is interrupted.
  • the first electronic device after the first electronic device responds to the switching application operation of the first electronic device, it can also send an interruption notification message to the second electronic device; the interruption notification message is used to notify the The data cooperation between the second electronic device and the first electronic device is interrupted.
  • the first electronic device may send an interruption notification message to the second electronic device, so that the second electronic device determines that the data cooperation has been interrupted.
  • the third condition is:
  • a first trigger condition includes at least one of the following: in response to detecting a gesture to the first electronic device, it is determined that the gesture satisfies a first gesture condition; the first gesture condition includes: all The first electronic device is moved to a range where the distance from the user is greater than the first threshold and less than the second threshold; the gesture includes: lifting up or moving down; or, the first electronic device is not in a call state ; or, the camera module of the first electronic device is not in an open state; or, a third notification message sent by the second electronic device is received, and the third notification message is used to notify the first electronic device to restore data cooperation with the second electronic device; or, receiving a third request message sent by the second electronic device, where the third request message is used to request the first electronic device to resume communication with the second electronic device data cooperation of the device, the third request message is displayed in the second prompt box on the first electronic device, and in response to the operation on the second prompt box, it is confirmed to restore the first electronic device and the Data collaboration of the second electronic device.
  • the first electronic device may determine that the first electronic device wants to restore the data collaboration scene when the first trigger condition is satisfied, or the second electronic device may want to restore the data collaboration scene, and send the data to the first electronic device.
  • the third request message may also be that the second electronic device sends a third notification message to the first electronic device after confirming the restoration of data collaboration, thereby adapting to different restoration data collaboration scenarios and improving the availability of data collaboration scenarios.
  • the first electronic device in response to the operation on the second prompt box, confirms that the data cooperation between the first electronic device and the second electronic device is restored, and can also send a notification to the second electronic device.
  • the electronic device sends a restore data cooperation message; the restore data cooperation message is used to confirm restoring the data cooperation between the first electronic device and the second electronic device.
  • the first electronic device can send a resume data collaboration message to the second electronic device to notify the second electronic device to resume data collaboration, avoid false triggering of data collaboration scenarios when data collaboration is not resumed, and improve users' understanding of data collaboration. Use experience.
  • the present application provides a method for multi-device data collaboration, which is applied to a system including a first electronic device and a second electronic device, and the second electronic device can run a first document editing application.
  • the second electronic device displays the first document editing box of the first document editing application on the second electronic device in response to the first operation on the first document editing application of the second electronic device; the second electronic device displays the first document editing box of the first document editing application on the second electronic device;
  • the electronic device sends a first notification message to the first electronic device, where the first notification message is used to establish data cooperation between the first electronic device and the second electronic device; the first electronic device receives a message from the second electronic device A first notification message, displaying a first prompt box;
  • the first prompt box includes at least one of the following: first prompt information and a first control; the first prompt information is used to prompt the user whether to turn on the communication with the second electronic device data collaboration of the device; in response to a first user operation acting on the first control, displaying the data collaboration interface; collecting first voice data
  • the second electronic device receives the first text data sent by the first electronic device, and displays the first text data on the first document editing box.
  • the first user operation may be a user's confirmation operation on the first control
  • the second user operation may be a user's confirmation operation on the data collaboration interface.
  • the first document editing application is an application in the document editing whitelist configured by the user.
  • the first operation includes at least one of the following: an operation of opening the first document editing application, an operation of clicking a document editing box in the first document editing application, switching the first document editing application. An operation of a document editing application, an operation of switching the document editing box in the first document editing application.
  • the data collaboration interface further includes: editing controls; identifying the first voice data as initial text data, and displaying the initial text data on the data collaboration interface;
  • the third user operation of the editing control determines the editing instruction for the initial text data, and displays the edited initial text data on the data collaboration interface; in response to the confirmation operation acting on the data collaboration interface, the The edited initial text data is used as the first text data.
  • the first text data includes: initial text data and an editing instruction for the initial text data.
  • the first electronic device may also receive a first confirmation message sent by the second electronic device, where the first confirmation message is used to indicate that the second electronic device has successfully received the first text data; thus, the first electronic device can delete the first text data displayed on the data collaboration interface.
  • the second electronic device before the second electronic device sends the first notification message to the first electronic device, it can also display a first search device interface; the first search device interface is used to display the establishment of at least one electronic device that is communicatively connected; in response to a confirmation operation acting on the first electronic device of the at least one electronic device on the first search device interface, determining the first electronic device that sent the first notification message .
  • the first electronic device further includes a short-range wireless communication device; when the first electronic device determines that the distance from the second electronic device meets a first distance threshold, the communication is sent through near-field communication A connection request is made to the second electronic device; the second electronic device establishes a communication connection with the first electronic device, and a first connection message is displayed on the second electronic device or on the first electronic device; the first electronic device The connection message is used to prompt the user to establish a communication connection between the second electronic device and the first electronic device.
  • the first electronic device may also send a first response message to the second electronic device after responding to the first user operation acting on the first control; the first response message uses After confirming that the data cooperation between the first electronic device and the second electronic device is established.
  • the second electronic device After the second electronic device sends the first notification message to the first electronic device, it may also receive a first response message sent by the first electronic device, where the first response message is used to confirm the relationship between the first electronic device and the second electronic device.
  • the electronic device establishes the data collaboration; thus, the second electronic device can display the first response message.
  • the second electronic device includes multiple document editing applications; a second notification message is sent to the first electronic device; the second notification message is used to notify the second electronic device of including the multiple document editing applications; the first electronic device may also receive application notification messages of the second electronic device, and display the controls of the multiple document editing applications on the data collaboration interface; the application notification messages use instructing the second electronic device to include the plurality of document editing applications; sending a switching message to the second electronic device in response to a switching operation of the controls acting on the plurality of document editing applications; the switching operation using instructing the second electronic device to switch the focus from the first document editing application to the second document editing application; the second electronic device receives a switching message sent by the first electronic device; the switching message is used to instruct the second electronic device
  • the device switches the focus of the second electronic device from the first document editing application to the second document editing application; switches the focus to the second document editing box of the second document editing application on the second electronic device;
  • the first electronic device collects the second voice data, converts the second voice data into third text data, and
  • the first electronic device caches second text data; the second text data is stored in the text data displayed on the data cooperation interface; the second condition is used to indicate that the data cooperation between the first electronic device and the second electronic device is interrupted; when the third condition is met, the data cooperation interface is displayed, and the The second text data is displayed on the data cooperation interface; the third condition is used to instruct the data cooperation recovery between the first electronic device and the second electronic device; the first electronic device reports to the second electronic device The device sends the second text data.
  • the second electronic device determines that the first condition is met, the third document editing application is displayed; the second electronic device receives the second text data of the first electronic device, and displays the second text data on the third document editing box of the third document editing application.
  • the second text data is displayed; the second text data is text data generated by the first electronic device when the data cooperation is interrupted.
  • the first condition is: the second electronic device determines that in response to a first switching operation on the application, the first switching operation is used to switch the focus of the second electronic device to the third document editing application; or , the second electronic device determines to receive a recovery data cooperation message of the first electronic device, where the recovery data coordination message is used to request recovery of the data cooperation between the first electronic device and the second electronic device.
  • the second condition is: the first electronic device receives a second notification message sent by the second electronic device, and the second notification message is used to notify the second electronic device and the The data cooperation of the first electronic device is interrupted; or, the first electronic device displays the switched application interface in response to the switching application operation acting on the first electronic device; the switching application operation is used to Launch the switched application on the electronic device.
  • the second electronic device determines to display the switched interface on the second electronic device in response to the second switching operation of the document editing application; the second switching operation is used to switch the The focus of the second electronic device is switched out of the third document editing application.
  • a second notification message is sent to the first electronic device through the second electronic device; the second notification message is used for notifying the second electronic device that the data cooperation between the second electronic device and the first electronic device is interrupted.
  • the third condition is:
  • a first trigger condition includes at least one of the following: in response to detecting a gesture to the first electronic device, it is determined that the gesture satisfies a first gesture condition; the first gesture condition includes: all The first electronic device is moved to a range where the distance from the user is greater than the first threshold and less than the second threshold; the gesture includes: lifting up or moving down; or, the first electronic device is not in a call state ; or, the camera module of the first electronic device is not in an open state; or, a third notification message sent by the second electronic device is received, and the third notification message is used to notify the first electronic device to restore data cooperation with the second electronic device; or, receiving a third request message sent by the second electronic device, where the third request message is used to request the first electronic device to resume communication with the second electronic device data cooperation of the device, the third request message is displayed in the second prompt box on the first electronic device, and in response to the operation on the second prompt box, it is confirmed to restore the first electronic device and the Data collaboration of the second electronic device.
  • the first electronic device sends an interruption notification message to the second electronic device
  • the second electronic device receives the interruption notification message of the first electronic device
  • the interruption notification message is used to notify the second electronic device to communicate with The data cooperation of the first electronic device is interrupted.
  • a possible implementation manner before the second electronic device receives the second text data of the first electronic device, may also send a third notification message to the first electronic device; the third notification message is used to notify the first electronic device of An electronic device resumes data cooperation with the second electronic device.
  • the second electronic device may also send a third request message to the first electronic device; the third request message is used to request recovery
  • the first electronic device cooperates with the data of the second electronic device; the first electronic device sends a recovery data cooperation message to the second electronic device; the second electronic device receives the recovery data cooperation message sent by the first electronic device; the The restoring data collaboration message is used to confirm restoring the data collaboration between the first electronic device and the second electronic device.
  • the present application provides an electronic device comprising: a display screen; one or more processors; one or more memories; wherein the one or more memories store one or more computer programs , the one or more computer programs include instructions, and when the instructions are executed by the one or more processors, make the electronic device execute any possible technical solution in the first aspect and the second aspect.
  • an electronic device in a fifth aspect, includes modules/units for performing any possible design method of the first aspect or the second aspect; these modules/units can be implemented by hardware, or can be implemented by hardware Execute the corresponding software implementation.
  • an embodiment of the present application provides a chip, the chip is coupled with a memory in an electronic device, and implements any possible technical solution of the first aspect or the second aspect of the embodiment of the present application; ” means that two components are joined directly or indirectly to each other.
  • an embodiment of the present application provides a system, where the system includes the electronic device of the fourth aspect or the electronic device of the fifth aspect.
  • a computer program product includes: a computer program (also referred to as code, or instructions), which, when the computer program is executed, causes the computer to execute any one of the first aspect or the second aspect.
  • a computer program also referred to as code, or instructions
  • a computer-readable storage medium where the computer-readable medium stores a computer program (also referred to as code, or instruction), when it runs on a computer, causing the computer to execute the above-mentioned first aspect or the second A method in any of the possible implementations of an aspect.
  • a computer program also referred to as code, or instruction
  • a graphical user interface on an electronic device, the electronic device having a display screen, one or more memories, and one or more processors configured to execute a memory stored in the device.
  • One or more computer programs in the one or more memories, and the graphical user interface includes the information displayed when the electronic device executes any possible technical solution of the first aspect, the second aspect or the third aspect of the embodiments of the present application GUI.
  • FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • FIG. 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an Android operating system provided by an embodiment of the present application.
  • FIG. 4a is a schematic flowchart of a method for multi-device data collaboration provided by an embodiment of the present application
  • 4b to 4g are schematic diagrams of interfaces involved in document editing of the second electronic device provided by the embodiments of the present application.
  • 5a-5c are schematic diagrams of a data cooperation control interface of a second electronic device provided by an embodiment of the present application.
  • 5d is a schematic diagram of a data cooperation control interface of a second electronic device provided by an embodiment of the present application.
  • 6a-6c are schematic diagrams of interfaces of a first electronic device provided by an embodiment of the present application.
  • FIGS. 7a-7b are schematic diagrams of a data collaboration interface of a second electronic device provided by an embodiment of the present application.
  • FIGS. 8a-8b are schematic diagrams of a data collaboration interface of a first electronic device provided by an embodiment of the application.
  • 9a is a schematic diagram of a rich text field provided by an embodiment of the present application.
  • FIG. 9b is a schematic flowchart of text data parsing to a keyboard buffer provided by an embodiment of the present application.
  • FIG. 10a is a schematic flowchart of a method for multi-device data collaboration provided by an embodiment of the present application.
  • 10b is a schematic diagram of a data cooperation control interface of a first electronic device provided by an embodiment of the present application.
  • 10c is a schematic diagram of a data cooperation control interface of a second electronic device provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a gesture of a first electronic device provided by an embodiment of the present application.
  • FIG. 12a is a schematic flowchart of a method for multi-device data collaboration provided by an embodiment of the present application.
  • 12b is a schematic diagram of a data cooperation control interface of a second electronic device provided by an embodiment of the present application.
  • FIG. 12c is a schematic diagram of a data cooperation control interface of a first electronic device provided by an embodiment of the present application.
  • a mobile phone With the rapid development of society, mobile terminals such as cell phones are becoming more and more popular. Mobile phones not only have communication functions, but also have powerful processing capabilities, storage capabilities, and camera functions. Therefore, a mobile phone can not only be used as a communication tool, but also a mobile file library of the user. It can be connected with other electronic devices to transmit various personal information, photos, videos and other information of the user. Therefore, based on the mobility and convenience of the mobile terminal, document creation through the mobile terminal, combined with the document editing function of the document editing software on the personal computer, can be applied to various document creation scenarios of the user. Based on this, the present application provides a multi-device data collaboration method.
  • the embodiments of the present application can be applied to mobile phones, tablet computers, wearable devices (eg, watches, bracelets, helmets, headphones, etc.), in-vehicle devices, augmented reality (AR)/virtual reality (VR) Electronic devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices (eg, smart TVs, smart speakers, smart cameras, etc.) equipment. It can be understood that, the embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
  • the system architecture may include: a first electronic device 101 and a second electronic device 102 .
  • the first electronic device 101 and the second electronic device 102 may be connected to the same local area network, or may be connected to different local area networks.
  • the example in which the first electronic device 101 and the second electronic device 102 are connected to the same local area network may specifically be: the first electronic device 101 and the second electronic device 102 establish a wireless connection with the same wireless access point.
  • the first electronic device 101 and the second electronic device 102 are connected to the same wireless fidelity (WI-FI) hotspot.
  • WI-FI wireless fidelity
  • the first electronic device 101 and the second electronic device 102 can also be connected through the Bluetooth protocol. under the same bluetooth beacon.
  • a communication connection between the first electronic device 101 and the second electronic device 102 can also be triggered by a near field communication (NFC) tag, and encrypted information can be transmitted through a Bluetooth module for identity authentication. After the authentication is successful, data transmission is carried out in a point-to-point (P2P) manner.
  • NFC near field communication
  • P2P point-to-point
  • the second electronic device 102 also supports the network communication protocol used by the first electronic device 101 to establish a network connection.
  • the second electronic device 102 can be used as a target client for text collaboration, so that collaboration data is input in the first electronic device 101 and text data is output in the second electronic device 102 .
  • the second electronic device 102 may specifically be a mobile phone, a tablet, or a computer, and the above-mentioned computer may be a desktop computer, or a notebook computer or the like.
  • the first electronic device 101 may be a portable electronic device that also includes other functions such as a personal digital assistant and/or a music player function, such as a mobile phone, a tablet computer, a wearable device with a wireless communication function (such as smart watches).
  • portable electronic devices include, but are not limited to, carry-on Or portable electronic devices with other operating systems.
  • the portable electronic device described above may also be other portable electronic devices, such as a laptop computer (Laptop) or the like having a touch-sensitive surface (eg, a touch panel). It should also be understood that, in other embodiments of the present application, the above-mentioned first electronic device 101 may not be a portable electronic device, but a desktop computer having a touch-sensitive surface (eg, a touch panel).
  • At least one refers to one or more, and "a plurality” refers to two or more.
  • And/or which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the associated objects are an “or” relationship.
  • At least one (item) of the following or its similar expression refers to any combination of these items, including any combination of single item (item) or plural item (item).
  • At least one (a) of a, b or c may represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c Can be single or multiple.
  • the electronic device 200 may be the first electronic device 101 or the second electronic device 102 in this embodiment of the present application.
  • the first electronic device 101 is taken as the electronic device 200 as an example.
  • the provided electronic device 200 is introduced.
  • those skilled in the art can understand that the electronic device 200 shown in FIG. 2 is only an example, and does not constitute a limitation to the electronic device 200, and the electronic device 200 may have more or more than those shown in the figure. Fewer components, two or more components may be combined, or there may be different component configurations.
  • the various components shown in Figure 2 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • the electronic device 200 may include a processor 210 , an external memory interface 220 , an internal memory 221 , a USB interface 230 , a charging management module 240 , a power management module 241 , a battery 242 , an antenna 1 , an antenna 2 , a mobile communication module 251 , and a wireless communication module 252 , audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293, display screen 294, and SIM card interface 295 and so on.
  • a processor 210 may include a processor 210 , an external memory interface 220 , an internal memory 221 , a USB interface 230 , a charging management module 240 , a power management module 241 , a battery 242 , an antenna 1 , an antenna 2 , a mobile communication module 251 , and a wireless communication module 252 , audio module 270, speaker 270A, receiver
  • the sensor module 280 may include a gyroscope sensor 280A, an acceleration sensor 280B, a proximity light sensor 280G, a fingerprint sensor 280H, and a touch sensor 280K (of course, the electronic device 200 may also include other sensors, such as a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, ambient light sensor, air pressure sensor, bone conduction sensor, etc., not shown in the figure).
  • the processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or Neural-network Processing Unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 200 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 210 for storing instructions and data.
  • the memory in processor 210 is cache memory.
  • the memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
  • the processor 210 may execute the methods provided by the embodiments of the present application, and the processor 210 may include different devices.
  • the CPU and the GPU may cooperate to execute the methods provided by the embodiments of the present application, such as the multi-device data cooperation.
  • part of the algorithms are executed by the CPU, and the other part of the algorithms are executed by the GPU, so as to obtain faster processing efficiency.
  • Display screen 294 is used to display images, videos, and the like.
  • Display screen 294 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • LED organic light-emitting diode
  • AMOLED organic light-emitting diode
  • FLED flexible light-emitting diode
  • Miniled MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on.
  • the electronic device 200 may include one or N display screens 294 , where N is a positive integer greater than one.
  • the display screen 294 may be used to display information entered by or provided to the user as well as various graphical user interfaces (GUIs).
  • GUIs graphical user interfaces
  • display 294 may display photos, videos, web pages, or documents, and the like.
  • the display 294 may display the graphical user interface of the first electronic device 101 as shown in FIG. 1 .
  • the graphical user interface shown in FIG. 1 includes a status bar, a Dock bar, a hideable navigation bar, a time and weather widget (widget), and an application icon, such as a browser icon.
  • the status bar includes operator name (eg China Mobile), mobile network (eg 4G), time and remaining battery.
  • the navigation bar may include a back key icon, a home key icon, and a forward key icon.
  • the status bar may further include a Bluetooth icon, a Wi-Fi icon, an external device icon, and the like.
  • the graphical user interface shown in FIG. 1 may further include a Dock bar, and the Dock bar may include commonly used application icons and the like.
  • the display screen 294 may be an integrated flexible display screen, or a spliced display screen composed of two rigid screens and a flexible screen located between the two rigid screens.
  • the processor 210 may control to execute the first document editing application, and in response to the first operation on the first document editing application of the second electronic device, the A first document editing box of the first document editing application is displayed on the second electronic device; a first notification message is sent to the first electronic device, and the first notification message is used to establish the relationship between the first electronic device and the first electronic device.
  • Camera 293 front camera or rear camera, or a camera that can be both a front camera and a rear camera is used to capture still images or video.
  • the camera 293 may include a photosensitive element such as a lens group and an image sensor, wherein the lens group includes a plurality of lenses (convex or concave) for collecting the light signal reflected by the object to be photographed, and transmitting the collected light signal to the image sensor .
  • the image sensor generates an original image of the object to be photographed according to the light signal.
  • Internal memory 221 may be used to store computer executable program code, which includes instructions.
  • the processor 210 executes various functional applications and data processing of the electronic device 200 by executing the instructions stored in the internal memory 221 .
  • the internal memory 221 may include a storage program area and a storage data area.
  • the storage program area may store operating system, code of application programs (such as camera application, WeChat application, etc.), and the like.
  • the storage data area may store data created during the use of the electronic device 200 (eg, images, videos, etc. captured by a camera application).
  • the internal memory 221 may also store one or more computer programs 1310 corresponding to the multi-device data cooperation algorithm provided in the embodiment of the present application.
  • the one or more computer programs 1 are stored in the aforementioned memory 221 and configured to be executed by the one or more processors 210, the one or more computer programs 1310 comprising instructions which may be used to perform the execution as shown in Fig. 4a , Figure 10a and Figure 12a and other steps in the corresponding embodiments, the computer program 1310 may include running the first document editing application.
  • the processor 210 can control the second electronic device to respond to the first operation on the first document editing application of the second electronic device , displaying the first document editing box of the first document editing application on the second electronic device; the second electronic device sends a first notification message to the first electronic device, and the first notification message is used to create the The first electronic device cooperates with the data of the second electronic device; the second electronic device receives the first text data sent by the first electronic device, and displays the first text data on the first document editing box.
  • the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • non-volatile memory such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the code of the multi-device data cooperation algorithm provided in the embodiment of the present application may also be stored in an external memory.
  • the processor 210 can run the code of the multi-device data cooperation algorithm stored in the external memory through the external memory interface 220, and the processor 210 can control the second electronic device to run the first document editing application.
  • displaying a first document editing box of the first document editing application on the second electronic device In response to a first operation on the first document editing application of the second electronic device, displaying a first document editing box of the first document editing application on the second electronic device; sending a first notification message to a first electronic device, where the first notification message is used to establish data cooperation between the first electronic device and the second electronic device; receiving the first text data sent by the first electronic device, in the first electronic device The first text data is displayed on the document edit box.
  • the function of the sensor module 280 is described below.
  • the gyro sensor 280A can be used to determine the movement attitude of the electronic device 200 .
  • the angular velocity of electronic device 200 about three axes ie, x, y, and z axes
  • the gyro sensor 280A can be used to detect the current motion state of the electronic device 200, such as shaking or stillness.
  • the gyro sensor 280A can be used to detect a folding or unfolding operation acting on the display screen 294 .
  • the gyroscope sensor 280A may report the detected folding operation or unfolding operation to the processor 210 as an event to determine the folding state or unfolding state of the display screen 294 .
  • the acceleration sensor 280B can detect the magnitude of the acceleration of the electronic device 200 in various directions (generally three axes). That is, the gyro sensor 280A can be used to detect the current motion state of the electronic device 200, such as shaking or stillness. When the display screen in the embodiment of the present application is a foldable screen, the acceleration sensor 280B can be used to detect a folding or unfolding operation acting on the display screen 294 . The acceleration sensor 280B may report the detected folding operation or unfolding operation to the processor 210 as an event to determine the folding state or unfolding state of the display screen 294 .
  • Proximity light sensor 280G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the mobile phone emits infrared light outward through light-emitting diodes.
  • Phones use photodiodes to detect reflected infrared light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the phone. When insufficient reflected light is detected, the phone can determine that there are no objects near the phone.
  • the proximity light sensor 280G can be arranged on the first screen of the foldable display screen 294, and the proximity light sensor 280G can detect the first screen according to the optical path difference of the infrared signal.
  • the gyroscope sensor 280A (or the acceleration sensor 280B) may send the detected motion state information (such as angular velocity) to the processor 210 .
  • the processor 210 determines whether the current state is the hand-held state or the tripod state based on the motion state information (for example, when the angular velocity is not 0, it means that the electronic device 200 is in the hand-held state).
  • the fingerprint sensor 280H is used to collect fingerprints.
  • the electronic device 200 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
  • Touch sensor 280K also called “touch panel”.
  • the touch sensor 280K may be disposed on the display screen 294, and the touch sensor 280K and the display screen 294 form a touch screen, also called a "touch screen”.
  • the touch sensor 280K is used to detect a touch operation on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to touch operations may be provided through display screen 294 .
  • the touch sensor 280K may also be disposed on the surface of the electronic device 200 , which is different from the location where the display screen 294 is located.
  • the display screen 294 of the electronic device 200 displays a main interface, and the main interface includes icons of multiple applications (such as a camera application, a WeChat application, etc.).
  • Display screen 294 displays an interface of a camera application, such as a viewfinder interface.
  • the wireless communication function of the electronic device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 251, the wireless communication module 252, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 251 can provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 200 .
  • the mobile communication module 251 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like.
  • the mobile communication module 251 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 251 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 251 may be provided in the processor 210 .
  • the mobile communication module 251 may be provided in the same device as at least part of the modules of the processor 210 .
  • the mobile communication module 251 may also be used to exchange information with other terminal devices, that is, to send requests to other terminal devices, or the mobile communication module 251 may be used to receive requests and encapsulate the received requests into a specified format news.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 270A, the receiver 270B, etc.), or displays images or videos through the display screen 294 .
  • the modem processor may be a stand-alone device.
  • the modulation and demodulation processor may be independent of the processor 210, and may be provided in the same device as the mobile communication module 251 or other functional modules.
  • the wireless communication module 252 can provide applications on the electronic device 200 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), NFC, infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellites System
  • FM global navigation satellite system
  • NFC infrared technology
  • IR infrared technology
  • the wireless communication module 252 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 252 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 .
  • the wireless communication module 252 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 .
  • the wireless communication module 252 is configured to establish a connection with a device, and output a notification message through the device.
  • the wireless communication module 252 can be used to access the access point device and establish a connection with other terminal devices.
  • the second electronic device may establish a communication connection with the first electronic device.
  • the wireless communication module 252 can also be used to receive data from other terminal devices.
  • the electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, an application processor, and the like. Such as music playback, recording, etc.
  • the electronic device 200 may receive key 290 inputs and generate key signal inputs related to user settings and function control of the electronic device 200 .
  • the electronic device 200 may use the motor 291 to generate vibration alerts (eg, vibration alerts for incoming calls).
  • the indicator 292 in the electronic device 200 can be an indicator light, which can be used to indicate a charging state, a change in power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the SIM card interface 295 in the electronic device 200 is used to connect the SIM card. The SIM card can be contacted and separated from the electronic device 200 by inserting into the SIM card interface 295 or pulling out from the SIM card interface 295 .
  • the electronic device 200 may include more or less components than those shown in FIG. 2 , which are not limited in this embodiment of the present application.
  • the illustrated electronic device 200 is only an example, and the electronic device 200 may have more or fewer components than those shown, two or more components may be combined, or a different configuration of components may be present.
  • the various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • the software system of the terminal device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present invention take an Android system with a layered architecture as an example to exemplarily describe the software structure of a terminal device.
  • FIG. 3 is a block diagram of a software structure of a terminal device according to an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a software architecture that can run in the above-mentioned first electronic device.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the software architecture can be divided into five layers, namely the application layer, the application framework layer, the Android runtime and system library, the hardware abstraction layer and the Linux kernel layer.
  • the application layer is the top layer of the operating system and includes the native applications of the operating system, such as email client, SMS, calling, calendar, browser, contacts, etc.
  • the APP involved in the embodiments of the present application referred to as an application for short, is a software program capable of implementing one or more specific functions.
  • multiple applications can be installed in a terminal device.
  • the applications mentioned below may be system applications that have been installed when the terminal device is shipped from the factory, or may be third-party applications downloaded from the network or obtained from other terminal devices by the user during the use of the terminal device.
  • the application framework layer can include window managers, content providers, view systems, telephony managers, resource managers, notification managers, etc.
  • the window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • the application layer may be used to implement the presentation of a setting interface
  • the above setting interface may be used by the user to set the data cooperation function of the first electronic device 101 .
  • the user can enable or disable the data collaboration function in the setting interface, and can also configure the data collaboration function in the setting interface, such as the document type settings available for the data collaboration function, and the user name and password settings for login authentication.
  • the above-mentioned setting interface may be the content in the status bar or notification bar displayed on the touch screen of the first electronic device 101 , or may be the cooperation control interface displayed on the touch screen of the first electronic device 101 .
  • the application can be developed using the Java language, by calling the application programming interface (API) provided by the application framework layer, and the developer can communicate with the operating system through the application framework. interact with the underlying layers (such as hardware abstraction layer, kernel layer, etc.) to develop their own applications.
  • API application programming interface
  • the application framework is mainly a series of services and management systems of the operating system.
  • the application framework layer includes a document editing discovery service, which is mainly responsible for invoking a service interface that communicates with the hardware abstraction layer, so as to transmit a request for enabling or disabling the data collaboration function to the hardware abstraction layer , is also responsible for the management of document editing discovery service information, such as the management of document types that trigger the document editing discovery service (word ⁇ outlook ⁇ txt ⁇ notepad++ ⁇ UltraEdit, etc.), the management of user names and passwords for login authentication, etc.
  • the document editing discovery service may include various modules for managing data collaboration functions.
  • document editing discovery services include interface adapters, document discovery settings, document discovery state machines, local controllers, and more.
  • the document editing discovery service may also include configuration files.
  • the configuration file may include a whitelist of applications that can trigger document creation corresponding to the document editing discovery service.
  • the applications in the whitelist may include: document editing applications, such as word, excel, wps, txt, notepad++, UltraEdit, and so on. It can also be a mail application, for example, an email application such as Outlook, an instant messaging application, such as WeChat, DingTalk, Taobao client, etc., or a browser application, such as IE, Firefox, etc.
  • document creation for example, multimedia applications such as photo editing applications.
  • the user may need to edit the text when creating multimedia files such as photo albums, video files, and voice files. Therefore, the user can add the application to the whitelist, so that the applications in the whitelist are stored in the above configuration file, so that the Enables the document editing discovery service to determine the opening of the document editing scenario when the application in the whitelist is opened.
  • the data collaboration function is implemented as a sub-function of the original document editing function in the first electronic device.
  • the data collaboration function can be implemented as a sub-function of the Huawei Share function of the Huawei mobile phone,
  • the document editing discovery service can exist in the Huawei Share application in the form of a submodule.
  • the above interface adapter is used to provide services for the upper-layer setting interface. For example, when the user operates the cooperation switch button of the data collaboration function, the interface adapter can provide corresponding services for the setting interface, so as to change the data collaboration function in the setting interface.
  • the state of the cooperating switch button eg, switching from an off state to an on state.
  • the above document editing discovery service settings are mainly responsible for saving the document type that triggers the document editing discovery service and/or the username and password for login authentication.
  • the above manuscript finds that the state machine is mainly responsible for monitoring the running state of the underlying collaboration service.
  • the above local controller is mainly responsible for controlling the underlying signals.
  • the above configuration files are mainly used to store collaboration directories, file directories, and user collaboration scope settings.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
  • a display interface can consist of one or more views.
  • the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
  • the telephony manager is used to provide the communication function of the terminal device. For example, the management of call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
  • the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the terminal device vibrates, and the indicator light flashes.
  • the application framework layer may further include a file observer, a WI-FI service, and a notification manager.
  • these three modules are mainly responsible for cooperating with the document editing and discovery service to provide a data collaboration function.
  • the WI-FI service is used to monitor whether the first electronic device is connected to the wireless access point.
  • the notification manager is configured to transmit the notification message to the upper layer for presentation on the touch screen of the first electronic device.
  • the Android runtime includes core libraries and a virtual machine.
  • the Android runtime is responsible for the scheduling and management of the Android system.
  • the core library of the Android system consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of the Android system.
  • the application layer and the application framework layer run in virtual machines. Taking java as an example, the virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • a system library can include multiple functional modules. For example: surface manager, media library, 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • the Surface Manager manages the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • a 2D graphics engine is a drawing engine for 2D drawing.
  • the system library may further include: data collaboration configuration, document editing discovery service password, document editing discovery configuration file, responsible for providing a service interface for communicating with the application framework layer, and also responsible for managing data collaboration Services, manage document discovery configuration files, document editing discovery service passwords, etc.
  • the document discovery configuration file can be used to store the information of the document editing discovery service, for example, the password of the document editing discovery service can be used to store information such as the user name and password of the login authentication.
  • the Hardware Abstraction Layer (HAL) is the support of the application framework and an important link between the application framework layer and the Linux kernel layer. It can provide services for developers through the application framework layer.
  • the functions of the data collaboration service and the document editing discovery service in the embodiments of the present application may be implemented by configuring the first process in the hardware abstraction layer, and the first process may be a subprocess constructed separately in the hardware abstraction layer.
  • the first process may include modules such as an interface, a document editing discovery controller, a data collaboration controller, and a document editing discovery configuration interface.
  • the above interface is a service interface that communicates with the application framework layer.
  • the document editing discovery controller is used to monitor the configuration of the upper-layer document editing discovery service, for example, to control whether authentication is required.
  • the above-mentioned document editing discovery controller is mainly responsible for monitoring whether the input data in the first electronic device needs to be cached or updated.
  • a daemon process may also be included in the hardware abstraction layer, and the daemon process may be used to cache data in the first process, which may be a subprocess constructed separately in the hardware abstraction layer.
  • the Linux Kernel layer provides the core system services of the operating system, such as security, memory management, process management, network protocol stack and driver model, all based on the Linux kernel.
  • the Linux kernel also acts as an abstraction layer between the hardware and software stacks. This layer has many drivers related to electronic devices, the main drivers are: display driver; Linux-based frame buffer driver; keyboard driver as input device; Flash driver based on memory technology device; camera driver; audio driver; Bluetooth driver ; WI-FI driver, etc.
  • the Linux kernel relies on the local file system.
  • the local file system can be accessed through the collaboration service, and the collaboration data in the local file system can be configured through the service interface of the hardware abstraction layer.
  • the first electronic device is a mobile phone
  • the second electronic device is a laptop computer
  • the collaboration data in the mobile phone is accessed through the laptop computer as an example, and the text processing method for multiple devices provided in the embodiment of the present application is performed.
  • the document editing discovery service of the second electronic device determines that the second electronic device is in a scene of document editing.
  • a first document editing box of the document editing application is displayed on the second electronic device.
  • the first operation may include at least one of the following: an operation of opening a first document editing application, an operation of clicking a document editing box in the first document editing application, an operation of switching the first document editing application, and an operation of switching the first document editing application. The operation of the document editing box in the document editing application.
  • the document editing discovery service may determine the document editing application currently opened by the second electronic device by viewing the current process. For example, in response to the operation for opening the word application on the second electronic device, the second electronic device starts the process of the word application, so that the document editing discovery service can determine in the process that the process of the word application has been enabled, and for another example, in response to In the operation for opening the mail application on the second electronic device, the second electronic device starts the process of the mail application, so that the document editing discovery service can determine during the process that the process of the mail application has been enabled.
  • the above application may also be a browser application, an instant messaging application and other applications belonging to a white list, which are not limited herein.
  • the second electronic device may be provided with a document editing discovery service, for example, the document editing discovery service may identify that the current focus of the second electronic device is a text editing box.
  • the text editing box may be a text editing box in an application with a text editing function.
  • An application with a text editing function (document editing application) may be a browser, a mail sending and receiving application, a picture editing application, a calling application, a video browsing application, a document editing application, and the like.
  • the second electronic device in response to the user's operation of opening the word application, the second electronic device opens the word application, and displays a document opening interface on the display screen of the second electronic device, and the document opening interface can display A control for opening a document (eg, as shown in FIG. 4b, open control 4013), and the like.
  • the second electronic device in response to the user's operation of opening the first document, the second electronic device may display an open document interface 4016, wherein the open document interface 4016 may include a plurality of text editing boxes 4017, for example, text editing for entering a file name box, text edit box to enter the document path, search input box.
  • the second electronic device displays the editing interface of the first document in the word application. As shown in FIG.
  • the editing interface of the first document may include at least one editable text editing box, for example, it may include a main interface 4010 for text editing, a text editing box 4011 for a search bar, and a tool
  • the text edit box in the bar for example, in the start tab page in the toolbar, the text edit box 4012 of font and font size can be included, and in the page layout tab page in the toolbar, the text edit box corresponding to the paragraph can be included,
  • the interface of the formula editor may also include a text editing box 4014 for formula editing, or, as shown in Figure 4e, in the editing interface of word, It can also include an editable text editing box 4015, and the content that can be inserted in the text editing box includes: picture type, ppt type, and other editable picture types, for example, files generated by drawing applications such as viso.
  • the word application can put the editable text edit box in an editable state (for example, the dotted box represented by 4015 shown in FIG.
  • the mode identifies the editable state, which is not limited here), at this time, the user can edit the inserted content.
  • the word application may place the editable text editing box in an uneditable state, and at this time, the word application disables the function of editing the inserted content.
  • the document editing discovery service uses the document editing boxes in the application as the document editing boxes of the document editing scene.
  • the second electronic device may execute S403 after determining the document editing scene.
  • the word application can switch the focus between the text edit boxes. For example, in response to a click operation acting on the main interface, the word application displays the cursor of the first document on the main interface 4010 . At this time, the document editing discovery service can identify the current focus of the second electronic device as the main interface 4010 . In response to the click operation acting on the text edit box 4015 , the word application displays the focus of the first document within the text edit box 4015 . At this time, the document editing discovery service may identify that the current focus of the second electronic device is the text editing box 4015 . In response to the closing operation acting on the text edit box 4015 , the word application displays the focus of the first document in the main interface 4010 . At this time, the document editing discovery service may identify that the current focus of the second electronic device is the text editing box 4010 .
  • the document editing box in the data collaboration scenario can be triggered by user confirmation in the following S403, thereby establishing a data collaboration scenario through user confirmation, so as to trigger the second electronic device to send the first notification message to the first electronic device.
  • the operation to trigger the data collaboration scenario may be the control 4018 on the document editing discovery service interface that triggers the data collaboration scenario, as shown in (b) of FIG. 4f, and also It may be the document editing discovery control 4018 embedded in the document editing application, which is not limited here.
  • the second electronic device may determine to trigger the data collaboration scenario.
  • the document editing discovery service may determine the document editing box of the scene that triggers the document editing according to the type of the document editing box in the application. For example, in response to the user's operation of selecting a text editing box of a preset type, the second electronic device determines to trigger a data collaboration scenario.
  • a text editing box of a preset type may be a text editing box preset by a user or a system that may be used for data collaboration, and the text editing box may be a text editing box for inputting long text.
  • the text editing box of the preset type may be the main interface 4010, the text editing box 4010, and the like.
  • the second electronic device may be located on the main interface 4010 according to the display focus of the second electronic device, and may determine to trigger a data collaboration scenario to execute S403.
  • the second electronic device in response to the operation of the user opening the mail application, the second electronic device opens the mail application, and displays the mail application interface on the display screen of the second electronic device, as shown in Figure 4g.
  • the mail application interface may display a control for enabling mail editing (eg, the file control in (a) in FIG. 4g ), and may also include a text editing box 4021 of the search bar and the like.
  • the second electronic device displays an editing interface of the first email in the email application. As shown in (b) of FIG.
  • the editing interface of the first email may include at least one editable text editing box, for example, may include a text editing main interface 4020, a recipient editing box 4022, a subject editing box 4023, etc., and may also include a text edit box 4024 in the search bar.
  • Mode 2.1 to Mode 2.3 uses Mode 2.1 to Mode 2.3 as an example to illustrate the possible scenarios for determining the triggering of S403.
  • the document editing discovery service uses the editing boxes in the application, for example, the text editing box 4021, the main interface 4020, the recipient editing box 4022, the subject editing box 4023, the text editing box 4024, etc., as the documents of the document editing scene Edit box.
  • the second electronic device may execute S403 after determining the document editing scene.
  • the mail application can switch the focus between the text editing boxes. For example, in response to the clicking operation acting on the main interface 4020, the mail application displays the cursor of the first document on the main interface 4020. superior. At this time, the document editing discovery service may identify the current focus of the second electronic device as the main interface 4020 . In response to the operation on the text edit box 4022, the mail application displays the focus of the first document within the text edit box 4022. At this time, the document editing discovery service may identify that the current focus of the second electronic device is the text editing box 4022 .
  • the document editing box in the data collaboration scenario can be triggered by user confirmation in S403, so as to establish a data collaboration scenario through user confirmation to trigger the second electronic device to send the first notification to the first electronic device.
  • the operation for triggering the data collaboration scenario may be a control on the document editing discovery service interface that triggers the data collaboration scenario, or may be a document editing discovery control embedded in a document editing application, which is not limited herein.
  • the second electronic device may determine to trigger the data collaboration scenario. For details, reference may be made to the implementation manner in manner 1.2, which will not be repeated here.
  • the document editing discovery service may determine the document editing box of the scene that triggers the document editing according to the type of the document editing box in the application. For example, in response to the user's operation of selecting a text editing box of a preset type, the second electronic device determines to trigger a data collaboration scenario.
  • a text editing box of a preset type may be a text editing box preset by a user or a system that may be used for data collaboration, and the text editing box may be a text editing box for inputting long text.
  • the text editing box of the preset type may be the main interface 4020, the text editing box 4024, and so on.
  • the second electronic device may be located on the main interface 4020 according to the display focus of the second electronic device, and may determine to trigger a data collaboration scenario to execute S403.
  • the document editing discovery service may be implemented as a sub-function of the data collaboration function in the second electronic device.
  • the data collaboration function in a Huawei computer may be implemented as a sub-function of the Huawei Share function of the computer .
  • the user may operate on the data collaboration control interface displayed on the display screen of the computer to enable the document editing discovery service of the second electronic device.
  • the data collaboration control interface 510 may include a switch button 520 for the Huawei Share function, and a switch button for the document editing discovery service.
  • the Huawei Share function is turned on or off.
  • the document editing discovery service is turned on or off.
  • the user may operate on the collaborative control interface displayed on the display screen of the computer, or may operate the prompt box in the notification bar or task bar of the second electronic device.
  • the prompt box of the second electronic device For setting whether to enable the data collaboration function or the document editing discovery service on the second electronic device.
  • it is a prompt box of the second electronic device when the user does not operate.
  • it is the prompt box of the second electronic device displayed when the user operates the controls of the Huawei Share function.
  • the controls of the Huawei Share function include the on and off controls of the Huawei Share function .
  • the above operation may also be an operation on a related icon in the notification bar or task bar of the second electronic device, which is not limited herein.
  • the document editing whitelist and document editing control ID can be configured in this service.
  • the document editing whitelist can include: the application type that triggers the document editing discovery service, such as word ⁇ outlook ⁇ txt ⁇ notepad++ ⁇ UltraEdit, etc., when the user's input focus is switched to a whitelisted application in these whitelisted applications, the document editing discovery service is triggered to send a notification message to the second electronic device.
  • the applications in the document editing whitelist may be set for the user.
  • the data collaboration control interface 501 may further include a document editing whitelist that triggers the document editing discovery service.
  • the data cooperation control interface 501 may also include a control for the list of the first electronic devices to set the list of the first electronic devices that can be used by the data cooperation function, so as to avoid untrusted first electronic devices.
  • the device may establish a data collaboration connection with the second electronic device to improve the security of the data collaboration function.
  • the first electronic device establishes a communication connection with the second electronic device.
  • the first electronic device and the second electronic device can establish a communication connection in various ways, and the first electronic device and the second electronic device can establish a communication connection through Bluetooth, NFC, or WIFI.
  • the second electronic device triggers a communication connection through NFC to discover the first electronic device, thereby receiving a communication connection request from the first electronic device, and then establishing a communication connection with the first electronic device.
  • the mode a1-mode a3 is used as an example for illustration below.
  • the first electronic device and the second electronic device can establish a wireless connection with the same WI-FI/hotspot, and the second electronic device can find the first electronic device that establishes a communication connection with the second electronic device through a communication connection,
  • the second electronic device can broadcast a WI-FI frame, and the WI-FI frame can carry the identifier of the WI-FI hotspot that establishes a wireless connection with the second electronic device, so that the first The electronic device learns, according to the received WI-FI frame, whether the second electronic device and the first electronic device have established a wireless connection with the same WI-FI hotspot.
  • the identifier of the first electronic device discovered by the second electronic device may be displayed in the interface of the data cooperation function of the second electronic device.
  • the identifier of the first electronic device may include a device icon of the first electronic device and/or a discovery name when the first electronic device acts as a collaboration server.
  • the user enables the data collaboration function of the notebook computer.
  • the notebook computer displays a first search device interface, which may be the search device interface 530 of the data collaboration service of the notebook computer, and the search device interface 530 may include a discoverable first electronic device.
  • the device search interface includes an icon 540 of a mobile phone and a discovery name 550 when the mobile phone is used as a collaboration server.
  • the discovered devices may not be distinguished according to the types of the devices of the collaboration server in the first device search interface.
  • the user may operate the notification bar or the prompt box in the task bar of the second electronic device, and in response to the above operation, the second electronic device opens the above-mentioned first search device interface.
  • the user may operate a relevant icon in the notification bar or task bar of the second electronic device, and in response to the above operation, the second electronic device opens the above-mentioned first search device interface.
  • the second electronic device displays a login interface for prompting the user to input a user name and password for login authentication.
  • the above login interface may also be referred to as an authentication interface, which is used to prompt for input of a user name and password for login authentication.
  • the second electronic device displays The login interface is for the user to enter the user name and password for login authentication.
  • the second electronic device carries the user name and password input by the user in the communication connection request information and sends it to the first electronic device.
  • the second electronic device can carry the user name and password input by the user in the communication connection request information and send it to the first electronic device via the wireless access point.
  • the laptop computer displays a login interface 560 , which may include a pop-up window for the user to input the user name and password for login authentication.
  • the user can enter the user name and password in the above-mentioned pop-up window, and click the connect button after the input is completed.
  • the notebook computer carries the user name and password input by the user in the communication connection request information and sends it to the mobile phone via the wireless access point.
  • the first electronic device receives the communication connection request of the second electronic device from the first port, and verifies the validity of the user name and password carried in the communication connection request.
  • the first port is the service port of the LAN cooperation access protocol.
  • the first electronic device after the first electronic device enables the data cooperation function, it can monitor the first port to know in time whether there are other electronic devices that need to establish a communication connection with the device. After the first electronic device receives the communication connection request information forwarded by the second electronic device via the wireless access point from the first port, the first electronic device can verify the legitimacy of the second electronic device based on the communication connection request information, That is, the first electronic device can verify the user name and password input by the user carried in the received communication connection request information. Exemplarily, the above-mentioned validity verification operation may be performed by the application layer, or may be performed by the hardware abstraction layer.
  • the first electronic device may also display a notification message to notify the user that a device has successfully established a connection with the first electronic device , which can establish a transmission scenario with the cooperation data in the first electronic device.
  • the hardware abstraction layer performing legality verification as an example.
  • the hardware abstraction layer can send a notification message to the application framework layer that the existing electronic device has successfully established a connection with the local machine, and that it can establish data cooperation with the local machine.
  • the application framework layer receives the notification message, it forwards the notification message to the application layer.
  • the application layer can display the notification message on the notification bar or the status bar displayed on the touch screen of the mobile phone to indicate that an existing electronic device has successfully established a connection with the machine and can establish data cooperation with the machine.
  • the mobile phone may display a notification message in the notification bar displayed on the touch screen of the mobile phone to prompt the user that an existing electronic device has successfully established a connection with the local machine, and it can establish a data collaboration scenario with the local machine.
  • the second electronic device may send data cooperation request information to the first electronic device to request enabling of the data cooperation function of the first electronic device.
  • the second electronic device may find the first electronic device that establishes a communication connection with the second electronic device.
  • the manner in which the first electronic device establishes a communication connection with the second electronic device may be the various manners mentioned above.
  • the second electronic device discovers the first electronic device through a local area network; for example, it may be The first electronic device and the second electronic device are located in the same local area network, so that the second electronic device searches for all the first electronic devices in the local area network where the second electronic device is located. It is also possible that the second electronic device discovers the first electronic device by means of NFC.
  • the first electronic device and the second electronic device are not limited to be connected to the local area network, and the first electronic device can also be discovered.
  • the first electronic device is not connected to the Internet, and the second electronic device accesses the mobile network through data traffic.
  • the second electronic device can find the first electronic device by means of NFC.
  • the communication connection request may be triggered by the first electronic device, that is, the first electronic device sends a communication connection request to the second electronic device.
  • the user can scan an identifier such as a QR code of the second electronic device through the scanning function of the first electronic device, so that the first electronic device sends a communication connection to the second electronic device according to the acquired identifier of the second electronic device Alternatively, the user may obtain the NFC identifier of the second electronic device through the NFC function of the first electronic device, so as to send a communication connection request to the second electronic device.
  • the second electronic device may send a communication connection response to the first electronic device in response to the operation acting on the found communication connection request of the first electronic device.
  • the first electronic device confirms to establish a communication connection with the first electronic device according to the sending of the communication connection response.
  • the communication connection request may also be triggered by the second electronic device.
  • the user may obtain the Bluetooth identifier of the first electronic device through the Bluetooth function of the second electronic device, so as to send a communication connection request to the first electronic device.
  • the first electronic device After receiving the communication connection request, the first electronic device sends a communication connection response to the second electronic device.
  • the second electronic device confirms to establish a communication connection with the first electronic device according to the sending of the communication connection response.
  • the first electronic device may also display a connection request interface on the first electronic device, and in response to an operation acting on the communication connection request interface, confirm to establish communication with the second electronic device connect.
  • the first electronic device and the second electronic device can respectively establish a connection with the WI-FI hotspot, and when the first electronic device and the second electronic device trust each other, determine the first electronic device that can establish a communication connection with the second electronic device. an electronic device.
  • the second electronic device establishes a communication connection with the first electronic device by default to avoid disturbing the user.
  • the first electronic device and the second electronic device log into the same account.
  • the above account may be an account provided by the operator for the user, such as a glory account, a Huawei account, etc., or may be an application account, such as a social application account, a video application account, and the like.
  • the above account number may also be carried in the WI-FI frame, so that the first electronic device can know whether the second electronic device and the first electronic device have logged into the same account according to the WI-FI frame.
  • the first electronic device when the first electronic device establishes a connection with the second electronic device and the same WI-FI hotspot, obtains the second user identifier of the second electronic device, such as the Huawei account logged in by the second electronic device, and determines the second user ID of the second electronic device. Whether the second user identifier of the electronic device is the same as the first user identifier stored in the first electronic device, such as the Huawei account logged in by the first electronic device. If the first electronic device determines that the second user ID is the same as the first user ID, it indicates that the first electronic device and the second electronic device trust each other, and at this time, the first electronic device can automatically establish a communication connection with the second electronic device.
  • the mutual trust scenario may be the first electronic device and the second electronic device that have established a communication connection in history.
  • the first electronic device that has historically established a communication connection may be stored, and the second electronic device may regard the above-mentioned first electronic device as a trusted first electronic device, at this time, the second electronic device
  • An identification list of the trusted first electronic device may be displayed on the interface of the electronic device, and in response to a selection operation acting on the identification list of the trusted first electronic device, the first electronic device that currently establishes a communication connection with the second electronic device is determined.
  • the electronic device sends a communication connection request to the first electronic device, and receives a communication connection response returned by the first electronic device, so as to complete the establishment of the communication connection between the first electronic device and the second electronic device.
  • a notification message may also be displayed on the display screen of the second electronic device, for example, a first connection message is displayed on the second electronic device; the first connection message is used to prompt the user that the second electronic device is connected to the second electronic device. The first electronic device establishes a communication connection.
  • a notification message may also be displayed on the touch screen of the first electronic device for notifying the user that the second electronic device has established a communication connection with the first electronic device. For example, a first connection message is displayed on the first electronic device; the first connection message is used to prompt the user to establish a communication connection between the second electronic device and the first electronic device.
  • a first response message may also be displayed on the display screen of the second electronic device, where the first response message is used to confirm that the first electronic device and the second electronic device enable data cooperation. That is, the first response message is used to notify the user that the first electronic device has turned on the data cooperation function, and the first electronic device has established a communication connection with the second electronic device.
  • a data collaboration control interface can also be displayed on the notification bar of the second electronic device, and the data collaboration control interface includes prompt information, and the prompt information can be: "Use HUWEI p40 to perform data collaboration with this machine".
  • the data control interface 510 may also include prompt information of the first electronic device for which the connection is established (for example, the discovery name of the first electronic device is HUAWEI p40), and the prompt information may be: "Connected to HUAWEI p40".
  • the user is notified that the first electronic device has turned on the data cooperation function, and the first electronic device establishes a communication connection with the second electronic device.
  • a notification message may also be displayed on the touch screen of the first electronic device to notify the user that the first electronic device has turned on the data cooperation function and that the second electronic device has established a communication connection with the first electronic device. For example, as shown in (a) of FIG.
  • a data collaboration control interface 710 is displayed, and the data collaboration control interface 710 includes prompt information of the data collaboration service, and the prompt information may be: "Working with HUWEI MATEBOOK Data Using Your Mobile Phone".
  • the data control interface 710 may also include prompt information of the second electronic device that establishes the connection (for example, the discovery name of the second electronic device is HUWEI MATEBOOK), and the prompt information may be: "HUAWEI MATEBOOK is connected”.
  • the second electronic device can discover the first electronic device, so that subsequent users can receive the collaboration data sent by the first electronic device on the second electronic device. ready.
  • the second electronic device may preset the data cooperation function to be enabled.
  • the trigger condition for example, when the first electronic device establishes a communication connection with the second electronic device, and the second electronic device starts the application of document editing, the second electronic device automatically enables the data collaboration function.
  • the first electronic device may also preset a trigger condition for enabling the data cooperation function. For example, after the first electronic device establishes a communication connection with the second electronic device, the first electronic device automatically enables the data cooperation function. After data collaboration is enabled, a first response message is sent to the second electronic device, where the first response message is used by the second electronic device to confirm that the first electronic device and the second electronic device enable data collaboration.
  • the second electronic device can also display the first response message on the display screen, and the first response message can be displayed in the notification bar (for example, as shown in Figure 5d, "HUAWEI p40 is connected"), or it can be displayed by popping the button.
  • the window is displayed, and the specific display method can refer to the display method of the first notification message, which will not be repeated here.
  • the user can set on the data collaboration control interface in the second electronic device: the first electronic device to be searched for has enabled data collaboration functional electronic equipment. Therefore, the second electronic device only establishes a communication connection with the first electronic device with the data cooperation function turned on, so as to improve the security of the communication connection.
  • the second electronic device determines that the first electronic device enables the data cooperation function, a communication connection is established with the first electronic device.
  • the first electronic device may be preset to enable the data cooperation function.
  • the second electronic device may send a data cooperation request to the first electronic device in response to a data cooperation request operation acting on the found first electronic device.
  • the first electronic device displays a data collaboration control interface in response to the confirmation operation acting on the data collaboration request.
  • the data cooperation function is turned on.
  • the data collaboration function of the first electronic device may be implemented as a sub-function of the document editing service function in the first electronic device.
  • the data collaboration function in a Huawei mobile phone may be used as a sub-function of the Huawei Share function of the mobile phone The sub-function is realized.
  • the user operates on the cooperation control interface displayed on the touch screen of the mobile phone to set the data cooperation function of the first electronic device.
  • the data collaboration control interface 610 includes the switch button 620 of the Huawei Share function, the switch button 630 of the data collaboration service, and may also include a document editing whitelist for triggering the data collaboration function by the second electronic device, and a trusted second The second electronic device list corresponding to the electronic device.
  • the main function of the switch button 620 of the Huawei Share function is to turn on/off the Huawei Share function.
  • the user can operate the switch button 620 of the Huawei Share function.
  • the mobile phone After receiving the user's operation of the switch button 620 of the Huawei Share function, the mobile phone can call the relevant system service interface to enable/disable the Huawei Share function, and can respond to the user's operation. Operation, switch the state of the switch button 602 of the Huawei Share function (eg, switch from an off state to an on state).
  • the above-mentioned data collaboration control interface 610 may also include a real-time status identifier of the Huawei Share function (not shown in FIG. 6a ).
  • the main function of the switch button 630 of the data collaboration service is to enable/disable the data collaboration service.
  • the user can operate the switch button 630 of the data cooperation service.
  • the mobile phone After receiving the operation of the switch button 630 acting on the data cooperation service, the mobile phone can call the relevant system service interface to turn on/off the data cooperation service, and can respond to the user's request. Operation, switch the state of the switch button 630 of the data cooperation service (eg, switch from the off state to the on state).
  • the above-mentioned data cooperation control interface 610 may further include a real-time status identifier of the data cooperation service (not shown in FIG. 6a ).
  • the user operates the collaboration control 720 (input) of the data collaboration function on the first prompt box 710 in the notification bar displayed on the touch screen of the mobile phone.
  • the collaboration control 720 input of the data collaboration function on the first prompt box 710 in the notification bar displayed on the touch screen of the mobile phone.
  • the above notification bar may be an interface displayed by the user on the touch screen of the mobile phone, for example, displayed after performing a sliding operation on the home screen of the mobile phone.
  • the user when the user wants to realize the collaborative creation of text between the first electronic device and the second electronic device, the user may, in the collaborative control interface 501 displayed on the touch screen of the first electronic device,
  • the cooperation switch button 502 of the data cooperation function is touch-operated.
  • the application layer of the operating system running in the mobile phone can detect the operation of enabling the data cooperation function.
  • the application layer converts the detected operation into a request for enabling the data cooperation function, and then transfers it to the application framework layer of the operating system running in the mobile phone.
  • the application framework layer After receiving the request, the application framework layer calls the service interface that communicates with the hardware abstraction layer of the operating system running in the mobile phone, so as to transmit the request for enabling the data cooperation function to the hardware abstraction layer.
  • the hardware abstraction layer After receiving the request for enabling the data collaboration function, the hardware abstraction layer enables the data collaboration function of the mobile phone.
  • the hardware abstraction layer can start two daemons to turn on the data cooperation function of the mobile phone.
  • the first daemon process can provide functions such as data collaboration services and user authority verification, which can enable document editing and discovery services, and the second daemon process can enable the laptop to receive local text data files of the Linux kernel layer of the operating system in the mobile phone.
  • the cooperation switch button of the above-mentioned data cooperation function may be a physical button, and the button may be set on a surface of the first electronic device; when the user's finger presses or toggles the physical button (That is, the above-mentioned first input), the first electronic device enables the data cooperation function, and when the user's finger presses or toggles the physical button again, the first electronic device can disable the data cooperation function.
  • the second electronic device establishes a communication connection with the first electronic device by default, and the first electronic device automatically enables the data cooperation function to avoid disturbing the user.
  • the first electronic device may enable the data cooperation function in response to the user setting on the data cooperation control interface to enable the data cooperation function by default.
  • the first electronic device may also be the first electronic device when certain conditions are met (for example, S404, the first electronic device receives a data collaboration request from the second electronic device, the first electronic device satisfies a preset gesture, etc.) The device automatically enables the data cooperation function of the first electronic device.
  • the first electronic device and the second electronic device can respectively establish a connection with the WI-FI hotspot, and when the first electronic device and the second electronic device trust each other, determine the first electronic device that can establish a communication connection with the second electronic device.
  • An electronic device, the first electronic device can automatically enable the data cooperation function.
  • the first electronic device After the first electronic device can set a trusted second electronic device in the data cooperation control interface to establish a communication connection, the first electronic device enables the data cooperation function.
  • the interface of the second electronic device can display the identification list of the trusted first electronic device, and in response to the selection operation acting on the identification list of the trusted first electronic device, it is determined that the current connection with the second electronic device is established.
  • the first electronic device connected in communication, and the second electronic device sends a data cooperation request to the first electronic device.
  • the first electronic device confirms that the data cooperation function is enabled, and establishes a communication connection with the second electronic device.
  • the touch screen of the first electronic device may further display a collaboration state identifier, where the collaboration state identifier is used to indicate that the data collaboration function has been enabled.
  • a notification message that the data collaboration function has been enabled may be sent to the application framework layer.
  • the application framework layer receives the notification message, it forwards the notification message to the application layer.
  • the application layer can display a collaboration status indicator on the touch screen of the mobile phone for indicating that the data collaboration function has been turned on. For example, as shown in FIG.
  • the mobile phone may display a collaboration icon 740 in the status bar 730 displayed on the touch screen of the mobile phone to prompt the user that the data collaboration function of the mobile phone has been turned on.
  • the first electronic device can monitor the real-time status of the data collaboration service in the setting database by means of a registered observer. With the change of the status of the data collaboration service, the real-time status identifier of the data collaboration service can be correspondingly marked in the control interface 601. Update, you can also update the real-time status identifier of the data collaboration service in the notification bar, which is not limited here.
  • the data cooperation control interface 610 may further include a switch button visible to the second electronic device. Exemplarily, only when the switch button 630 of the data cooperation service and the switch button visible to the second electronic device establishing the communication connection are turned on at the same time, the first electronic device can receive the data cooperation request from the second electronic device.
  • the data collaboration control interface 610 may further include a pop-up box (not shown in FIG. 6a ) for switching the visible range, where the pop-up box is used for the user to switch the visible range of the data collaboration.
  • the user can operate the setting interface or the notification option of the notification bar to trigger the display of the above-mentioned pop-up box on the touch screen of the mobile phone.
  • the status of the data collaboration service changes, if the above-mentioned pop-up box is displayed, the above-mentioned pop-up box disappears.
  • the mobile phone when the user selects the visible range to be visible to "all devices", when the mobile phone is connected to an open wireless access point or allows password-free access to other electronic devices, the mobile phone may display a prompt pop-up window to remind It is risky for users to open the data collaboration service.
  • the mobile phone when the user enables the data collaboration service, the mobile phone can also verify the user's permissions, such as whether to allow the data collaboration service to be enabled and/or whether to obtain a Huawei account.
  • the user can also identify, in the collaboration control interface, the discovery name of the first electronic device as the collaboration server, the scope of collaboration data that the collaboration client can access, and the username and password for login authentication, etc. Make settings.
  • the data collaboration control interface 510 also includes a computer access verification option.
  • the user can operate the computer access verification option in the data collaboration control interface 510 .
  • the application layer can detect the above operation. After the application layer converts the above operation into a request to set the user name and password for login authentication, it is passed to the application framework layer. After the application framework layer receives the request, it provides the application layer with the function of setting the user name and password for login authentication. At this time, the application layer can display the user name and password setting window on the touch screen of the mobile phone according to the functions provided by the application framework layer in response to the above operation.
  • the user can enter the corresponding user name and password in the user name and password setting window, and click the OK button after the input is completed.
  • the application layer transmits the user name and password entered by the user to the application framework layer according to the click action on the OK button.
  • the application framework layer After the application framework layer receives the username and password, it calls the service interface that communicates with the hardware abstraction layer to pass the received username and password to the hardware abstraction layer.
  • the hardware abstraction layer stores the received user name and password in the document editing discovery service password, so as to realize the setting of the user name and password for login authentication.
  • the user name and password for login authentication are not only stored in the document editing and discovery service password of the hardware abstraction layer, but also a copy of the user name and password may be stored in the application framework layer.
  • users enter the validity of the username and password on the computer, they can query the valid username and password from the copy saved in the application layer, which reduces the interaction between layers.
  • the user may also not set the user name and password for login authentication. In this way, the user name and password for login authentication will adopt the default configuration.
  • the second electronic device for the setting of the user name and password for login authentication, if the user deletes the default user name and password for login authentication, and does not set a new user name and password for login authentication, the second electronic device is accessing
  • the first electronic device may further provide the user with an interface for selecting whether the access of the second electronic device requires authentication, so as to decide whether to enable the password-free access function.
  • the application layer can detect the above operation. After the application layer converts the above operation into a request to set the discovery name, it is passed to the application framework layer. After the application framework layer receives the request, it provides the application layer with the function of setting the discovery name. At this time, the application layer can display the setting window of the discovery name on the touch screen of the mobile phone in response to the above operation according to the function provided by the application framework layer. The user can input the corresponding name in the setting window of the discovery name, and click the OK button after the input is completed.
  • the application layer transmits the name entered by the user to the application framework layer based on the click action on the OK button.
  • the application framework layer receives the name and invokes the service interface that communicates with the hardware abstraction layer to pass the received name to the hardware abstraction layer.
  • the hardware abstraction layer After the hardware abstraction layer receives the name, it stores the received name in the data collaboration configuration file to realize the setting of the discovery name.
  • the mobile phone before the user clicks the OK button, the mobile phone can also perform legality detection on the discovery name input by the user, and the user can operate the OK button only when the discovery name input by the user is detected to be valid. If it is detected that the discovery name input by the user is invalid, a prompt box may be displayed to prompt the user that the discovery name is invalid.
  • a copy of the discovery name may also be saved in the application framework layer, so that when the discovery name needs to be queried subsequently, Can be queried from replicas held in the application layer, reducing interactions between layers.
  • the user may also not set the discovery name, in this way, the discovery name will adopt the default configuration. For example, as shown in (a) of Figure 5c, the default discovery name when the mobile phone is used as the collaboration server is: Huawei mobile phone 1. If the user does not modify the discovery name, the name of the collaboration server searched by the laptop is Huawei laptop.
  • the first electronic device when the user sets the data collaboration function for the first time, the first electronic device may display a series of guide interfaces to guide the user to set the data collaboration function, and the first electronic device may also save The user's setting preferences, so that the collaboration function can be set according to the user's setting preferences next time.
  • S401 and S402 are not limited in order. In the specific implementation process, S401 and S402 may be executed at the same time, or S402 may be executed first, and S401 may be executed later, or, S401 may be executed first, and S402 may be executed later. This is not limited.
  • the above step of enabling the data collaboration function may be performed simultaneously with establishing a network connection, or may be performed after S404, and may be specifically set according to the scene. The specific implementation performed after S404 is described in detail below.
  • the second electronic device In response to the first operation acting on the document editing application, the second electronic device sends a first notification message to the first electronic device.
  • the second electronic device may determine that the second electronic device is in the document editing scene according to the display focus of the second electronic device in the document editing box 720 in the document editing application 710, or may determine that the second electronic device is in the document editing scene according to the display focus of the second electronic device.
  • the display focus is on the document editing application 710, and it is determined that the second electronic device is in the document editing scene.
  • the second electronic device may send the first notification message to the first electronic device when it is determined that the second electronic device is in a document editing scene.
  • the second electronic device may send the first notification message to the first electronic device when it is determined that the second electronic device has triggered the data collaboration scenario.
  • the second electronic device may determine to trigger the data collaboration scenario in response to the operation acting on the document editing application.
  • Manner 1 and Manner 2 in response to the user selecting the text editing box of the document editing application and the operation of triggering the data collaboration scenario, the second electronic device determines to trigger the data collaboration scenario. It may also be that the second electronic device determines to trigger the data collaboration scenario in response to the user's operation of selecting a text editing box of a preset type.
  • the second electronic device can send the first notification message to the first electronic device to establish a data collaboration scenario.
  • the first notification message sent by the second electronic device may further include the identification of the document editing software that is the focus of the second electronic device, so as to notify the user whether the user needs to use the first electronic device to edit text in the document editing software that is the focus of the second electronic device. collaborative input.
  • the document editing application may include only one window (interface). In other possible implementations, the document editing application may include multiple windows (interfaces), for example, in the case of multiple application windows, floating windows, and the like.
  • the second electronic device includes multiple editing interfaces.
  • the applications currently opened by the second electronic device include a document editing application and an application 1, wherein the document editing application opens two interfaces, including an interface 710 of document 1 and an interface 712 of document 2.
  • the interface 710 includes an edit box 720 for document editing
  • the interface 712 includes an edit box 722 for document editing.
  • Application 1 opens an interface 711 .
  • Application 1 includes an edit box 721 for document editing.
  • the second electronic device may determine that the second electronic device is in a document editing scene when the user's focus is switched to a document editing application (the interface of the document 1 shown in FIG. 7b ). It may also be determined that the second electronic device is in the document editing scene when the user starts the document editing application (as shown in FIG. 7b on the interface of document 1 or the interface of document 2). Thus, the second electronic device may send notification messages of the plurality of document editing applications to the first electronic device; the notification messages may be used to notify the second electronic device of multiple document editing boxes of the plurality of document editing applications ; Thereby, after receiving the notification message, the first electronic device displays multiple editing preview interfaces of the multiple document editing boxes on the data collaboration interface (for example, as shown in (b) in FIG.
  • the editing preview interface in the third control or, as shown in (c) in FIG. 8a, the editing preview interface displayed corresponding to the fourth control); in response to the switching operation acting on the plurality of editing preview interfaces, the the second electronic device sends a switching message; the switching operation is used to indicate the switched second document edit box; after the second electronic device receives the switching message sent by the first electronic device, The focus switches to the second document edit box. Therefore, the second electronic device can receive the third text data sent by the first electronic device, and display the third text data on the second document editing box.
  • the data cooperation service of the first electronic device receives the first notification message, and displays the first prompt box on the first electronic device.
  • the first prompt box may be displayed in the notification bar, for example, as shown in (a) of FIG. 6b, the first prompt box 710 is displayed in the notification bar. Alternatively, the first prompt box may also be displayed on the main interface of the first electronic device. For example, as shown in (b) of FIG. 6b, the first prompt box 730 is displayed on the main interface of the first electronic device.
  • the first prompt box may include first prompt information to display the first notification message. As shown in (a) and (b) of FIG. 6b, take the identifier of the second electronic device as HUWEI MATEBOOK as an example.
  • the prompt information can be: "Use your mobile phone for data collaboration with HUWEI MATEBOOK".
  • the first control in response to an operation acting on the first prompt box, such as a sliding operation, a selection operation, etc., the first control is displayed on the first prompt box.
  • the first control 711 included in the first prompt box 710 may be a confirmation control for prompting the user to click the first control to enter the data collaboration display interface.
  • the first prompt box 710 may further include an ignore control 712 for the user to close the first prompt box 710 .
  • the first control 731 included in the first prompt box 730 may be a confirmation control for prompting the user to click the first control to enter the data collaboration display interface.
  • the first prompt box 730 may further include an ignore control 732 for the user to close the first prompt box 730 .
  • the first control may also be a cooperation switch of the data cooperation function.
  • This switch can be used to enable or disable the data collaboration function.
  • the first prompt box may be a collaboration control interface popped up by the first electronic device, and the collaboration switch button of the data collaboration function may be included in the collaboration control interface.
  • the first operation It may be the user's operation on the collaboration switch button 630 of the data collaboration function in the data collaboration control interface 610 displayed on the touch screen of the mobile phone.
  • the state of the cooperation switch button 630 of the data cooperation function will change, for example, from an off state to an on state.
  • the collaboration switch button of the data collaboration function is in an on state, the first electronic device confirms to enter the data collaboration scene.
  • the first electronic device When the user performs an operation to enable the data collaboration function on the first control, the first electronic device displays a data collaboration interface.
  • the first electronic device displays a notification message that the data cooperation function is turned off.
  • the display mode of the notification message can refer to the display mode of the first prompt box, which is not repeated here.
  • the user's operation on the cooperation switch of the data cooperation function of the first electronic device may include operations such as clicking, sliding, double-clicking, multi-gesture operation, or voice control, which is not limited herein.
  • the first user operation may be a confirmation operation.
  • the first electronic device may confirm that the data collaboration function is enabled.
  • the second electronic device sends a first response message, where the first response message is used to confirm that the data cooperation function of the first electronic device and the second electronic device is enabled. Therefore, after the second electronic device receives the first response message, the data cooperation service can be displayed on the notification bar to confirm that the first electronic device and the second electronic device establish data cooperation.
  • the first electronic device pops up a data collaboration interface on the display screen.
  • the data collaboration interface may be displayed on the first electronic device in the form of a first display frame.
  • the first display box 810 may include at least one of the following: second prompt information, and a second control 820 .
  • the second prompt information may be used to prompt that the data collaboration scenario is opened, and please perform voice input.
  • the second control 820 may include a collaboration operation button of the data collaboration function.
  • the operation button is used to enable or disable the user's voice collection, text entry, text operation and other functions.
  • the first display frame 810 may further include a third control.
  • the third control 830 may display a third control.
  • the editing preview interface of multiple document editing boxes of the second electronic device that is, the small icons (including document 1, document 2 and application 1) of the interface of multiple document editing applications opened by the second electronic device, for the user to select the collaborative creation
  • the interface of the document editing application corresponding to the document.
  • the second electronic device switches to the document editing application of the document 1 to perform data collaboration with the first electronic device.
  • the second electronic device switches to the document editing application of the document 2 to perform data collaboration with the first electronic device.
  • the second electronic device switches to the document editing box of the application 1 to perform data collaboration with the first electronic device.
  • the switching process may be that when the first electronic device determines the small icon selected by the user, it sends the corresponding interface identifier to the second electronic device, thereby realizing real-time switching.
  • Another possible way is that after the first electronic device determines the text to be sent, when sending the text to be sent to the second electronic device, the interface identifier is sent to the second electronic device at the same time, so that the second electronic device is in the After receiving the text to be sent and the interface identifier, the focus is switched to the interface, and the text to be sent is displayed on the interface.
  • each document editing application may have at least one editable document editing box
  • the multiple document editing applications of the second electronic device may be received by receiving the multiple document editing applications.
  • the first electronic device determines a plurality of document editing applications of the second electronic device.
  • multiple editing preview interfaces of the multiple document editing applications are displayed on the data collaboration interface.
  • the notification message may also be used to notify the first electronic device of multiple document editing boxes of the second electronic device, so that the first electronic device determines multiple document editing boxes of multiple document editing applications of the second electronic device.
  • multiple editing preview interfaces of the multiple document editing boxes are displayed on the data collaboration interface.
  • a switching message is sent to the second electronic device; the switching operation is used to indicate the switched second document editing frame; the switching message is used to indicate the
  • the second electronic device switches the focus of the second electronic device to the second document editing frame.
  • the current focus of the second electronic device is on the first document editing box of the first document editing application, after the second electronic device receives the switching message, the second electronic device can change the focus from the first document editing application to the first document editing box.
  • a document editing frame is switched to the second document editing frame of the second document editing application.
  • the first electronic device collects the second voice data, converts the second voice data into third text data, and displays the third text data on the data cooperation interface;
  • the second electronic device sends the third text data.
  • the second electronic device receives the third text data sent by the first electronic device, and can display the third text data on the second document editing box.
  • multiple editing preview interfaces may be displayed in the first display frame, for example, the first display frame may further include a fourth control, as shown in (c) of FIG. 8a, the fourth control 840 It may be a button of the next focus interface (eg, edit box), and in response to the operation acting on the fourth control 840, the focus in the second electronic device may be moved to the next editable edit box. Further, the fourth control 840 may further include an editing preview interface of the focus interface in the second electronic device, so as to ensure that the focus interface currently selected by the user is the focus interface required by the user.
  • the fourth control 840 may further include an editing preview interface of the focus interface in the second electronic device, so as to ensure that the focus interface currently selected by the user is the focus interface required by the user.
  • the user's operation on the cooperation operation button of the data cooperation function of the first electronic device may include operations such as clicking, sliding, double-clicking, multi-gesture operation, or voice control, which is not limited herein.
  • the user can perform voice input based on the second control 820 in the first display box.
  • the way of voice input can be the way of long pressing the second control.
  • the voice signal starts to be received; when the user releases the second control
  • the control When the control is activated, it stops receiving voice signals, thus completing a voice input.
  • the second control may be clicked to trigger the activation of the voice input function, and the current state of voice input is displayed in the first display box. In response to the user's operation of clicking the second control again, the reception of the voice signal is stopped, thereby completing a voice input.
  • the second control 820 may call a speech recognition application to recognize the input speech.
  • the speech recognition application called by the second control may be the default speech recognition application of the first electronic device, or it may be the user's voice recognition application. Identify third-party applications set in the settings interface, which is not limited here.
  • the first voice data is recognized as initial text data, and the initial text data is displayed on the data collaboration interface.
  • the first display frame may further include a preview interface 850 .
  • the preview interface 850 is used to display the converted original text data.
  • the received voice data can be recognized and converted into text while the voice is input, and the converted text can be displayed in the preview interface in the first display box. to display.
  • the input voice data is recognized, and the recognized text is displayed on the preview interface.
  • error correction can also be performed on the recognized text, and the error correction process can be displayed on the preview interface at the same time.
  • the confirmation operation acting on the first display box may be confirming that the text in the preview interface is text data to be sent.
  • the first display box 810 may further include an edit control 860, which may be a confirmation button, for the user to confirm that the text in the preview interface is the text to be sent.
  • an edit control 860 which may be a confirmation button, for the user to confirm that the text in the preview interface is the text to be sent.
  • the user Before the user confirms the text to be sent, the user can also edit the text in the preview interface.
  • the data collaboration interface can include an editing control, and the editing control is used to edit the text in the preview interface. Therefore, the first electronic device determines an editing instruction for the initial text data in response to the third user operation acting on the editing control, and displays the edited initial text data on the data collaboration interface; the first electronic device In response to a second user operation of the user, the edited initial text data is used as the first text data.
  • editing methods There are many editing methods, the following is an example of methods c1-c3.
  • the preview interface 850 may be an editable interface, and a cursor may be displayed in the editable interface, and the cursor is used to display the position of the currently inserted text.
  • the cursor is used to display the position of the currently inserted text.
  • the user clicking the cursor on the editable interface for example, moving the cursor, selecting at least one text, etc.
  • the position of the cursor or the selected at least one text is displayed in the preview interface 850 .
  • voice data input by the user is received, the voice input by the user is recognized, and displayed text is inserted or updated at the cursor position, or at the position of at least one selected text.
  • the text in the preview interface 850 can be selected by the user, and in response to the selection operation acting on the text, an editing control is displayed, and the editing control can include: delete, insert, line feed, backspace, copy, paste and other editing sub-controls .
  • the text is edited in response to a click on the edit control. For example, wrap the input text, add punctuation marks, modify the text content, etc.
  • the preview interface 850 may be an editable interface, and in response to the user's operation of clicking on the editable interface, a keyboard input box is displayed. In response to the operation acting on the keyboard input box, the text input by the user is received and displayed on the preview interface, so as to realize the editing of the text.
  • the text data sent by the first electronic device to the second electronic device may also be rich text data.
  • the first text data sent by the first electronic device may include: initial text data and an editing instruction for the initial text data.
  • the rich text data includes: fields for rich text editing operations.
  • the protocol satisfied by the text data may be a preset protocol.
  • the protocol field may include the protocol number Cmd identifier, the fields corresponding to the protocol requester and the responder, and the text data field. For example, when the Cmd identifier is 0x01, it may indicate that the protocol request sends a first notification message to the responder to establish a data collaboration scenario.
  • the Cmd identifier When the Cmd identifier is 0x02, it may indicate that the protocol request sends a second notification message to the responder to notify the interruption of the data collaboration scenario. When the Cmd identifier is 0x03, it can indicate that the protocol request sends text data to the responder to notify the responder to receive text data. When the Cmd identifier is 0x04, it can indicate that the protocol request sends text data to the responder to notify the responder to receive text data, where the text data may be data including text and data of rich text editing instructions. The fields corresponding to the protocol requester and the responder may occupy 4 bits.
  • 0x01 is used to indicate that the second electronic device sends a text input request to the first electronic device
  • 0x81 is used to indicate that the first electronic device sends a text input request to the second electronic device.
  • the device sends a text input response.
  • 0x02 is used to indicate that the first electronic device sends a text input request to the second electronic device
  • 0x82 is used to indicate that the second electronic device sends a text input response to the first electronic device.
  • the second electronic device receives the first text data, and displays the first text data in the first document editing box of the first document editing application.
  • the second electronic device After receiving the first text data through the application layer, the second electronic device parses the text data field in the first text data, sends the text data field to the kernel layer, and the core layer stores the text data field in the keyboard buffer, so as to pass the The keyboard buffer is displayed on the first document editing box of the first document editing application.
  • Modes C1-C3 are exemplified below to illustrate how the application layer transmits text data fields and other fields of text data to the core layer and stores them in the keyboard buffer. As shown in Figure 9b.
  • mode C1 the text data field and other fields of the text data parsed from the protocol are converted into UNICODE keyboard codes at the application layer, and the converted UNICODE keyboard codes are sent to the keyboard buffer of the kernel layer.
  • a keyboard driver is added to the application layer, and the UNICODE keyboard code is generated by parsing the text data field and other fields of the text data through the keyboard driver.
  • Mode C3 adding an input method interface of a third-party application in the application layer, and transmitting the first text data to the keyboard driver corresponding to the corresponding third-party application through the input method interface, thereby parsing the text through the keyboard driver corresponding to the third-party application
  • For data fields and other fields of text data generate UNICODE keyboard codes and input them into the keyboard buffer. It should be noted that, in this manner, the second electronic device needs to load a third-party application, so as to store text data in the keyboard buffer through the keyboard driving of the third-party application.
  • the first electronic device determines that the second electronic device successfully receives the first text data, deletes the first text data, and deletes the first text data on the display interface of the first display frame.
  • the first electronic device may determine that the second electronic device successfully receives the first text data by receiving the first confirmation message sent by the second electronic device.
  • the first confirmation message is used to indicate that the second electronic device has successfully received the first text data.
  • the data cooperation function of the first electronic device may be turned off.
  • a possible implementation manner may be that the user actively disables the data collaboration function of the first electronic device.
  • the application layer can detect the closing operation acting on the data collaboration interface. After the application layer converts the above operation into a request to close the data collaboration function, it is passed to the application framework layer. After the application framework layer receives the request, it calls the service interface that communicates with the hardware abstraction layer to pass the request to close the data cooperation function to the hardware abstraction layer. After receiving the request to close the data cooperation function, the hardware abstraction layer closes the data cooperation function of the mobile phone.
  • the first electronic device can also dynamically monitor the communication connection state between the first electronic device and the second electronic device, or the connection state between the first electronic device and the wireless access point, if the first electronic device When the device detects that the connection with the second electronic device is disconnected, or the connection with the wireless access point is disconnected, the first electronic device can automatically turn off the data cooperation function to save power consumption of the first electronic device.
  • the first electronic device may also display a notification message on the touch screen of the first electronic device to prompt the user that the device is disconnected from the second electronic device or disconnected from the wireless access point. The data collaboration function of the machine has been automatically turned off.
  • the method for data collaboration among multiple devices may further include the following steps:
  • the second electronic device displays a switched interface on the second electronic device in response to a second switching operation of the application; the second switching operation is used to switch the focus of the second electronic device to a third document
  • the third document editing application is a third document editing application corresponding to when the first electronic device and the second electronic device discontinue data cooperation.
  • the second switching operation of the application may be that the user jumps to another application, causing the focus of the second electronic device to be switched to the display interface of the other application.
  • the display interface of other applications here may be the interface of the application newly opened by the user, or may be the user switching the focus of the second electronic device to the interface of other opened applications, which is not limited herein.
  • the second switching operation of the application may be displaying a notification message on the second electronic device, or receiving a pop-up window of other applications (for example, instant messaging applications, video communication applications, etc.), causing the second electronic device The focus of the electronic device is shifted to the display interface of other applications.
  • the second electronic device sends a second notification message to the first electronic device.
  • the second notification message is used to notify the first electronic device that the focus of the second electronic device has been switched, so as to notify that the data cooperation between the second electronic device and the first electronic device is interrupted.
  • the data collaboration service of the second electronic device can store the third document editing box of the interrupted document editing application (third document editing application), so that when the data collaboration scene is restored, the second electronic device can store the third document according to the stored third document.
  • Edit the third document editing box of the application directly display the third document editing box of the third document editing application on the second electronic device, or move the focus of the second electronic device to the third document editing application of the third document editing application On the box, improve the response speed of recovery data collaboration scenarios.
  • the first electronic device receives the second notification message, and displays a second prompt box on the first electronic device.
  • the second prompt box is used to prompt the user that the focus of the second electronic device has been switched.
  • the second prompt box 1010 may include third prompt information, and the third prompt information may be: "The scenario of HUAWEI MATEBOOK data collaboration has been interrupted". Further, the second prompt box 1010 may further include a control 1020 for stopping input, so that in response to the operation of the control 1020 for stopping input, the first electronic device closes the data collaboration interface.
  • the second text data can be directly stored in the buffer area in the data collaboration service, or the second text data can also be established according to the document editing application of the second electronic device selected by the user, corresponding to the application. file, so that the second text data is cached in the corresponding file.
  • the above files may be updated dynamically.
  • the application framework layer may monitor the text data in the preview interface in the mobile phone, and notify the hardware abstraction when the text data in the preview interface is monitored to change. layer so that the hardware abstraction layer can update the corresponding files.
  • the first electronic device may close the preview interface.
  • the third document editing box of the third document editing application is displayed on the second electronic device; the first condition is used to indicate the first electronic device and the second electronic device.
  • the data cooperative recovery of the device; the first condition may include various, for example, triggering the data cooperative recovery between the first electronic device and the second electronic device through the second electronic device, or triggering the first electronic device and the second electronic device through the first electronic device.
  • the data cooperative recovery of the two electronic devices is described below by taking S505a and S505c as examples.
  • the first switching operation is used to switch the focus of the second electronic device back to the third document editing application, where the third document editing application is the A document editing application corresponding to when the first electronic device and the second electronic device discontinue data collaboration. Therefore, the data cooperation service of the second electronic device determines the recovery data cooperation scenario of the second electronic device, and thus sends a third request message to the first electronic device, where the third request message is used to request to restore the first electronic device and the Data collaboration of the second electronic device.
  • the first electronic device receives the third request message sent by the second electronic device, and displays a third prompt box on the first electronic device.
  • the third prompt box is used to prompt the user that the focus of the second electronic device has been restored to the third document editing box of the third document editing application.
  • the third prompt box may be displayed on the notification bar, or may be displayed on the main interface, which is not limited herein.
  • the third prompt box 1011 may include prompt information, and the prompt information may be: "whether to use a mobile phone to cooperate with HUAWEI MATEBOOK data". Further, the third prompt box 1011 may further include a control 1021 for restoring input, so that in response to the operation of the control acting on restoring input, the first electronic device displays a data collaboration interface and sends a restoring data collaboration message to the second electronic device , the restoring data cooperation message is used to confirm that the first electronic device and the second electronic device restore data cooperation.
  • the data collaboration interface may be the data collaboration interface shown in FIGS. 8a-8b. It is not repeated here.
  • the data collaboration scene between the first electronic device and the second electronic device is restored only after confirmation by the first electronic device, so as to prevent the user from interrupting other events that may be performed on the first electronic device and improve the user experience.
  • the first switching operation is used to switch the focus of the second electronic device back to the document editing application, so that the data collaboration of the second electronic device
  • the service determines a data collaboration scenario for the second electronic device to resume, and thus sends a third notification message to the first electronic device, where the third notification message is used to confirm that the data collaboration between the first electronic device and the second electronic device is resumed.
  • the first electronic device receives the third notification message sent by the second electronic device, and displays a third prompt box on the first electronic device.
  • the third prompt box may include prompt information, and the prompt information may be: "Resume the use of mobile phone and HUAWEI MATEBOOK data collaboration".
  • the first electronic device does not need to confirm, and directly restores the data collaboration scene between the first electronic device and the second electronic device, so as to avoid excessive confirmation by the user and improve user experience.
  • the first trigger condition is used to trigger the data cooperation service of the first electronic device.
  • a possible implementation manner of the first trigger condition is illustrated below with the manners d1-d2 as an example.
  • the recovery operation may be a gesture acting on the first electronic device, and the gesture acting on the first electronic device may include: lifting up, or moving down .
  • the first electronic device may determine that the user is in an upward lift gesture or a downward movement gesture through a gyroscope, an accelerometer, a gravitational accelerometer and other devices. Further, in order to improve the accuracy with which the first electronic device triggers the restoration of the data collaboration scenario, the first electronic device may further determine that the first electronic device is in the data collaboration scenario when the gesture satisfies the first gesture condition.
  • the first gesture condition may include: the first electronic device moves to a range where the distance from the user is greater than a first threshold and less than a second threshold.
  • the first electronic device moves to a range where the distance from the user is greater than a first threshold and less than a second threshold.
  • the first threshold may be the distance range between the first electronic device to answer the call and the user.
  • the second threshold may be the distance range within which the user uses the front camera of the terminal device.
  • the first trigger condition may further include: the first electronic device is not in a call state, or the camera module of the first electronic device is not in an on state, and the like.
  • the first electronic device determines that the first trigger condition is satisfied, it sends a recovery data cooperation message to the second electronic device, so that the second electronic device switches the focus to the interrupted first electronic device after receiving the recovery data coordination message from the first electronic device.
  • the third document editing application is a document editing application corresponding to when the first electronic device and the second electronic device discontinue data collaboration.
  • the second electronic device may display a fourth prompt box on the second electronic device.
  • the fourth prompt box is used to prompt the user to restore the data cooperation message sent by the first electronic device to the second electronic device, so that the user can determine whether to restore the data cooperation.
  • the fourth prompt box 1030 may include prompt information, and the prompt information may be: "whether to resume using HUAWEI p40 for data collaboration". Further, the fourth prompt box 1030 may further include a control 1031 for restoring input, so that in response to the operation of the control acting on restoring input, a response for restoring collaboration is sent to the first electronic device to restore the scenario of data collaboration.
  • the first electronic device receives the third notification message from the second electronic device, and displays a third prompt box on the first electronic device.
  • the third notification message is used to notify the first electronic device to resume data cooperation with the second electronic device.
  • the third prompt box is used to prompt the user that the focus of the second electronic device has been restored to the interface of the document editing application.
  • the third prompt box may be displayed on the notification bar, or may be displayed on the main interface, which is not limited herein.
  • For the display manner of the third prompt box reference may be made to the third prompt box 1011 in FIG. 10b, which will not be repeated here.
  • S506c may be an optional step, for example, the first electronic device and the second electronic device may negotiate in advance, and the first electronic device triggers the recovery of the data collaboration scenario, without the confirmation of the second electronic device, that is, the first electronic device
  • the electronic device confirms to restore the data cooperation scenario of the first electronic device and the second electronic device.
  • the first electronic device displays a third prompt box on the first electronic device.
  • the first electronic device displays a data collaboration interface.
  • the data collaboration interface can display the text data that was not sent last time.
  • the first electronic device may also display a preview interface.
  • the second user operation may be a confirmation operation acting on the data collaboration interface, and the second text data is unsent text data on the preview interface saved by the first electronic device.
  • the first electronic device may also send a confirmation message (eg, a third notification message) for resuming the data collaboration to the second electronic device.
  • a confirmation message eg, a third notification message
  • the second electronic device displays the second text data in the third document editing box.
  • the second electronic device may display the second text data on the third document editing box of the third document editing application, and optionally, the second electronic device may display the fifth prompt box on the display screen.
  • the fifth prompt box 1040 may include prompt information, and the prompt information may be: "The use of HUAWEI p40 for data collaboration has been resumed".
  • the user may continue to input voice on the data collaboration interface to continue the data collaboration scenario.
  • reference may be made to S406-S409, which will not be repeated here.
  • the first electronic device may be interrupted by other applications in the process of cooperatively processing text.
  • the first electronic device needs to answer a call or switch the way to access the network.
  • the user needs to switch to other applications to search for data, etc., it is also possible that the network of the first electronic device is interrupted, and the process of reconnection is performed, thereby causing interruption of the data collaboration scenario.
  • the method for data collaboration among multiple devices may further include the following steps:
  • the data cooperation service of the first electronic device determines that the first electronic device exits the document creation scene, that is, the data cooperation between the second electronic device and the first electronic device is interrupted .
  • the application switching operation may be that the user jumps to another application, causing the display interface of the first electronic device to display the display interface of the other application.
  • the display interface of other applications here may be an application newly opened by the user, or may be the user switching the display interface of the first electronic device to another opened application interface, which is not limited herein.
  • the application switching operation may be displaying a notification message on the first electronic device, or receiving a pop-up window of other applications (eg, instant messaging applications, video communication applications, etc.), causing the second electronic device to display an interface Displays the display interface of other applications.
  • applications eg, instant messaging applications, video communication applications, etc.
  • the first electronic device sends an interruption notification message to the second electronic device.
  • the interruption notification message is used to notify the first electronic device that the data cooperation scene has been interrupted.
  • the first electronic device can close the preview interface.
  • the first electronic device may save the unsent second text data on the preview interface.
  • the manner in which the first electronic device saves the unsent second text data on the preview interface may refer to S502, which will not be repeated here.
  • the user before the first electronic device is interrupted, the user has confirmed that the second text data is the data to be sent. At this time, the first electronic device can send the second text data to the second electronic device to The second electronic device is caused to display the second text data in the corresponding document editing application.
  • the second electronic device receives the interruption notification message, and displays a third prompt box on the second electronic device.
  • the third prompt box may be used to display the second prompt interface.
  • the second prompt interface is used to prompt the user that the data collaboration scene of the first electronic device has been interrupted.
  • the second prompt interface 1210 may include prompt information, and the prompt information may be: "The scenario of HUAWEI P40 data collaboration has been interrupted".
  • the second prompt interface 1210 may further include a control 1211 for stopping data collaboration, so that, in response to the operation of the control 1211 for stopping data collaboration, the second electronic device may stop the data collaboration service, and may store the corresponding data collaboration
  • the interface of the document editing application may store the interface of the interrupted data collaboration application (third document editing application), so that when the data collaboration scenario is restored, the second electronic device may store the interface of the interrupted data collaboration application according to the stored interface.
  • the interface of the interrupted data cooperation application is directly displayed on the second electronic device, or the focus of the second electronic device is moved to the interface of the interrupted data cooperation application, so as to improve the response speed of restoring the data cooperation scene.
  • the data collaboration interface is displayed on the first electronic device, and the second text data is displayed on the data collaboration interface; the third condition is used for Instructing the first electronic device and the second electronic device to collaboratively restore data.
  • the third condition may include multiple ways, which may be triggered by the first electronic device or by the second electronic device.
  • the following uses S604a-S604c as examples to illustrate the possible scenarios of the third condition.
  • Manner D1 in response to the restore operation of the application by the first electronic device, the data cooperation service of the first electronic device determines a data cooperation scenario of the first electronic device restoring data, so that the first electronic device sends a restoring data cooperation message to the second electronic device.
  • the recovery operation may be a gesture acting on the first electronic device, determining that the gesture satisfies the first gesture condition, and sending a third request message to the second electronic device.
  • the first electronic The device sends a resume data collaboration message to the second electronic device in response to the opening operation acting on the data collaboration interface. Therefore, after receiving the data recovery message from the first electronic device, the second electronic device switches the focus to the third document editing box of the interrupted third document editing application. For details, reference may be made to the manner d1, which is not repeated here.
  • the first trigger condition may also be that the first electronic device determines that it is not in a call state; or, the camera module of the first electronic device is not in an on state.
  • the manner d2 which will not be repeated here.
  • the second electronic device receives a data recovery cooperation message sent by the first electronic device, where the recovery data cooperation message is used to request recovery of the data cooperation between the first electronic device and the second electronic device; display on the second electronic device The third prompt interface.
  • the third prompt interface is used to prompt the user that the data collaboration interface of the first electronic device has been restored.
  • the third prompt interface may be displayed in the notification bar, or may be displayed in the third document editing box of the third document editing application, which is not limited herein.
  • the third prompt interface 1220 may include prompt information, and the prompt information may be: "Resume the scenario of HUAWEI P40 data collaboration".
  • the third prompt interface 1220 may further include a control 1221 for resuming data collaboration, so that, in response to the operation of the control 1221 for resuming data collaboration, the second electronic device may enable the data collaboration service, and A third document editing box of the document editing application corresponding to the stored data collaboration before the interruption is displayed.
  • the second electronic device may send a third notification message to the first electronic device in response to the operation of the control for resuming the data collaboration, the third notification message is used to confirm that the first electronic device and the all data cooperation of the second electronic device.
  • the second electronic device may also confirm that the data cooperation between the first electronic device and the second electronic device has been restored after receiving the restore data cooperation message, without sending the first electronic device the first Three notification messages, the specific implementation process can be determined as needed, which is not limited here.
  • the data cooperation service of the second electronic device determines that the second electronic device restores the data cooperation scenario, thereby sending a third notification message to the first electronic device, the third notification message using After confirming that the first electronic device resumes data cooperation with the second electronic device.
  • the data cooperation service of the second electronic device determines that the second electronic device restores the data cooperation scenario, thereby sending a third request message to the first electronic device, and the third request message uses requesting the first electronic device to resume data cooperation with the second electronic device.
  • the first electronic device receives a data recovery cooperation message from the second electronic device, where the recovery data cooperation message is used to notify the first electronic device to resume data cooperation with the second electronic device, and display it on the first electronic device The fourth prompt interface.
  • the fourth prompt interface is used to prompt the user that the focus of the second electronic device has been restored to the third document editing box of the document editing application.
  • the fourth prompt interface may be displayed on the notification bar or on the main interface, which is not limited herein.
  • the fourth prompt interface 1230 may include fourth prompt information, and the fourth prompt information may be: "Resume the HUAWEI P40 data collaboration scene". Further, the fourth prompt interface 1230 may further include a control 1231 for confirming restoration, so that, in response to the operation of the control 1221 for confirming restoration, the second electronic device may start the data cooperation service and send the restoration cooperation to the first electronic device response.
  • the first electronic device In response to the operation of the fifth prompt interface acting on the first electronic device, the first electronic device displays a preview interface.
  • the fifth prompt interface 1240 may include fifth prompt information, and the fifth prompt information may be: "Resume the scenario of HUAWEI P40 data collaboration". Further, the fifth prompt interface 1240 may further include a control 1241 for resuming the input, so that in response to the operation of the control 1241 for confirming the restoration, the second electronic device may enable the data collaboration service and display the data collaboration before the interruption of the data collaboration interface.
  • the data collaboration interface may include a preview interface before data collaboration is interrupted.
  • the preview interface may display text data that was not sent last time.
  • For the display manner of the preview interface reference may be made to the display manners of (a) and (b) in FIG. 8b , which will not be repeated here.
  • the second user operation may be a confirmation operation acting on the data collaboration interface
  • the third text data may be unsent text data on the preview interface saved by the first electronic device, or may be newly confirmed by the first electronic device to be sent text data.
  • the second electronic device displays the third text data.
  • the second electronic device may display the third text data on the document editing box of the interrupted data collaboration application, and the specific method may refer to S509, which will not be repeated here.
  • the user may also continue to input voice on the data collaboration interface to continue the data collaboration scenario. For this step, reference may be made to S406-S409, which will not be repeated here.
  • the methods provided by the embodiments of the present application are introduced from the perspective of an electronic device as an execution subject.
  • the terminal device may include a hardware structure and/or a software module, and implement the above-mentioned functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is performed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), and the like.

Abstract

A multi-device data collaboration method and an electronic device, which are applied to a system comprising a first electronic device and a second electronic device. Said method comprises: in response to a first operation acting on a first document editing application of a second electronic device, the second electronic device displaying a first document editing box of the first document editing application; the second electronic device sending a first notification message to the first electronic device, and the first electronic device displaying a first prompt box, wherein the first prompt box comprises at least one of the following: first prompt information and a first widget; the first prompt information being used for prompting a user whether to start data collaboration with the second electronic device; the first electronic device displaying a data collaboration interface in response to an operation on the first widget; and the first electronic device receiving a user voice input and converting same into a text, sending first text data to the second electronic device in response to a second user operation, and displaying the first text data on the first document editing box.

Description

一种多设备数据协作的方法及电子设备Method and electronic device for multi-device data collaboration
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求在2020年08月06日提交中国专利局、申请号为202010784936.3、申请名称为“一种多设备数据协作的方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202010784936.3 and the application title "A method and electronic device for multi-device data collaboration" filed with the China Patent Office on August 6, 2020, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请实施例涉及通信技术领域,尤其涉及一种多设备数据协作的方法及电子设备。The embodiments of the present application relate to the field of communication technologies, and in particular, to a method and electronic device for data collaboration among multiple devices.
背景技术Background technique
办公是个人电脑(personal computer,PC)的主要使用场景,而文稿创作又是办公的主要场景之一。当前文稿创作的主要方式为用户坐在电脑前,使用键盘或者手写笔输入到相应的文档编辑的应用中,例如:word/txt等具有长文本编辑功能的软件中。Office is the main usage scenario of personal computer (PC), and document creation is one of the main scenarios of office. The main way of creating a current document is that the user sits in front of the computer and uses a keyboard or a stylus to input into a corresponding document editing application, such as word/txt and other software with a long text editing function.
目前,基于个人电脑进行长文本的编辑操作方法单一,并且依赖用户长时间坐在电脑前,进行输入,无法变换创作场景,无法满足用户对文稿创作场景变化的需要。At present, the editing operation method of long text based on personal computer is single, and relies on the user to sit in front of the computer for a long time for input, cannot change the creation scene, and cannot meet the user's needs for the change of the manuscript creation scene.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种多设备数据协作的方法及电子设备,用于文稿创作场景,能够满足用户文稿创作中的场景变化需求。Embodiments of the present application provide a multi-device data collaboration method and an electronic device, which are used in a manuscript creation scene, and can meet the scene change requirements of a user in manuscript creation.
第一方面,本申请实施例提供一种多设备数据协作的方法,应用于第二电子设备,第二电子设备上可以运行第一文档编辑应用。第二电子设备响应于在所述第二电子设备的第一文档编辑应用上的第一操作,在所述第二电子设备上显示所述第一文档编辑应用的第一文档编辑框;第二电子设备发送第一通知消息至第一电子设备,所述第一通知消息用于建立所述第一电子设备与所述第二电子设备的数据协作;第二电子设备接收所述第一电子设备发送的第一文本数据,在所述第一文档编辑框上显示所述第一文本数据。In a first aspect, an embodiment of the present application provides a multi-device data collaboration method, which is applied to a second electronic device, and the second electronic device can run a first document editing application. The second electronic device displays the first document editing box of the first document editing application on the second electronic device in response to the first operation on the first document editing application of the second electronic device; the second electronic device displays the first document editing box of the first document editing application on the second electronic device; The electronic device sends a first notification message to the first electronic device, where the first notification message is used to establish data cooperation between the first electronic device and the second electronic device; the second electronic device receives the first electronic device The sent first text data is displayed on the first document edit box.
通过上述方法,第二电子设备可以通过响应于在所述第二电子设备的第一文档编辑应用上的第一操作,向第一电子设备发送第一通知消息的方式,使得第一电子设备可以与第二电子设备建立数据协作,该方法建立数据协作的方式简单便捷,有效降低了建立数据协作的操作难度,提高了用户在多种场景下创作文稿的便捷性和适用性。无需用户在第二电子设备和第一电子设备上同时打开相应的数据协作的界面,来主动建立数据协作的场景,提高了用户体验。Through the above method, the second electronic device can send the first notification message to the first electronic device in response to the first operation on the first document editing application of the second electronic device, so that the first electronic device can Establishing data collaboration with the second electronic device, the method is simple and convenient to establish data collaboration, effectively reduces the operational difficulty of establishing data collaboration, and improves the convenience and applicability of users for creating documents in various scenarios. There is no need for the user to open the corresponding data collaboration interface simultaneously on the second electronic device and the first electronic device to actively establish a data collaboration scenario, which improves user experience.
一种可能的实现方式,考虑到用户对触发数据协作场景相应的第一文档编辑应用的个性化定制,及避免不使用数据协作时对数据协作场景的误触发,可以为文档编辑应用配置文档编辑白名单,使得所述第一文档编辑应用为用户配置的文档编辑白名单中的应用。从而,提高用户对数据协作的使用体验。A possible implementation, considering the user's personalized customization of the first document editing application corresponding to the triggering of the data collaboration scenario, and avoiding false triggering of the data collaboration scenario when data collaboration is not used, can configure document editing for the document editing application. The whitelist makes the first document editing application an application in the document editing whitelist configured by the user. Thus, the user's experience of using data collaboration is improved.
一种可能的实现方式,所述第一操作,包括以下至少一项:开启所述第一文档编辑应用的操作,点击所述第一文档编辑应用中的文档编辑框的操作,切换所述第一文档编辑应 用的操作,切换所述第一文档编辑应用中的文档编辑框的操作。A possible implementation manner, the first operation includes at least one of the following: an operation of opening the first document editing application, an operation of clicking a document editing box in the first document editing application, switching the first document editing application. An operation of a document editing application, an operation of switching the document editing box in the first document editing application.
通过上述方法,第二电子设备通过用户在第一文档编辑应用中的上述操作,可以确定用户想要进入文档编辑的场景,从而触发向第一电子设备建立数据协作,可以减少用户主动触发数据协作场景所带来的繁琐操作,另外,针对未使用过数据协作场景的用户,也可以无感知的触发与第一电子设备进行数据协作,有利于用户成功建立数据协作场景,提高用户对数据协作使用的体验。Through the above method, the second electronic device can determine the scene in which the user wants to enter the document editing through the above operation of the user in the first document editing application, thereby triggering the establishment of data collaboration with the first electronic device, which can reduce the user's active triggering of data collaboration The tedious operation brought by the scene, in addition, for users who have not used the data collaboration scene, they can also trigger data collaboration with the first electronic device without perception, which is beneficial for the user to successfully establish the data collaboration scene and improve the user's use of data collaboration. experience.
一种可能的实现方式,第二电子设备向第一电子设备发送第一通知消息之前,还可以在第二电子设备上显示第一查找设备界面;所述第一查找设备界面用于显示与所述第二电子设备建立通信连接的至少一个电子设备;第二电子设备响应于作用于所述第一查找设备界面上的所述至少一个电子设备中的第一电子设备的确认操作,确定发送所述第一通知消息的第一电子设备。In a possible implementation manner, before the second electronic device sends the first notification message to the first electronic device, a first search device interface may also be displayed on the second electronic device; the first search device interface is used to at least one electronic device to which the second electronic device establishes a communication connection; the second electronic device, in response to the confirmation operation acting on the first electronic device in the at least one electronic device on the first search device interface, determines to send the The first electronic device that described the first notification message.
通过上述方法,考虑到第二电子设备可能与至少一个电子设备建立通信连接,此时,可以第二电子设备通过显示第一查收设备界面,向用户显示至少一个电子设备,从而响应于对所述第一查找设备界面上的所述至少一个电子设备中的第一电子设备的确认操作,确定用户选择的第一电子设备,从而基于用户的需求,在第二电子设备和第一电子设备之间建立数据协作,提高数据协作的灵活性和适应性。Through the above method, considering that the second electronic device may establish a communication connection with at least one electronic device, at this time, the second electronic device may display at least one electronic device to the user by displaying the first checking device interface, so as to respond to the The confirmation operation of the first electronic device in the at least one electronic device on the first search device interface, to determine the first electronic device selected by the user, so that based on the needs of the user, a search between the second electronic device and the first electronic device Establish data collaboration and improve the flexibility and adaptability of data collaboration.
一种可能的实现方式,接收来自所述第一电子设备的通信连接请求;所述通信连接请求通过近场通信技术实现;与所述第一电子设备建立通信连接,在所述第二电子设备上显示第一连接消息;所述第一连接消息用于提示用户所述第二电子设备与所述第一电子设备建立通信连接。A possible implementation manner is to receive a communication connection request from the first electronic device; the communication connection request is realized by using a near field communication technology; establish a communication connection with the first electronic device, and the second electronic device A first connection message is displayed on the device; the first connection message is used to prompt the user to establish a communication connection between the second electronic device and the first electronic device.
通过近场通信技术实现第一电子设备与第二电子设备间的通信连接,不限于第一电子设备和第二电子设备必须处于同一局域网中才能建立通信连接的方式,从而降低了不同电子设备间建立通信连接的难度,进而提高了不同电子设备之间建立数据协作的兼容性,提高实现数据协作的场景的多样性和灵活性。The communication connection between the first electronic device and the second electronic device is realized by using the near field communication technology, which is not limited to the way that the first electronic device and the second electronic device must be in the same local area network to establish the communication connection, thereby reducing the need for communication between different electronic devices. The difficulty of establishing a communication connection improves the compatibility of establishing data collaboration between different electronic devices, and improves the diversity and flexibility of scenarios for realizing data collaboration.
一种可能的实现方式,第二电子设备向第一电子设备发送第一通知消息之后,还可以接收所述第一电子设备发送的第一响应消息,第一响应消息用于确认所述第一电子设备与所述第二电子设备建立数据协作;从而,第二电子设备可以在所述第二电子设备上显示第一响应消息。In a possible implementation manner, after the second electronic device sends the first notification message to the first electronic device, it can also receive a first response message sent by the first electronic device, where the first response message is used to confirm the first notification message. The electronic device establishes data cooperation with the second electronic device; thus, the second electronic device can display the first response message on the second electronic device.
通过上述方法,第一电子设备可以向第二电子设备发送第一响应消息,使得第二电子设备确定第一电子设备与第二电子设备已建立数据协作。进一步的,第二电子设备显示该第一响应消息,使得用户可以确定第二电子设备与第一电子设备已成功建立数据协作,提高用户体验。Through the above method, the first electronic device can send the first response message to the second electronic device, so that the second electronic device determines that the first electronic device and the second electronic device have established data cooperation. Further, the second electronic device displays the first response message, so that the user can determine that the second electronic device and the first electronic device have successfully established data cooperation, thereby improving user experience.
一种可能的实现方式,所述第二电子设备上包括多个文档编辑应用;向所述第一电子设备发送第二通知消息;所述第二通知消息用于通知所述第二电子设备包括所述多个文档编辑应用;接收所述第一电子设备发送的切换消息;所述切换消息用于指示所述第二电子设备将所述第二电子设备的焦点从第一文档编辑应用切换至第二文档编辑应用;在所述第二电子设备上将焦点切换至所述第二文档编辑应用的第二文档编辑框;接收所述第一电子设备发送的第三文本数据,在所述第二文档编辑框上显示所述第三文本数据。In a possible implementation manner, the second electronic device includes multiple document editing applications; a second notification message is sent to the first electronic device; the second notification message is used to notify the second electronic device of including the plurality of document editing applications; receiving a switching message sent by the first electronic device; the switching message is used to instruct the second electronic device to switch the focus of the second electronic device from the first document editing application to a second document editing application; switch the focus to the second document editing box of the second document editing application on the second electronic device; receive the third text data sent by the first electronic device, in the first electronic device The third text data is displayed on the second document edit box.
考虑到第二电子设备上可能开启了多个文档编辑应用,用户需要在多个文档编辑应用中的文档编辑框中进行数据协作,此时,用户可以在与第一文档编辑应用的第一文档编辑 框进行数据协作的过程中,通过向第二电子设备发送切换消息,以使第二电子设备根据切换消息将焦点切换至所述第二文档编辑应用的第二文档编辑框,从而实现在第二文档编辑框中输入第三文本数据的数据协作场景。以使数据协作功能可以适用多个文档编辑应用的场景,提高了数据协作的适用性。Considering that multiple document editing applications may be opened on the second electronic device, the user needs to perform data collaboration in the document editing boxes in the multiple document editing applications. In the process of data collaboration in the editing box, by sending a switching message to the second electronic device, so that the second electronic device switches the focus to the second document editing box of the second document editing application according to the switching message, so as to realize the The data collaboration scenario in which the third text data is entered in the second document editing box. In order to make the data collaboration function applicable to scenarios of multiple document editing applications, the applicability of data collaboration is improved.
考虑到在数据协作过程中,第二电子设备和/或第一电子设备可能由于其他事件,导致数据协作场景中断,本申请中,第二电子设备可以在确定恢复数据协作场景时,在第三文档编辑应用中恢复数据协作,所述第三文档编辑应用为所述第一电子设备与所述第二电子设备中断数据协作时对应的文档编辑应用;从而,避免数据协作中断导致的用户输入的第二文本数据丢失,有效提高用户体验。Considering that during the data collaboration process, the second electronic device and/or the first electronic device may interrupt the data collaboration scenario due to other events, in this application, when determining to restore the data collaboration scenario, the second electronic device may The data collaboration is resumed in the document editing application, and the third document editing application is the document editing application corresponding to the interruption of the data collaboration between the first electronic device and the second electronic device; thus, it avoids the user input caused by the interruption of the data collaboration. The second text data is lost, which effectively improves the user experience.
一种可能的实现方式,满足第一条件时,在所述第二电子设备上显示第三文档编辑应用;第二电子设备接收所述第一电子设备的第二文本数据,在所述第三文档编辑应用的第三文档编辑框上显示所述第二文本数据;所述第二文本数据为所述数据协作中断时所述第一电子设备生成的文本数据。其中,第一条件为:响应于对应用的第一切换操作,所述第一切换操作用于将所述第二电子设备的焦点切换至所述第三文档编辑应用;或者,接收所述第一电子设备的恢复数据协作消息,所述恢复数据协作消息用于请求恢复所述第一电子设备与所述第二电子设备的数据协作。In a possible implementation manner, when the first condition is satisfied, a third document editing application is displayed on the second electronic device; the second electronic device receives the second text data of the first electronic device, and the third The second text data is displayed on the third document editing box of the document editing application; the second text data is text data generated by the first electronic device when the data collaboration is interrupted. The first condition is: in response to a first switching operation on the application, the first switching operation is used to switch the focus of the second electronic device to the third document editing application; or, receiving the first switching operation A restore data cooperation message of an electronic device, where the restore data cooperation message is used to request to restore the data cooperation between the first electronic device and the second electronic device.
通过上述方法,可以通过用户在第二电子设备上进行第一切换操作,也可以通过用户在第一电子设备向第二电子设备发送的恢复数据协作消息,触发恢复数据协作场景,从而,第二电子设备显示第三文档编辑应用,并接收第一电子设备发送的第二文本数据,由于第二文本数据为中断数据协作时,第一电子设备生成的文本数据,对于用户而言,数据场景的中断,并未影响数据协作过程,规避了中断数据协作导致的数据丢失的风险,提高了用户使用数据协作的体验。Through the above method, the user can perform the first switching operation on the second electronic device, or the user can trigger the recovery data cooperation scene through the recovery data cooperation message sent by the user from the first electronic device to the second electronic device, so that the second The electronic device displays the third document editing application, and receives the second text data sent by the first electronic device. Since the second text data is text data generated by the first electronic device when data collaboration is interrupted, for the user, the The interruption does not affect the data collaboration process, avoids the risk of data loss caused by interruption of data collaboration, and improves the user experience of using data collaboration.
一种可能的实现方式,响应于所述文档编辑应用的第二切换操作,在所述第二电子设备上显示切换后的界面;所述第二切换操作用于将所述第二电子设备的焦点切换出所述第三文档编辑应用之外。通过第二电子设备向第一电子设备发送第二通知消息;所述第二通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断。In a possible implementation manner, in response to a second switching operation of the document editing application, a switched interface is displayed on the second electronic device; the second switching operation is used to The focus is switched out of the third document editing application. A second notification message is sent to the first electronic device through the second electronic device; the second notification message is used to notify the second electronic device that the data cooperation between the second electronic device and the first electronic device is interrupted.
通过上述方法,可以通过第二电子设备响应于所述文档编辑应用的第二切换操作,确定第一电子设备与所述第二电子设备中断数据协作。从而触发第二电子设备向第一电子设备发送第二通知消息,使得第一电子设备可以存储中断数据协作时生成的第二文本数据,避免中断数据协作导致的数据丢失。Through the above method, it can be determined by the second electronic device that the first electronic device and the second electronic device discontinue data cooperation in response to the second switching operation of the document editing application. Thus, the second electronic device is triggered to send the second notification message to the first electronic device, so that the first electronic device can store the second text data generated when the data cooperation is interrupted, so as to avoid data loss caused by the interrupted data cooperation.
一种可能的实现方式,第二电子设备接收所述第一电子设备的中断通知消息,中断通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断。In a possible implementation manner, the second electronic device receives an interruption notification message of the first electronic device, where the interruption notification message is used to notify the second electronic device that the data cooperation with the first electronic device is interrupted.
通过上述方法,第二电子设备通过中断通知消息,确定第一电子设备中断了数据协作,避免第二电子设备对数据协作的中断无感知,提高用户对数据协作过程的使用体验。Through the above method, the second electronic device determines that the first electronic device has interrupted the data collaboration through the interruption notification message, so as to prevent the second electronic device from being unaware of the interruption of the data collaboration, and improve the user experience of the data collaboration process.
一种可能的实现方式,第二电子设备接收所述第一电子设备的第二文本数据之前,还可以向第一电子设备发送第三通知消息;所述第三通知消息用于通知所述第一电子设备恢复与所述第二电子设备的数据协作。A possible implementation manner, before the second electronic device receives the second text data of the first electronic device, may also send a third notification message to the first electronic device; the third notification message is used to notify the first electronic device of An electronic device resumes data cooperation with the second electronic device.
通过上述方法,第二电子设备可以在确定恢复数据协作场景时,向第一电子设备发送第三通知消息,以通知第一电子设备数据线协作场景恢复,从而提高恢复数据协作场景的效率,使得第一电子设备可以向第二电子设备发送第二文本数据,降低延迟,提高用户体 验。Through the above method, the second electronic device can send a third notification message to the first electronic device when it is determined to restore the data collaboration scene, so as to notify the first electronic device that the data line collaboration scene is restored, thereby improving the efficiency of restoring the data collaboration scene, so that The first electronic device can send the second text data to the second electronic device to reduce delay and improve user experience.
一种可能的实现方式,第二电子设备接收所述第一电子设备的第二文本数据之前,还可以向所述第一电子设备发送第三请求消息;所述第三请求消息用于请求恢复所述第一电子设备与所述第二电子设备的数据协作;接收第一电子设备发送的恢复数据协作消息;所述恢复数据协作消息用于确认恢复所述第一电子设备与所述第二电子设备的数据协作。In a possible implementation manner, before the second electronic device receives the second text data of the first electronic device, it may also send a third request message to the first electronic device; the third request message is used to request recovery data cooperation between the first electronic device and the second electronic device; receiving a recovery data cooperation message sent by the first electronic device; the recovery data cooperation message is used to confirm recovery of the first electronic device and the second electronic device Data collaboration for electronic devices.
通过上述方法,第二电子设备可以通过向第一电子设备发送第三请求消息,以使用户在第一电子设备上确认是否要恢复数据协作场景,在接收到第一电子设备发送的恢复数据协作消息后,第二电子设备确定恢复数据协作场景,从而触发显示第三文档编辑框,以便接收第一电子设备发送的第二文本数据,通过用户确认恢复数据协作的方式,提高第二电子设备恢复数据协作时机的准确度,提高用户对第二电子设备及第一电子设备的使用的流畅度。Through the above method, the second electronic device can send the third request message to the first electronic device, so that the user confirms on the first electronic device whether to resume the data collaboration scenario, and after receiving the resume data collaboration scenario sent by the first electronic device After the message, the second electronic device determines to restore the data collaboration scenario, thereby triggering the display of the third document editing box, so as to receive the second text data sent by the first electronic device, and the user confirms the restoration of data collaboration to improve the recovery of the second electronic device. The accuracy of the data collaboration timing improves the smoothness of the user's use of the second electronic device and the first electronic device.
第二方面,本申请提供一种多设备数据协作的方法,应用于第一电子设备,第一电子设备接收来自第二电子设备的第一通知消息,显示第一提示框;所述第一通知消息用于请求所述第一电子设备与所述第二电子设备建立数据协作;所述第一提示框包括以下至少一项:第一提示信息和第一控件;响应于作用于所述第一控件的第一用户操作,显示数据协作界面;采集第一语音数据,将所述第一语音数据转换为第一文本数据,在所述数据协作界面显示所述第一文本数据;响应于第二用户操作,向所述第二电子设备发送所述第一文本数据。In a second aspect, the present application provides a method for multi-device data collaboration, which is applied to a first electronic device. The first electronic device receives a first notification message from the second electronic device and displays a first prompt box; the first notification The message is used to request the first electronic device to establish data cooperation with the second electronic device; the first prompt box includes at least one of the following: first prompt information and a first control; in response to acting on the first The first user operation of the control displays a data collaboration interface; collects first voice data, converts the first voice data into first text data, and displays the first text data on the data collaboration interface; responds to the second The user operates to send the first text data to the second electronic device.
其中,第一用户操作可以是用户对第一控件的确认操作,第二用户操作可以是用户对数据协作界面的确认操作。The first user operation may be a user's confirmation operation on the first control, and the second user operation may be a user's confirmation operation on the data collaboration interface.
通过上述方法,第一电子设备可以接收到第二电子设备的第一通知消息,并通过第一提示框提示用户是否要建立数据协作,响应于对所述第一控件的操作,在所述第一电子设备上显示所述数据协作界面,从而,采集用户输入的第一语音数据,并转换为第一文本数据发送给第二电子设备,以实现第一电子设备与第二电子设备的数据协作。在该过程中,第一电子设备和第二电子设备建立数据协作的过程简单,通过第二电子设备发送第一通知消息的方式,降低了建立数据协作的操作难度,提高了用户在多种场景下创作文稿的便捷性和适用性。Through the above method, the first electronic device can receive the first notification message of the second electronic device, and prompt the user whether to establish data collaboration through a first prompt box, and in response to the operation of the first control, in the first prompt box The data cooperation interface is displayed on an electronic device, so that the first voice data input by the user is collected, converted into first text data and sent to the second electronic device, so as to realize the data cooperation between the first electronic device and the second electronic device . In this process, the process of establishing data collaboration between the first electronic device and the second electronic device is simple, and the method of sending the first notification message by the second electronic device reduces the operational difficulty of establishing data collaboration and improves the user experience in various scenarios. The ease and applicability of authoring documents.
一种可能的实现方式,所述数据协作界面还包括:编辑控件;将所述第一语音数据识别为初始文本数据,在所述数据协作界面上显示所述初始文本数据;响应于作用于所述编辑控件的第三用户操作,确定对所述初始文本数据的编辑指令,在所述数据协作界面上显示编辑后的初始文本数据;响应于作用于所述数据协作界面的确认操作,将所述编辑后的初始文本数据作为所述第一文本数据。In a possible implementation manner, the data collaboration interface further includes: editing controls; identifying the first voice data as initial text data, and displaying the initial text data on the data collaboration interface; The third user operation of the editing control determines the editing instruction for the initial text data, and displays the edited initial text data on the data collaboration interface; in response to the confirmation operation acting on the data collaboration interface, all The edited initial text data is used as the first text data.
通过上述方法,通过数据协作界面的编辑控件,可以对识别的初始文本数据进行编辑,提高用户通过语音输入文本数据的可操作性,并通过编辑控件,还可以对初始文本数据的格式进行编辑,从而生成对初始文本数据的编辑指令,显示为编辑后的初始文本数据的状态,提高对文本数据的编辑能力,提高数据协作在第二电子设备上输入文本的操作便捷性。Through the above method, the recognized initial text data can be edited through the editing control of the data collaboration interface, the operability of the user inputting the text data through voice can be improved, and the format of the initial text data can also be edited through the editing control, Thereby, an editing instruction for the initial text data is generated, displayed as the state of the edited initial text data, the editing ability of the text data is improved, and the operation convenience of data cooperation for inputting text on the second electronic device is improved.
一种可能的实现方式,所述第一文本数据包括:初始文本数据和对所述初始文本数据的编辑指令。In a possible implementation manner, the first text data includes: initial text data and an editing instruction for the initial text data.
通过上述方法,通过第一文本数据中的初始文本数据的编辑指令,以使第二电子设备在接收到第一文本数据后,通过初始文本数据的编辑指令,在第二电子设备上显示为编辑 后的初始文本数据的状态,提高数据协作的适用性。Through the above method, through the editing instruction of the initial text data in the first text data, after receiving the first text data, the second electronic device displays the editing instruction of the initial text data on the second electronic device as editing After the state of the initial text data, improve the applicability of data collaboration.
一种可能的实现方式,第一电子设备还可以接收所述第二电子设备发送的第一确认消息,其中,第一确认消息用于指示所述第二电子设备成功接收到所述第一文本数据;从而,第一电子设备可以删除所述数据协作界面上显示的所述第一文本数据。In a possible implementation manner, the first electronic device may also receive a first confirmation message sent by the second electronic device, where the first confirmation message is used to indicate that the second electronic device has successfully received the first text data; thus, the first electronic device can delete the first text data displayed on the data collaboration interface.
通过上述方法,第一电子设备在确认第二电子设备成功接收到所述第一文本数据后,可以删除数据协作界面上显示的所述第一文本数据,对用户而言可以提高输入语音数据和对显示在数据协作界面上的文本数据进行编辑的可操作性,对第一电子设备而言,可以降低内存的占用,提高性能。Through the above method, after confirming that the second electronic device has successfully received the first text data, the first electronic device can delete the first text data displayed on the data collaboration interface, which can improve the input voice data and the user experience. The operability of editing the text data displayed on the data collaboration interface can reduce the occupation of the memory and improve the performance for the first electronic device.
一种可能的实现方式,所述第一电子设备还包括近距离无线通信装置;所述第一电子设备接收来自第二电子设备的第一通知消息之前,还可以在确定与所述第二电子设备的距离满足第一距离阈值时,通过近场通信发送通信连接请求至所述第二电子设备;第一电子设备与所述第二电子设备建立通信连接,显示第一连接消息;所述第一连接消息用于提示用户所述第二电子设备与所述第一电子设备建立通信连接。In a possible implementation manner, the first electronic device further includes a short-range wireless communication device; before the first electronic device receives the first notification message from the second electronic device, the When the distance of the device meets the first distance threshold, a communication connection request is sent to the second electronic device through near field communication; the first electronic device establishes a communication connection with the second electronic device, and displays a first connection message; the first electronic device A connection message is used to prompt the user to establish a communication connection between the second electronic device and the first electronic device.
通过上述方法,通过近距离无线通信装置,在第一电子设备的近距离无线通信装置与所述第二电子设备的近距离无线通信装置的距离满足第一距离阈值时,可以出发第一电子设备与第二电子设备建立通信连接,并不限定第一电子设与第二电子设备位于同一局域网内,提高用户使用数据协作的便捷性和适用范围。第一距离阈值可以根据近距离无线通信装置设置,也可以根据其他方式确定,在此不做限定。Through the above method, through the short-range wireless communication device, when the distance between the short-range wireless communication device of the first electronic device and the short-range wireless communication device of the second electronic device satisfies the first distance threshold, the first electronic device can be activated. Establishing a communication connection with the second electronic device does not limit the fact that the first electronic device and the second electronic device are located in the same local area network, which improves the convenience and application scope of the user's use of data collaboration. The first distance threshold may be set according to the short-range wireless communication device, or may be determined according to other methods, which is not limited herein.
一种可能的实现方式,第一电子设备响应于作用于所述第一控件的第一用户操作,还可以向所述第二电子设备发送第一响应消息;所述第一响应消息用于确认建立所述第一电子设备与所述第二电子设备的数据协作。A possible implementation manner, in response to a first user operation acting on the first control, the first electronic device may also send a first response message to the second electronic device; the first response message is used to confirm Establishing a data collaboration between the first electronic device and the second electronic device.
通过上述方法,通过用户确认建立数据协作,即对第一控件的操作,向第二电子设备发送第一响应消息,使得第二电子设备确定第一电子设备与第二电子设备建立数据协作。Through the above method, the user confirms the establishment of data cooperation, that is, the operation of the first control sends a first response message to the second electronic device, so that the second electronic device determines that the first electronic device and the second electronic device establish data cooperation.
一种可能的实现方式,所述第二电子设备上包括多个文档编辑应用;第一电子设备还可以接收所述第二电子设备的应用通知消息,在所述数据协作界面上显示所述多个文档编辑应用的控件;所述应用通知消息用于指示所述第二电子设备包括所述多个文档编辑应用;响应于作用于所述多个文档编辑应用的控件的切换操作,向所述第二电子设备发送切换消息;所述切换操作用于指示第二电子设备的焦点从第一文档编辑应用切换至第二文档编辑应用;所述切换消息用于指示所述第二电子设备将所述第二电子设备的焦点切换至第二文档编辑应用的第二文档编辑框;采集第二语音数据,将所述第二语音数据转换为第三文本数据,在所述数据协作界面显示所述第三文本数据;响应于作用于所述数据协作界面的确认操作,向所述第二电子设备发送所述第三文本数据。A possible implementation manner, the second electronic device includes multiple document editing applications; the first electronic device may also receive an application notification message of the second electronic device, and display the multiple document editing applications on the data collaboration interface. controls of a plurality of document editing applications; the application notification message is used to indicate that the second electronic device includes the plurality of document editing applications; in response to a switching operation of the controls acting on the plurality of document editing applications, to the The second electronic device sends a switching message; the switching operation is used to instruct the second electronic device to switch the focus from the first document editing application to the second document editing application; the switching message is used to instruct the second electronic device to switch the The focus of the second electronic device is switched to the second document editing box of the second document editing application; the second voice data is collected, the second voice data is converted into third text data, and the data is displayed on the data collaboration interface. third text data; sending the third text data to the second electronic device in response to a confirmation operation acting on the data collaboration interface.
考虑到第二电子设备上可能开启了多个文档编辑应用,此时,第一电子设备可以通过接收到的应用通知消息,在数据协作界面上显示多个文档编辑应用的控件,从而响应于对多个文档编辑应用的控件的操作,实现用户基于第一电子设备上对多个文档编辑应用间的切换,例如,从第一文档编辑应用切换至第二文档编辑应用,并通过向第二电子设备发送切换消息使得第二电子设备将焦点切换至所述第二文档编辑应用的第二文档编辑框,从而实现在第二文档编辑框中输入第三文本数据的数据协作场景。使得数据协作功能可以适用多个文档编辑应用的场景,提高了数据协作的适用性。Considering that multiple document editing applications may be opened on the second electronic device, at this time, the first electronic device can display the controls of multiple document editing applications on the data collaboration interface through the received application notification message, so as to respond to the The operation of the controls of multiple document editing applications enables the user to switch between multiple document editing applications based on the first electronic device, for example, switching from the first document editing application to the second document editing application, and by sending the second electronic device The device sends a switching message to cause the second electronic device to switch the focus to the second document editing box of the second document editing application, thereby implementing a data collaboration scenario of inputting third text data in the second document editing box. The data collaboration function can be applied to scenarios of multiple document editing applications, and the applicability of data collaboration is improved.
一种可能的实现方式,满足第二条件时,第一电子设备缓存第二文本数据;所述第二 文本数据为所述第一电子设备与所述第二电子设备中断数据协作时在所述数据协作界面上显示的文本数据;所述第二条件用于指示所述第一电子设备与所述第二电子设备的数据协作中断;满足第三条件时,显示所述数据协作界面,并在所述数据协作界面上显示所述第二文本数据;所述第三条件用于指示所述第一电子设备与所述第二电子设备的数据协作恢复;第一电子设备向所述第二电子设备发送所述第二文本数据。In a possible implementation manner, when the second condition is met, the first electronic device caches second text data; the second text data is stored in the text data displayed on the data cooperation interface; the second condition is used to indicate that the data cooperation between the first electronic device and the second electronic device is interrupted; when the third condition is met, the data cooperation interface is displayed, and the The second text data is displayed on the data cooperation interface; the third condition is used to instruct the data cooperation recovery between the first electronic device and the second electronic device; the first electronic device reports to the second electronic device The device sends the second text data.
通过上述方法,在满足第二条件时,确定数据协作场景中断,从而第一电子设备将在所述数据协作界面上显示的文本数据缓存,避免由于数据协作场景中断导致用户输入的文本丢失的问题,当数据协作恢复时,即满足第三条件时,第一电子设备向第二电子设备发送第二文本数据,从而避免数据协作中断导致的用户输入的第二文本数据丢失,无法传输给第二电子设备,有效提高用户体验。Through the above method, when the second condition is met, it is determined that the data collaboration scene is interrupted, so that the first electronic device caches the text data displayed on the data collaboration interface, so as to avoid the loss of text input by the user due to the interruption of the data collaboration scene , when the data collaboration is restored, that is, when the third condition is met, the first electronic device sends the second text data to the second electronic device, so as to avoid the loss of the second text data input by the user caused by the interruption of the data collaboration, and cannot be transmitted to the second electronic device. Electronic equipment, effectively improve the user experience.
一种可能的实现方式,所述第二条件为:第一电子设备接收到所述第二电子设备发送的第二通知消息,所述第二通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断;或者,第一电子设备响应于所述第一电子设备的切换应用操作,在所述第一电子设备上显示切换后的应用界面;所述切换应用操作用于在所述第一电子设备上启动切换后的应用。A possible implementation manner, the second condition is: the first electronic device receives a second notification message sent by the second electronic device, and the second notification message is used to notify the second electronic device and the The data cooperation of the first electronic device is interrupted; or, the first electronic device displays the switched application interface on the first electronic device in response to the switching application operation of the first electronic device; the switching application operation uses in starting the switched application on the first electronic device.
通过上述方法,考虑到第二电子设备触发中断数据协作的场景,第一电子设备可以通过向第一电子设备发送的第二通知消息,确定数据协作已中断。另外,还可以是第一电子设备中,响应于所述第一电子设备的切换应用操作,确定数据协作中断。Through the above method, considering the scenario in which the second electronic device triggers the interruption of the data cooperation, the first electronic device may determine that the data cooperation has been interrupted through the second notification message sent to the first electronic device. In addition, it may also be that in the first electronic device, in response to the switching application operation of the first electronic device, it is determined that the data cooperation is interrupted.
一种可能的实现方式,第一电子设备响应于所述第一电子设备的切换应用操作后,还可以向所述第二电子设备发送中断通知消息;所述中断通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断。A possible implementation manner, after the first electronic device responds to the switching application operation of the first electronic device, it can also send an interruption notification message to the second electronic device; the interruption notification message is used to notify the The data cooperation between the second electronic device and the first electronic device is interrupted.
考虑第一电子设备中断数据协作的场景,第一电子设备可以向第二电子设备发送中断通知消息,从而使得第二电子设备确定数据协作已中断。Considering a scenario in which the first electronic device interrupts the data cooperation, the first electronic device may send an interruption notification message to the second electronic device, so that the second electronic device determines that the data cooperation has been interrupted.
一种可能的实现方式,第三条件为:A possible implementation, the third condition is:
第一触发条件,所述第一触发条件包括以下至少一项:响应于检测到对所述第一电子设备的手势,确定所述手势满足第一手势条件;所述第一手势条件包括:所述第一电子设备移动至与用户的距离大于第一阈值,小于第二阈值的范围内;所述手势包括:向上抬起,或向下移动;或者,所述第一电子设备未处于通话状态;或者,所述第一电子设备的摄像头模块未处于开启状态;或者,接收到所述第二电子设备发送的第三通知消息,所述第三通知消息用于通知所述第一电子设备恢复与所述第二电子设备的数据协作;或者,接收到所述第二电子设备发送的第三请求消息,所述第三请求消息用于请求所述第一电子设备恢复与所述第二电子设备的数据协作,在所述第一电子设备上的第二提示框中显示所述第三请求消息,响应于对所述第二提示框的操作,确认恢复所述第一电子设备与所述第二电子设备的数据协作。A first trigger condition, the first trigger condition includes at least one of the following: in response to detecting a gesture to the first electronic device, it is determined that the gesture satisfies a first gesture condition; the first gesture condition includes: all The first electronic device is moved to a range where the distance from the user is greater than the first threshold and less than the second threshold; the gesture includes: lifting up or moving down; or, the first electronic device is not in a call state ; or, the camera module of the first electronic device is not in an open state; or, a third notification message sent by the second electronic device is received, and the third notification message is used to notify the first electronic device to restore data cooperation with the second electronic device; or, receiving a third request message sent by the second electronic device, where the third request message is used to request the first electronic device to resume communication with the second electronic device data cooperation of the device, the third request message is displayed in the second prompt box on the first electronic device, and in response to the operation on the second prompt box, it is confirmed to restore the first electronic device and the Data collaboration of the second electronic device.
通过上述方法,可以是第一电子设备在满足第一触发条件时,确定第一电子设备想要恢复数据协作场景,还可以是第二电子设备想要恢复数据协作场景,向第一电子设备发送第三请求消息,还可以是第二电子设备确认恢复数据协作后,向第一电子设备发送第三通知消息,从而,适应不同的恢复数据协作场景,提高数据协作场景的可用性。Through the above method, the first electronic device may determine that the first electronic device wants to restore the data collaboration scene when the first trigger condition is satisfied, or the second electronic device may want to restore the data collaboration scene, and send the data to the first electronic device. The third request message may also be that the second electronic device sends a third notification message to the first electronic device after confirming the restoration of data collaboration, thereby adapting to different restoration data collaboration scenarios and improving the availability of data collaboration scenarios.
一种可能的实现方式,第一电子设备响应于对所述第二提示框的操作,确认恢复所述第一电子设备与所述第二电子设备的数据协作之后,还可以向所述第二电子设备发送恢复 数据协作消息;所述恢复数据协作消息用于确认恢复所述第一电子设备与所述第二电子设备的数据协作。A possible implementation manner, the first electronic device, in response to the operation on the second prompt box, confirms that the data cooperation between the first electronic device and the second electronic device is restored, and can also send a notification to the second electronic device. The electronic device sends a restore data cooperation message; the restore data cooperation message is used to confirm restoring the data cooperation between the first electronic device and the second electronic device.
通过上述方法,第一电子设备可以向第二电子设备发送恢复数据协作消息,以通知第二电子设备恢复数据协作,避免不恢复数据协作时对数据协作场景的误触发,提高用户对数据协作的使用体验。Through the above method, the first electronic device can send a resume data collaboration message to the second electronic device to notify the second electronic device to resume data collaboration, avoid false triggering of data collaboration scenarios when data collaboration is not resumed, and improve users' understanding of data collaboration. Use experience.
第三方面,本申请提供一种多设备数据协作的方法,应用于包括第一电子设备和第二电子设备的系统,第二电子设备上可以运行第一文档编辑应用。第二电子设备响应于在所述第二电子设备的第一文档编辑应用上的第一操作,在所述第二电子设备上显示所述第一文档编辑应用的第一文档编辑框;第二电子设备发送第一通知消息至第一电子设备,所述第一通知消息用于建立所述第一电子设备与所述第二电子设备的数据协作;第一电子设备接收来自第二电子设备的第一通知消息,显示第一提示框;所述第一提示框包括以下至少一项:第一提示信息和第一控件;所述第一提示信息用于提示用户是否开启与所述第二电子设备的数据协作;响应于作用于所述第一控件的第一用户操作,显示所述数据协作界面;采集第一语音数据,将所述第一语音数据转换为第一文本数据,在所述数据协作界面显示所述第一文本数据;响应于第二用户操作,向所述第二电子设备发送所述第一文本数据。第二电子设备接收所述第一电子设备发送的第一文本数据,在所述第一文档编辑框上显示所述第一文本数据。其中,第一用户操作可以是用户对第一控件的确认操作,第二用户操作可以是用户对数据协作界面的确认操作。In a third aspect, the present application provides a method for multi-device data collaboration, which is applied to a system including a first electronic device and a second electronic device, and the second electronic device can run a first document editing application. The second electronic device displays the first document editing box of the first document editing application on the second electronic device in response to the first operation on the first document editing application of the second electronic device; the second electronic device displays the first document editing box of the first document editing application on the second electronic device; The electronic device sends a first notification message to the first electronic device, where the first notification message is used to establish data cooperation between the first electronic device and the second electronic device; the first electronic device receives a message from the second electronic device A first notification message, displaying a first prompt box; the first prompt box includes at least one of the following: first prompt information and a first control; the first prompt information is used to prompt the user whether to turn on the communication with the second electronic device data collaboration of the device; in response to a first user operation acting on the first control, displaying the data collaboration interface; collecting first voice data, converting the first voice data into first text data, and in the The data collaboration interface displays the first text data; in response to a second user operation, the first text data is sent to the second electronic device. The second electronic device receives the first text data sent by the first electronic device, and displays the first text data on the first document editing box. The first user operation may be a user's confirmation operation on the first control, and the second user operation may be a user's confirmation operation on the data collaboration interface.
一种可能的实现方式,所述第一文档编辑应用为用户配置的文档编辑白名单中的应用。In a possible implementation manner, the first document editing application is an application in the document editing whitelist configured by the user.
一种可能的实现方式,所述第一操作,包括以下至少一项:开启所述第一文档编辑应用的操作,点击所述第一文档编辑应用中的文档编辑框的操作,切换所述第一文档编辑应用的操作,切换所述第一文档编辑应用中的文档编辑框的操作。A possible implementation manner, the first operation includes at least one of the following: an operation of opening the first document editing application, an operation of clicking a document editing box in the first document editing application, switching the first document editing application. An operation of a document editing application, an operation of switching the document editing box in the first document editing application.
一种可能的实现方式,所述数据协作界面还包括:编辑控件;将所述第一语音数据识别为初始文本数据,在所述数据协作界面上显示所述初始文本数据;响应于作用于所述编辑控件的第三用户操作,确定对所述初始文本数据的编辑指令,在所述数据协作界面上显示编辑后的初始文本数据;响应于作用所述数据协作界面的确认操作,将所述编辑后的初始文本数据作为所述第一文本数据。In a possible implementation manner, the data collaboration interface further includes: editing controls; identifying the first voice data as initial text data, and displaying the initial text data on the data collaboration interface; The third user operation of the editing control determines the editing instruction for the initial text data, and displays the edited initial text data on the data collaboration interface; in response to the confirmation operation acting on the data collaboration interface, the The edited initial text data is used as the first text data.
一种可能的实现方式,所述第一文本数据包括:初始文本数据和对所述初始文本数据的编辑指令。In a possible implementation manner, the first text data includes: initial text data and an editing instruction for the initial text data.
一种可能的实现方式,第一电子设备还可以接收所述第二电子设备发送的第一确认消息,其中,第一确认消息用于指示所述第二电子设备成功接收到所述第一文本数据;从而,第一电子设备可以删除所述数据协作界面上显示的所述第一文本数据。In a possible implementation manner, the first electronic device may also receive a first confirmation message sent by the second electronic device, where the first confirmation message is used to indicate that the second electronic device has successfully received the first text data; thus, the first electronic device can delete the first text data displayed on the data collaboration interface.
一种可能的实现方式,第二电子设备向第一电子设备发送第一通知消息之前,还可以显示第一查找设备界面;所述第一查找设备界面用于显示与所述第二电子设备建立通信连接的至少一个电子设备;响应于作用于所述第一查找设备界面上的所述至少一个电子设备中的第一电子设备的确认操作,确定发送所述第一通知消息的第一电子设备。In a possible implementation manner, before the second electronic device sends the first notification message to the first electronic device, it can also display a first search device interface; the first search device interface is used to display the establishment of at least one electronic device that is communicatively connected; in response to a confirmation operation acting on the first electronic device of the at least one electronic device on the first search device interface, determining the first electronic device that sent the first notification message .
一种可能的实现方式,所述第一电子设备还包括近距离无线通信装置;所述第一电子设备确定与所述第二电子设备的距离满足第一距离阈值时,通过近场通信发送通信连接请求至所述第二电子设备;第二电子设备与所述第一电子设备建立通信连接,在所述第二电子设备上或在第一电子设备上显示第一连接消息;所述第一连接消息用于提示用户所述第 二电子设备与所述第一电子设备建立通信连接。A possible implementation manner, the first electronic device further includes a short-range wireless communication device; when the first electronic device determines that the distance from the second electronic device meets a first distance threshold, the communication is sent through near-field communication A connection request is made to the second electronic device; the second electronic device establishes a communication connection with the first electronic device, and a first connection message is displayed on the second electronic device or on the first electronic device; the first electronic device The connection message is used to prompt the user to establish a communication connection between the second electronic device and the first electronic device.
一种可能的实现方式,第一电子设备响应于作用于所述第一控件的第一用于操作之后,还可以向所述第二电子设备发送第一响应消息;所述第一响应消息用于确认建立所述第一电子设备与所述第二电子设备的数据协作。第二电子设备向第一电子设备发送第一通知消息之后,还可以接收所述第一电子设备发送的第一响应消息,第一响应消息用于确认所述第一电子设备与所述第二电子设备建立数据协作;从而,第二电子设备可以显示第一响应消息。In a possible implementation manner, the first electronic device may also send a first response message to the second electronic device after responding to the first user operation acting on the first control; the first response message uses After confirming that the data cooperation between the first electronic device and the second electronic device is established. After the second electronic device sends the first notification message to the first electronic device, it may also receive a first response message sent by the first electronic device, where the first response message is used to confirm the relationship between the first electronic device and the second electronic device. The electronic device establishes the data collaboration; thus, the second electronic device can display the first response message.
一种可能的实现方式,所述第二电子设备上包括多个文档编辑应用;向所述第一电子设备发送第二通知消息;所述第二通知消息用于通知所述第二电子设备包括所述多个文档编辑应用;第一电子设备还可以接收所述第二电子设备的应用通知消息,在所述数据协作界面上显示所述多个文档编辑应用的控件;所述应用通知消息用于指示所述第二电子设备包括所述多个文档编辑应用;响应于作用于所述多个文档编辑应用的控件的切换操作,向所述第二电子设备发送切换消息;所述切换操作用于指示第二电子设备的焦点从第一文档编辑应用切换至第二文档编辑应用;第二电子设备接收所述第一电子设备发送的切换消息;所述切换消息用于指示所述第二电子设备将所述第二电子设备的焦点从第一文档编辑应用切换至第二文档编辑应用;在所述第二电子设备上将焦点切换至所述第二文档编辑应用的第二文档编辑框;第一电子设备采集第二语音数据,将所述第二语音数据转换为第三文本数据,在所述数据协作界面显示所述第三文本数据;响应于第二用户操作,第一电子设备向所述第二电子设备发送所述第三文本数据。第二电子设备接收所述第一电子设备发送的第三文本数据,在所述第二文档编辑框上显示所述第三文本数据。In a possible implementation manner, the second electronic device includes multiple document editing applications; a second notification message is sent to the first electronic device; the second notification message is used to notify the second electronic device of including the multiple document editing applications; the first electronic device may also receive application notification messages of the second electronic device, and display the controls of the multiple document editing applications on the data collaboration interface; the application notification messages use instructing the second electronic device to include the plurality of document editing applications; sending a switching message to the second electronic device in response to a switching operation of the controls acting on the plurality of document editing applications; the switching operation using instructing the second electronic device to switch the focus from the first document editing application to the second document editing application; the second electronic device receives a switching message sent by the first electronic device; the switching message is used to instruct the second electronic device The device switches the focus of the second electronic device from the first document editing application to the second document editing application; switches the focus to the second document editing box of the second document editing application on the second electronic device; The first electronic device collects the second voice data, converts the second voice data into third text data, and displays the third text data on the data cooperation interface; The second electronic device sends the third text data. The second electronic device receives the third text data sent by the first electronic device, and displays the third text data on the second document editing box.
一种可能的实现方式,满足第二条件时,第一电子设备缓存第二文本数据;所述第二文本数据为所述第一电子设备与所述第二电子设备中断数据协作时在所述数据协作界面上显示的文本数据;所述第二条件用于指示所述第一电子设备与所述第二电子设备的数据协作中断;满足第三条件时,显示所述数据协作界面,并在所述数据协作界面上显示所述第二文本数据;所述第三条件用于指示所述第一电子设备与所述第二电子设备的数据协作恢复;第一电子设备向所述第二电子设备发送所述第二文本数据。第二电子设备确定满足第一条件时,显示第三文档编辑应用;第二电子设备接收所述第一电子设备的第二文本数据,在所述第三文档编辑应用的第三文档编辑框上显示所述第二文本数据;所述第二文本数据为所述数据协作中断时所述第一电子设备生成的文本数据。其中,第一条件为:第二电子设备确定响应于对应用的第一切换操作,所述第一切换操作用于将所述第二电子设备的焦点切换至所述第三文档编辑应用;或者,第二电子设备确定接收所述第一电子设备的恢复数据协作消息,所述恢复数据协作消息用于请求恢复所述第一电子设备与所述第二电子设备的数据协作。In a possible implementation manner, when the second condition is met, the first electronic device caches second text data; the second text data is stored in the text data displayed on the data cooperation interface; the second condition is used to indicate that the data cooperation between the first electronic device and the second electronic device is interrupted; when the third condition is met, the data cooperation interface is displayed, and the The second text data is displayed on the data cooperation interface; the third condition is used to instruct the data cooperation recovery between the first electronic device and the second electronic device; the first electronic device reports to the second electronic device The device sends the second text data. When the second electronic device determines that the first condition is met, the third document editing application is displayed; the second electronic device receives the second text data of the first electronic device, and displays the second text data on the third document editing box of the third document editing application. The second text data is displayed; the second text data is text data generated by the first electronic device when the data cooperation is interrupted. The first condition is: the second electronic device determines that in response to a first switching operation on the application, the first switching operation is used to switch the focus of the second electronic device to the third document editing application; or , the second electronic device determines to receive a recovery data cooperation message of the first electronic device, where the recovery data coordination message is used to request recovery of the data cooperation between the first electronic device and the second electronic device.
一种可能的实现方式,所述第二条件为:第一电子设备接收到所述第二电子设备发送的第二通知消息,所述第二通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断;或者,第一电子设备响应于作用于所述第一电子设备的切换应用操作,显示切换后的应用界面;所述切换应用操作用于在所述第一电子设备上启动切换后的应用。A possible implementation manner, the second condition is: the first electronic device receives a second notification message sent by the second electronic device, and the second notification message is used to notify the second electronic device and the The data cooperation of the first electronic device is interrupted; or, the first electronic device displays the switched application interface in response to the switching application operation acting on the first electronic device; the switching application operation is used to Launch the switched application on the electronic device.
一种可能的实现方式,第二电子设备确定响应于所述文档编辑应用的第二切换操作,在所述第二电子设备上显示切换后的界面;所述第二切换操作用于将所述第二电子设备的焦点切换出所述第三文档编辑应用之外。通过第二电子设备向第一电子设备发送第二通知 消息;所述第二通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断。In a possible implementation manner, the second electronic device determines to display the switched interface on the second electronic device in response to the second switching operation of the document editing application; the second switching operation is used to switch the The focus of the second electronic device is switched out of the third document editing application. A second notification message is sent to the first electronic device through the second electronic device; the second notification message is used for notifying the second electronic device that the data cooperation between the second electronic device and the first electronic device is interrupted.
一种可能的实现方式,第三条件为:A possible implementation, the third condition is:
第一触发条件,所述第一触发条件包括以下至少一项:响应于检测到对所述第一电子设备的手势,确定所述手势满足第一手势条件;所述第一手势条件包括:所述第一电子设备移动至与用户的距离大于第一阈值,小于第二阈值的范围内;所述手势包括:向上抬起,或向下移动;或者,所述第一电子设备未处于通话状态;或者,所述第一电子设备的摄像头模块未处于开启状态;或者,接收到所述第二电子设备发送的第三通知消息,所述第三通知消息用于通知所述第一电子设备恢复与所述第二电子设备的数据协作;或者,接收到所述第二电子设备发送的第三请求消息,所述第三请求消息用于请求所述第一电子设备恢复与所述第二电子设备的数据协作,在所述第一电子设备上的第二提示框中显示所述第三请求消息,响应于对所述第二提示框的操作,确认恢复所述第一电子设备与所述第二电子设备的数据协作。A first trigger condition, the first trigger condition includes at least one of the following: in response to detecting a gesture to the first electronic device, it is determined that the gesture satisfies a first gesture condition; the first gesture condition includes: all The first electronic device is moved to a range where the distance from the user is greater than the first threshold and less than the second threshold; the gesture includes: lifting up or moving down; or, the first electronic device is not in a call state ; or, the camera module of the first electronic device is not in an open state; or, a third notification message sent by the second electronic device is received, and the third notification message is used to notify the first electronic device to restore data cooperation with the second electronic device; or, receiving a third request message sent by the second electronic device, where the third request message is used to request the first electronic device to resume communication with the second electronic device data cooperation of the device, the third request message is displayed in the second prompt box on the first electronic device, and in response to the operation on the second prompt box, it is confirmed to restore the first electronic device and the Data collaboration of the second electronic device.
一种可能的实现方式,第一电子设备向第二电子设备发送中断通知消息,第二电子设备接收所述第一电子设备的中断通知消息,中断通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断。A possible implementation manner, the first electronic device sends an interruption notification message to the second electronic device, the second electronic device receives the interruption notification message of the first electronic device, and the interruption notification message is used to notify the second electronic device to communicate with The data cooperation of the first electronic device is interrupted.
一种可能的实现方式,第二电子设备接收所述第一电子设备的第二文本数据之前,还可以向第一电子设备发送第三通知消息;所述第三通知消息用于通知所述第一电子设备恢复与所述第二电子设备的数据协作。A possible implementation manner, before the second electronic device receives the second text data of the first electronic device, may also send a third notification message to the first electronic device; the third notification message is used to notify the first electronic device of An electronic device resumes data cooperation with the second electronic device.
一种可能的实现方式,第二电子设备接收所述第一电子设备的第二文本数据之前,还可以向所述第一电子设备发送第三请求消息;所述第三请求消息用于请求恢复所述第一电子设备与所述第二电子设备的数据协作;第一电子设备向第二电子设备发送恢复数据协作消息;第二电子设备接收第一电子设备发送的恢复数据协作消息;所述恢复数据协作消息用于确认恢复所述第一电子设备与所述第二电子设备的数据协作。In a possible implementation manner, before the second electronic device receives the second text data of the first electronic device, it may also send a third request message to the first electronic device; the third request message is used to request recovery The first electronic device cooperates with the data of the second electronic device; the first electronic device sends a recovery data cooperation message to the second electronic device; the second electronic device receives the recovery data cooperation message sent by the first electronic device; the The restoring data collaboration message is used to confirm restoring the data collaboration between the first electronic device and the second electronic device.
第四方面,本申请提供一种电子设备,该电子设备包括:显示屏;一个或多个处理器;一个或多个存储器;其中,所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行上述第一方面、第二方面中任一可能的技术方案。In a fourth aspect, the present application provides an electronic device comprising: a display screen; one or more processors; one or more memories; wherein the one or more memories store one or more computer programs , the one or more computer programs include instructions, and when the instructions are executed by the one or more processors, make the electronic device execute any possible technical solution in the first aspect and the second aspect.
第五方面,还提供一种电子设备,该电子设备包括执行第一方面或者第二方面的任意一种可能的设计的方法的模块/单元;这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。In a fifth aspect, an electronic device is also provided, the electronic device includes modules/units for performing any possible design method of the first aspect or the second aspect; these modules/units can be implemented by hardware, or can be implemented by hardware Execute the corresponding software implementation.
第六方面,本申请实施例提供一种芯片,所述芯片与电子设备中的存储器耦合,执行本申请实施例第一方面或第二方面任一可能的技术方案;本申请实施例中“耦合”是指两个部件彼此直接或间接地结合。A sixth aspect, an embodiment of the present application provides a chip, the chip is coupled with a memory in an electronic device, and implements any possible technical solution of the first aspect or the second aspect of the embodiment of the present application; ” means that two components are joined directly or indirectly to each other.
第七方面,本申请实施例提供一种系统,该系统包括第四方面的电子设备或第五方面的电子设备。In a seventh aspect, an embodiment of the present application provides a system, where the system includes the electronic device of the fourth aspect or the electronic device of the fifth aspect.
第八方面,提供了一种计算机程序产品,计算机程序产品包括:计算机程序(也可以称为代码,或指令),当计算机程序被运行时,使得计算机执行上述第一方面或第二方面中任一种可能实现方式中的方法。In an eighth aspect, a computer program product is provided. The computer program product includes: a computer program (also referred to as code, or instructions), which, when the computer program is executed, causes the computer to execute any one of the first aspect or the second aspect. A method in a possible implementation.
第九方面,提供了一种计算机可读存储介质,计算机可读介质存储有计算机程序(也可以称为代码,或指令)当其在计算机上运行时,使得计算机执行上述第一方面或第二方 面中任一种可能实现方式中的方法。In a ninth aspect, there is provided a computer-readable storage medium, where the computer-readable medium stores a computer program (also referred to as code, or instruction), when it runs on a computer, causing the computer to execute the above-mentioned first aspect or the second A method in any of the possible implementations of an aspect.
第十方面,还提供一种电子设备上的图形用户界面,该电子设备具有显示屏、一个或多个存储器、以及一个或多个处理器,所述一个或多个处理器用于执行存储在所述一个或多个存储器中的一个或多个计算机程序,所述图形用户界面包括所述电子设备执行本申请实施例第一方面、第二方面或第三方面任一可能的技术方案时显示的图形用户界面。In a tenth aspect, there is also provided a graphical user interface on an electronic device, the electronic device having a display screen, one or more memories, and one or more processors configured to execute a memory stored in the device. One or more computer programs in the one or more memories, and the graphical user interface includes the information displayed when the electronic device executes any possible technical solution of the first aspect, the second aspect or the third aspect of the embodiments of the present application GUI.
附图说明Description of drawings
图1为本申请实施例提供的一种应用场景示意图;1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图2为本申请实施例提供的一种电子设备的结构示意图;FIG. 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图3为本申请实施例提供的一种安卓操作系统结构示意图;3 is a schematic structural diagram of an Android operating system provided by an embodiment of the present application;
图4a为本申请实施例提供的一种多设备数据协作的方法流程示意图;FIG. 4a is a schematic flowchart of a method for multi-device data collaboration provided by an embodiment of the present application;
图4b-图4g为本申请实施例提供的第二电子设备的文档编辑涉及的界面示意图;4b to 4g are schematic diagrams of interfaces involved in document editing of the second electronic device provided by the embodiments of the present application;
图5a-图5c为本申请实施例提供的第二电子设备的数据协作控制界面示意图;5a-5c are schematic diagrams of a data cooperation control interface of a second electronic device provided by an embodiment of the present application;
图5d为本申请实施例提供的第二电子设备的数据协作控制界面示意图;5d is a schematic diagram of a data cooperation control interface of a second electronic device provided by an embodiment of the present application;
图6a-图6c为本申请实施例提供的第一电子设备的界面的示意图;6a-6c are schematic diagrams of interfaces of a first electronic device provided by an embodiment of the present application;
图7a-图7b为本申请实施例提供的第二电子设备的数据协作界面示意图;7a-7b are schematic diagrams of a data collaboration interface of a second electronic device provided by an embodiment of the present application;
图8a-图8b为本申请实施例提供的第一电子设备的数据协作界面的示意图;8a-8b are schematic diagrams of a data collaboration interface of a first electronic device provided by an embodiment of the application;
图9a为本申请实施例提供的富文本字段示意图;9a is a schematic diagram of a rich text field provided by an embodiment of the present application;
图9b为本申请实施例提供的文本数据解析至键盘缓冲区的流程示意图;FIG. 9b is a schematic flowchart of text data parsing to a keyboard buffer provided by an embodiment of the present application;
图10a为本申请实施例提供的多设备数据协作的方法流程示意图;FIG. 10a is a schematic flowchart of a method for multi-device data collaboration provided by an embodiment of the present application;
图10b为本申请实施例提供的第一电子设备的数据协作控制界面示意图;10b is a schematic diagram of a data cooperation control interface of a first electronic device provided by an embodiment of the present application;
图10c为本申请实施例提供的第二电子设备的数据协作控制界面示意图;10c is a schematic diagram of a data cooperation control interface of a second electronic device provided by an embodiment of the present application;
图11为本申请实施例提供的第一电子设备的手势示意图;11 is a schematic diagram of a gesture of a first electronic device provided by an embodiment of the present application;
图12a为本申请实施例提供的多设备数据协作的方法流程示意图;FIG. 12a is a schematic flowchart of a method for multi-device data collaboration provided by an embodiment of the present application;
图12b为本申请实施例提供的第二电子设备的数据协作控制界面示意图;12b is a schematic diagram of a data cooperation control interface of a second electronic device provided by an embodiment of the present application;
图12c为本申请实施例提供的第一电子设备的数据协作控制界面示意图。FIG. 12c is a schematic diagram of a data cooperation control interface of a first electronic device provided by an embodiment of the present application.
具体实施方式detailed description
随着社会的快速发展,移动终端例如手机越来越普及。手机不但具有通信功能、还具有强大的处理能力、存储能力、照相功能等。因此,手机不仅可以作为一种通信工具,更是用户的移动的文件库,它可以与其他电子设备连接,用于传输用户的各种个人信息、照片、视频等信息。因此,基于移动终端的可移动性和便捷性,通过移动终端进行文稿创作,结合个人电脑上的文档编辑软件的文档编辑功能,可以适用于用户的各种文稿创作场景。基于此,本申请提供一种多设备数据协作方法。With the rapid development of society, mobile terminals such as cell phones are becoming more and more popular. Mobile phones not only have communication functions, but also have powerful processing capabilities, storage capabilities, and camera functions. Therefore, a mobile phone can not only be used as a communication tool, but also a mobile file library of the user. It can be connected with other electronic devices to transmit various personal information, photos, videos and other information of the user. Therefore, based on the mobility and convenience of the mobile terminal, document creation through the mobile terminal, combined with the document editing function of the document editing software on the personal computer, can be applied to various document creation scenarios of the user. Based on this, the present application provides a multi-device data collaboration method.
本申请实施例可以应用于诸如手机、平板电脑、可穿戴设备(例如,手表、手环、头盔、耳机等)、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、智能家居设备(例如,智能电视,智能音箱,智能摄像头等)等电子设备。可以理解的是,本申请实施例对电子设备的具体 类型不作任何限制。The embodiments of the present application can be applied to mobile phones, tablet computers, wearable devices (eg, watches, bracelets, helmets, headphones, etc.), in-vehicle devices, augmented reality (AR)/virtual reality (VR) Electronic devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices (eg, smart TVs, smart speakers, smart cameras, etc.) equipment. It can be understood that, the embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
参考图1,为本申请实施例提供的一种系统架构的简化示意图。如图1所示,该系统架构可以包括:第一电子设备101和第二电子设备102。第一电子设备101与第二电子设备102可以接入同一个局域网,也可以接入不同的局域网。其中,第一电子设备101与第二电子设备102接入在同一个局域网的示例,具体可以为:第一电子设备101和第二电子设备102与同一无线接入点建立无线连接。例如,第一电子设备101与第二电子设备102接入同一个无线保真(wireless fidelity,WI-FI)热点,再例如第一电子设备101和第二电子设备102也可以通过蓝牙协议接入同一个蓝牙信标下。再比如,第一电子设备101和第二电子设备102间也可以通过近距离无线通信技术(near field communication,NFC)标签触发通信连接,通过蓝牙模块传输加密信息进行身份认证。在认证成功后通过点对点(point to point,P2P)的方式进行数据传输。Referring to FIG. 1 , it is a simplified schematic diagram of a system architecture according to an embodiment of the present application. As shown in FIG. 1 , the system architecture may include: a first electronic device 101 and a second electronic device 102 . The first electronic device 101 and the second electronic device 102 may be connected to the same local area network, or may be connected to different local area networks. The example in which the first electronic device 101 and the second electronic device 102 are connected to the same local area network may specifically be: the first electronic device 101 and the second electronic device 102 establish a wireless connection with the same wireless access point. For example, the first electronic device 101 and the second electronic device 102 are connected to the same wireless fidelity (WI-FI) hotspot. For example, the first electronic device 101 and the second electronic device 102 can also be connected through the Bluetooth protocol. under the same bluetooth beacon. For another example, a communication connection between the first electronic device 101 and the second electronic device 102 can also be triggered by a near field communication (NFC) tag, and encrypted information can be transmitted through a Bluetooth module for identity authentication. After the authentication is successful, data transmission is carried out in a point-to-point (P2P) manner.
第二电子设备102也支持第一电子设备101建立网络连接的网络通信协议。第二电子设备102可以作为文本协作的目标客户端,从而实现通过第一电子设备101中输入协作数据,在第二电子设备102输出文本数据。在一些实施例中,第二电子设备102具体的可以为手机、平板、电脑,上述电脑可以为台式电脑,也可以为笔记本电脑等。The second electronic device 102 also supports the network communication protocol used by the first electronic device 101 to establish a network connection. The second electronic device 102 can be used as a target client for text collaboration, so that collaboration data is input in the first electronic device 101 and text data is output in the second electronic device 102 . In some embodiments, the second electronic device 102 may specifically be a mobile phone, a tablet, or a computer, and the above-mentioned computer may be a desktop computer, or a notebook computer or the like.
以下介绍第一电子设备101、用于第一电子设备101的图形用户界面(以下可以简称GUI)和用于第一电子设备101的实施例。在本申请一些实施例中,第一电子设备101可以是还包含其它功能诸如个人数字助理和/或音乐播放器功能的便携式电子设备,诸如手机、平板电脑、具备无线通讯功能的可穿戴设备(如智能手表)等。便携式电子设备的示例性实施例包括但不限于搭载
Figure PCTCN2021110646-appb-000001
或者其它操作系统的便携式电子设备。上述便携式电子设备也可以是其它便携式电子设备,诸如具有触敏表面(例如触控面板)的膝上型计算机(Laptop)等。还应当理解的是,在本申请其他一些实施例中,上述第一电子设备101也可以不是便携式电子设备,而是具有触敏表面(例如触控面板)的台式计算机。
The first electronic device 101 , a graphical user interface (hereinafter may be referred to as GUI for short) for the first electronic device 101 , and embodiments for the first electronic device 101 are described below. In some embodiments of the present application, the first electronic device 101 may be a portable electronic device that also includes other functions such as a personal digital assistant and/or a music player function, such as a mobile phone, a tablet computer, a wearable device with a wireless communication function ( such as smart watches). Exemplary embodiments of portable electronic devices include, but are not limited to, carry-on
Figure PCTCN2021110646-appb-000001
Or portable electronic devices with other operating systems. The portable electronic device described above may also be other portable electronic devices, such as a laptop computer (Laptop) or the like having a touch-sensitive surface (eg, a touch panel). It should also be understood that, in other embodiments of the present application, the above-mentioned first electronic device 101 may not be a portable electronic device, but a desktop computer having a touch-sensitive surface (eg, a touch panel).
应理解,本申请实施例中“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一(项)个”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a、b或c中的至少一项(个),可以表示:a,b,c,a和b,a和c,b和c,或a、b和c,其中a、b、c可以是单个,也可以是多个。It should be understood that, in the embodiments of the present application, "at least one" refers to one or more, and "a plurality" refers to two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the associated objects are an "or" relationship. "At least one (item) of the following" or its similar expression refers to any combination of these items, including any combination of single item (item) or plural item (item). For example, at least one (a) of a, b or c may represent: a, b, c, a and b, a and c, b and c, or a, b and c, where a, b, c Can be single or multiple.
请参考图2,电子设备200可以为本申请实施例中的第一电子设备101或第二电子设备102,本申请实施例这里以第一电子设备101为电子设备200为例,对本申请实施例提供的电子设备200进行介绍。其中,本领域技术人员可以理解,图2所示的电子设备200仅仅是一个范例,并不构成对电子设备200的限定,并且电子设备200可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图2中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。Referring to FIG. 2 , the electronic device 200 may be the first electronic device 101 or the second electronic device 102 in this embodiment of the present application. In this embodiment of the present application, the first electronic device 101 is taken as the electronic device 200 as an example. The provided electronic device 200 is introduced. Wherein, those skilled in the art can understand that the electronic device 200 shown in FIG. 2 is only an example, and does not constitute a limitation to the electronic device 200, and the electronic device 200 may have more or more than those shown in the figure. Fewer components, two or more components may be combined, or there may be different component configurations. The various components shown in Figure 2 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
电子设备200可以包括处理器210,外部存储器接口220,内部存储器221,USB接口230,充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块251,无线通信模块252,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机 接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及SIM卡接口295等。其中传感器模块280可以包括陀螺仪传感器280A,加速度传感器280B,接近光传感器280G、指纹传感器280H,触摸传感器280K(当然,电子设备200还可以包括其它传感器,比如温度传感器,压力传感器、距离传感器、磁传感器、环境光传感器、气压传感器、骨传导传感器等,图中未示出)。The electronic device 200 may include a processor 210 , an external memory interface 220 , an internal memory 221 , a USB interface 230 , a charging management module 240 , a power management module 241 , a battery 242 , an antenna 1 , an antenna 2 , a mobile communication module 251 , and a wireless communication module 252 , audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone jack 270D, sensor module 280, buttons 290, motor 291, indicator 292, camera 293, display screen 294, and SIM card interface 295 and so on. The sensor module 280 may include a gyroscope sensor 280A, an acceleration sensor 280B, a proximity light sensor 280G, a fingerprint sensor 280H, and a touch sensor 280K (of course, the electronic device 200 may also include other sensors, such as a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, ambient light sensor, air pressure sensor, bone conduction sensor, etc., not shown in the figure).
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备200的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or Neural-network Processing Unit (NPU) Wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors. The controller may be the nerve center and command center of the electronic device 200 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 210 for storing instructions and data. In some embodiments, the memory in processor 210 is cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.
处理器210可以运行本申请实施例提供的方法,处理器210可以包括不同的器件,比如集成CPU和GPU时,CPU和GPU可以配合执行本申请实施例提供的方法,比如该多设备数据协作的方法中部分算法由CPU执行,另一部分算法由GPU执行,以得到较快的处理效率。The processor 210 may execute the methods provided by the embodiments of the present application, and the processor 210 may include different devices. For example, when the CPU and the GPU are integrated, the CPU and the GPU may cooperate to execute the methods provided by the embodiments of the present application, such as the multi-device data cooperation. In the method, part of the algorithms are executed by the CPU, and the other part of the algorithms are executed by the GPU, so as to obtain faster processing efficiency.
显示屏294用于显示图像,视频等。显示屏294包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备200可以包括1个或N个显示屏294,N为大于1的正整数。显示屏294可用于显示由用户输入的信息或提供给用户的信息以及各种图形用户界面(graphical user interface,GUI)。例如,显示器294可以显示照片、视频、网页、或者文件等。再例如,显示器294可以显示如图1所示的第一电子设备101的图形用户界面。其中,如图1所示的图形用户界面上包括状态栏、Dock栏、可隐藏的导航栏、时间和天气小组件(widget)、以及应用的图标,例如浏览器图标等。状态栏中包括运营商名称(例如中国移动)、移动网络(例如4G)、时间和剩余电量。导航栏中可以包括后退(back)键图标、主屏幕(home)键图标和前进键图标。此外,可以理解的是,在一些实施例中,状态栏中还可以包括蓝牙图标、Wi-Fi图标、外接设备图标等。还可以理解的是,在另一些实施例中,图1所示的图形用户界面中还可以包括Dock栏,Dock栏中可以包括常用的应用图标等。当处理器210检测到用户的手指(或触控笔等)针对某一应用图标的触摸事件后,响应于该触摸事件,打开与该应用图标对应的应用的用户界面,并在显示器294上显示该应用的用户界面。 Display screen 294 is used to display images, videos, and the like. Display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light). emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 200 may include one or N display screens 294 , where N is a positive integer greater than one. The display screen 294 may be used to display information entered by or provided to the user as well as various graphical user interfaces (GUIs). For example, display 294 may display photos, videos, web pages, or documents, and the like. For another example, the display 294 may display the graphical user interface of the first electronic device 101 as shown in FIG. 1 . The graphical user interface shown in FIG. 1 includes a status bar, a Dock bar, a hideable navigation bar, a time and weather widget (widget), and an application icon, such as a browser icon. The status bar includes operator name (eg China Mobile), mobile network (eg 4G), time and remaining battery. The navigation bar may include a back key icon, a home key icon, and a forward key icon. In addition, it can be understood that, in some embodiments, the status bar may further include a Bluetooth icon, a Wi-Fi icon, an external device icon, and the like. It can also be understood that, in other embodiments, the graphical user interface shown in FIG. 1 may further include a Dock bar, and the Dock bar may include commonly used application icons and the like. After the processor 210 detects a touch event of the user's finger (or stylus, etc.) on an application icon, in response to the touch event, the user interface of the application corresponding to the application icon is opened and displayed on the display 294 The user interface of the application.
在本申请实施例中,显示屏294可以是一个一体的柔性显示屏,也可以采用两个刚性屏以及位于两个刚性屏之间的一个柔性屏组成的拼接显示屏。当处理器210运行本申请实施例提供的方法后,处理器210可以控制运行第一文档编辑应用,响应于在所述第二电子 设备的第一文档编辑应用上的第一操作,在所述第二电子设备上显示所述第一文档编辑应用的第一文档编辑框;发送第一通知消息至第一电子设备,所述第一通知消息用于建立所述第一电子设备与所述第二电子设备的数据协作;接收所述第一电子设备发送的第一文本数据,在所述第一文档编辑框上显示所述第一文本数据。In this embodiment of the present application, the display screen 294 may be an integrated flexible display screen, or a spliced display screen composed of two rigid screens and a flexible screen located between the two rigid screens. After the processor 210 executes the method provided by the embodiment of the present application, the processor 210 may control to execute the first document editing application, and in response to the first operation on the first document editing application of the second electronic device, the A first document editing box of the first document editing application is displayed on the second electronic device; a first notification message is sent to the first electronic device, and the first notification message is used to establish the relationship between the first electronic device and the first electronic device. Data collaboration between two electronic devices; receiving first text data sent by the first electronic device, and displaying the first text data on the first document editing box.
摄像头293(前置摄像头或者后置摄像头,或者一个摄像头既可作为前置摄像头,也可作为后置摄像头)用于捕获静态图像或视频。通常,摄像头293可以包括感光元件比如镜头组和图像传感器,其中,镜头组包括多个透镜(凸透镜或凹透镜),用于采集待拍摄物体反射的光信号,并将采集的光信号传递给图像传感器。图像传感器根据所述光信号生成待拍摄物体的原始图像。Camera 293 (front camera or rear camera, or a camera that can be both a front camera and a rear camera) is used to capture still images or video. Generally, the camera 293 may include a photosensitive element such as a lens group and an image sensor, wherein the lens group includes a plurality of lenses (convex or concave) for collecting the light signal reflected by the object to be photographed, and transmitting the collected light signal to the image sensor . The image sensor generates an original image of the object to be photographed according to the light signal.
内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行电子设备200的各种功能应用以及数据处理。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,应用程序(比如相机应用,微信应用等)的代码等。存储数据区可存储电子设备200使用过程中所创建的数据(比如相机应用采集的图像、视频等)等。 Internal memory 221 may be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the electronic device 200 by executing the instructions stored in the internal memory 221 . The internal memory 221 may include a storage program area and a storage data area. The storage program area may store operating system, code of application programs (such as camera application, WeChat application, etc.), and the like. The storage data area may store data created during the use of the electronic device 200 (eg, images, videos, etc. captured by a camera application).
内部存储器221还可以存储本申请实施例提供的多设备数据协作算法对应的一个或多个计算机程序1310。该一个或多个计算机程序1被存储在上述存储器221中并被配置为被该一个或多个处理器210执行,该一个或多个计算机程序1310包括指令,上述指令可以用于执行如图4a、图10a和图12a等相应实施例中的各个步骤,该计算机程序1310可以包括运行第一文档编辑应用。当内部存储器221中存储的多设备数据协作算法的代码被处理器210运行时,处理器210可以控制第二电子设备响应于在所述第二电子设备的第一文档编辑应用上的第一操作,在所述第二电子设备上显示所述第一文档编辑应用的第一文档编辑框;第二电子设备发送第一通知消息至第一电子设备,所述第一通知消息用于建立所述第一电子设备与所述第二电子设备的数据协作;第二电子设备接收所述第一电子设备发送的第一文本数据,在所述第一文档编辑框上显示所述第一文本数据。The internal memory 221 may also store one or more computer programs 1310 corresponding to the multi-device data cooperation algorithm provided in the embodiment of the present application. The one or more computer programs 1 are stored in the aforementioned memory 221 and configured to be executed by the one or more processors 210, the one or more computer programs 1310 comprising instructions which may be used to perform the execution as shown in Fig. 4a , Figure 10a and Figure 12a and other steps in the corresponding embodiments, the computer program 1310 may include running the first document editing application. When the code of the multi-device data cooperation algorithm stored in the internal memory 221 is executed by the processor 210, the processor 210 can control the second electronic device to respond to the first operation on the first document editing application of the second electronic device , displaying the first document editing box of the first document editing application on the second electronic device; the second electronic device sends a first notification message to the first electronic device, and the first notification message is used to create the The first electronic device cooperates with the data of the second electronic device; the second electronic device receives the first text data sent by the first electronic device, and displays the first text data on the first document editing box.
此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。In addition, the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
当然,本申请实施例提供的多设备数据协作算法的代码还可以存储在外部存储器中。这种情况下,处理器210可以通过外部存储器接口220运行存储在外部存储器中的多设备数据协作算法的代码,处理器210可以控制第二电子设备上可以运行第一文档编辑应用。响应于在所述第二电子设备的第一文档编辑应用上的第一操作,在所述第二电子设备上显示所述第一文档编辑应用的第一文档编辑框;发送第一通知消息至第一电子设备,所述第一通知消息用于建立所述第一电子设备与所述第二电子设备的数据协作;接收所述第一电子设备发送的第一文本数据,在所述第一文档编辑框上显示所述第一文本数据。Certainly, the code of the multi-device data cooperation algorithm provided in the embodiment of the present application may also be stored in an external memory. In this case, the processor 210 can run the code of the multi-device data cooperation algorithm stored in the external memory through the external memory interface 220, and the processor 210 can control the second electronic device to run the first document editing application. In response to a first operation on the first document editing application of the second electronic device, displaying a first document editing box of the first document editing application on the second electronic device; sending a first notification message to a first electronic device, where the first notification message is used to establish data cooperation between the first electronic device and the second electronic device; receiving the first text data sent by the first electronic device, in the first electronic device The first text data is displayed on the document edit box.
下面介绍传感器模块280的功能。The function of the sensor module 280 is described below.
陀螺仪传感器280A,可以用于确定电子设备200的运动姿态。在一些实施例中,可以通过陀螺仪传感器280A确定电子设备200围绕三个轴(即,x,y和z轴)的角速度。即陀螺仪传感器280A可以用于检测电子设备200当前的运动状态,比如抖动还是静止。The gyro sensor 280A can be used to determine the movement attitude of the electronic device 200 . In some embodiments, the angular velocity of electronic device 200 about three axes (ie, x, y, and z axes) may be determined by gyro sensor 280A. That is, the gyro sensor 280A can be used to detect the current motion state of the electronic device 200, such as shaking or stillness.
当本申请实施例中的显示屏为可折叠屏时,陀螺仪传感器280A可用于检测作用于显示屏294上的折叠或者展开操作。陀螺仪传感器280A可以将检测到的折叠操作或者展开操作作为事件上报给处理器210,以确定显示屏294的折叠状态或展开状态。When the display screen in the embodiment of the present application is a foldable screen, the gyro sensor 280A can be used to detect a folding or unfolding operation acting on the display screen 294 . The gyroscope sensor 280A may report the detected folding operation or unfolding operation to the processor 210 as an event to determine the folding state or unfolding state of the display screen 294 .
加速度传感器280B可检测电子设备200在各个方向上(一般为三轴)加速度的大小。即陀螺仪传感器280A可以用于检测电子设备200当前的运动状态,比如抖动还是静止。当本申请实施例中的显示屏为可折叠屏时,加速度传感器280B可用于检测作用于显示屏294上的折叠或者展开操作。加速度传感器280B可以将检测到的折叠操作或者展开操作作为事件上报给处理器210,以确定显示屏294的折叠状态或展开状态。The acceleration sensor 280B can detect the magnitude of the acceleration of the electronic device 200 in various directions (generally three axes). That is, the gyro sensor 280A can be used to detect the current motion state of the electronic device 200, such as shaking or stillness. When the display screen in the embodiment of the present application is a foldable screen, the acceleration sensor 280B can be used to detect a folding or unfolding operation acting on the display screen 294 . The acceleration sensor 280B may report the detected folding operation or unfolding operation to the processor 210 as an event to determine the folding state or unfolding state of the display screen 294 .
接近光传感器280G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。手机通过发光二极管向外发射红外光。手机使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定手机附近有物体。当检测到不充分的反射光时,手机可以确定手机附近没有物体。当本申请实施例中的显示屏为可折叠屏时,接近光传感器280G可以设置在可折叠的显示屏294的第一屏上,接近光传感器280G可根据红外信号的光程差来检测第一屏与第二屏的折叠角度或者展开角度的大小。 Proximity light sensor 280G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The mobile phone emits infrared light outward through light-emitting diodes. Phones use photodiodes to detect reflected infrared light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the phone. When insufficient reflected light is detected, the phone can determine that there are no objects near the phone. When the display screen in the embodiment of the present application is a foldable screen, the proximity light sensor 280G can be arranged on the first screen of the foldable display screen 294, and the proximity light sensor 280G can detect the first screen according to the optical path difference of the infrared signal. The size of the folding or unfolding angle between the screen and the second screen.
陀螺仪传感器280A(或加速度传感器280B)可以将检测到的运动状态信息(比如角速度)发送给处理器210。处理器210基于运动状态信息确定当前是手持状态还是脚架状态(比如,角速度不为0时,说明电子设备200处于手持状态)。The gyroscope sensor 280A (or the acceleration sensor 280B) may send the detected motion state information (such as angular velocity) to the processor 210 . The processor 210 determines whether the current state is the hand-held state or the tripod state based on the motion state information (for example, when the angular velocity is not 0, it means that the electronic device 200 is in the hand-held state).
指纹传感器280H用于采集指纹。电子设备200可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。The fingerprint sensor 280H is used to collect fingerprints. The electronic device 200 can use the collected fingerprint characteristics to realize fingerprint unlocking, accessing application locks, taking pictures with fingerprints, answering incoming calls with fingerprints, and the like.
触摸传感器280K,也称“触控面板”。触摸传感器280K可以设置于显示屏294,由触摸传感器280K与显示屏294组成触摸屏,也称“触控屏”。触摸传感器280K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏294提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器280K也可以设置于电子设备200的表面,与显示屏294所处的位置不同。 Touch sensor 280K, also called "touch panel". The touch sensor 280K may be disposed on the display screen 294, and the touch sensor 280K and the display screen 294 form a touch screen, also called a "touch screen". The touch sensor 280K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided through display screen 294 . In other embodiments, the touch sensor 280K may also be disposed on the surface of the electronic device 200 , which is different from the location where the display screen 294 is located.
示例性的,电子设备200的显示屏294显示主界面,主界面中包括多个应用(比如相机应用、微信应用等)的图标。用户通过触摸传感器280K点击主界面中相机应用的图标,触发处理器210启动相机应用,打开摄像头293。显示屏294显示相机应用的界面,例如取景界面。Exemplarily, the display screen 294 of the electronic device 200 displays a main interface, and the main interface includes icons of multiple applications (such as a camera application, a WeChat application, etc.). The user clicks the icon of the camera application in the main interface through the touch sensor 280K, which triggers the processor 210 to start the camera application and turn on the camera 293 . Display screen 294 displays an interface of a camera application, such as a viewfinder interface.
电子设备200的无线通信功能可以通过天线1,天线2,移动通信模块251,无线通信模块252,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 251, the wireless communication module 252, the modulation and demodulation processor, the baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。电子设备200中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 200 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块251可以提供应用在电子设备200上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块251可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块251可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块251还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块251的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块251的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。在本申请实施例中,移动通信模块251还可以用于与其它终端设备进行信息交互,即向其它终端设备发送请求,或者移动通信模块251可用于接收请求,并将接收的 请求封装成指定格式的消息。The mobile communication module 251 can provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 200 . The mobile communication module 251 may include at least one filter, switch, power amplifier, low noise amplifier (LNA) and the like. The mobile communication module 251 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 251 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 251 may be provided in the processor 210 . In some embodiments, at least part of the functional modules of the mobile communication module 251 may be provided in the same device as at least part of the modules of the processor 210 . In this embodiment of the present application, the mobile communication module 251 may also be used to exchange information with other terminal devices, that is, to send requests to other terminal devices, or the mobile communication module 251 may be used to receive requests and encapsulate the received requests into a specified format news.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器270A,受话器270B等)输出声音信号,或通过显示屏294显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器210,与移动通信模块251或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs sound signals through audio devices (not limited to the speaker 270A, the receiver 270B, etc.), or displays images or videos through the display screen 294 . In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modulation and demodulation processor may be independent of the processor 210, and may be provided in the same device as the mobile communication module 251 or other functional modules.
无线通信模块252可以提供应用在电子设备200上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),NFC,红外技术(infrared,IR)等无线通信的解决方案。无线通信模块252可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块252经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块252还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。本申请实施例中,无线通信模块252,用于与设备建立连接,通过设备输出通知消息。或者无线通信模块252可以用于接入接入点设备,与其他终端设备建立连接。例如,第二电子设备可以与第一电子设备建立通信连接。可选地,无线通信模块252还可以用于接收来自其它终端设备的数据。The wireless communication module 252 can provide applications on the electronic device 200 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellites System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), NFC, infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 252 may be one or more devices integrating at least one communication processing module. The wireless communication module 252 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 . The wireless communication module 252 can also receive the signal to be sent from the processor 210 , perform frequency modulation on the signal, amplify the signal, and then convert it into an electromagnetic wave for radiation through the antenna 2 . In this embodiment of the present application, the wireless communication module 252 is configured to establish a connection with a device, and output a notification message through the device. Alternatively, the wireless communication module 252 can be used to access the access point device and establish a connection with other terminal devices. For example, the second electronic device may establish a communication connection with the first electronic device. Optionally, the wireless communication module 252 can also be used to receive data from other terminal devices.
另外,电子设备200可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。例如音乐播放,录音等。电子设备200可以接收按键290输入,产生与电子设备200的用户设置以及功能控制有关的键信号输入。电子设备200可以利用马达291产生振动提示(比如来电振动提示)。电子设备200中的指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。电子设备200中的SIM卡接口295用于连接SIM卡。SIM卡可以通过插入SIM卡接口295,或从SIM卡接口295拔出,实现和电子设备200的接触和分离。In addition, the electronic device 200 may implement audio functions through an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, an application processor, and the like. Such as music playback, recording, etc. The electronic device 200 may receive key 290 inputs and generate key signal inputs related to user settings and function control of the electronic device 200 . The electronic device 200 may use the motor 291 to generate vibration alerts (eg, vibration alerts for incoming calls). The indicator 292 in the electronic device 200 can be an indicator light, which can be used to indicate a charging state, a change in power, and can also be used to indicate a message, a missed call, a notification, and the like. The SIM card interface 295 in the electronic device 200 is used to connect the SIM card. The SIM card can be contacted and separated from the electronic device 200 by inserting into the SIM card interface 295 or pulling out from the SIM card interface 295 .
应理解,在实际应用中,电子设备200可以包括比图2所示的更多或更少的部件,本申请实施例不作限定。图示电子设备200仅是一个范例,并且电子设备200可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that, in practical applications, the electronic device 200 may include more or less components than those shown in FIG. 2 , which are not limited in this embodiment of the present application. The illustrated electronic device 200 is only an example, and the electronic device 200 may have more or fewer components than those shown, two or more components may be combined, or a different configuration of components may be present. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
终端设备的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明终端设备的软件结构。图3是本发明实施例的终端设备的软件结构框图。示例性的,图3是一种可以运行在上述第一电子设备中的软件架构示意图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。如图3所示,该软件架构可以分为五层,分别为应用程序层,应用程序框架层,安卓运行时和系统库,硬件抽象层和Linux内核层。The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present invention take an Android system with a layered architecture as an example to exemplarily describe the software structure of a terminal device. FIG. 3 is a block diagram of a software structure of a terminal device according to an embodiment of the present invention. Exemplarily, FIG. 3 is a schematic diagram of a software architecture that can run in the above-mentioned first electronic device. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. As shown in Figure 3, the software architecture can be divided into five layers, namely the application layer, the application framework layer, the Android runtime and system library, the hardware abstraction layer and the Linux kernel layer.
应用程序层是操作系统的最上一层,包括操作系统的原生应用程序,例如电子邮件客户端、短信、通话、日历、浏览器、联系人等。本申请实施例涉及的APP,简称应用,为能够实现某项或多项特定功能的软件程序。通常,终端设备中可以安装多个应用。比如, 相机应用、邮箱应用、智能家居控制应用等。下文中提到的应用,可以是终端设备出厂时已安装的系统应用,也可以是用户在使用终端设备的过程中从网络下载或从其他终端设备获取的第三方应用。The application layer is the top layer of the operating system and includes the native applications of the operating system, such as email client, SMS, calling, calendar, browser, contacts, etc. The APP involved in the embodiments of the present application, referred to as an application for short, is a software program capable of implementing one or more specific functions. Typically, multiple applications can be installed in a terminal device. For example, camera applications, mailbox applications, smart home control applications, etc. The applications mentioned below may be system applications that have been installed when the terminal device is shipped from the factory, or may be third-party applications downloaded from the network or obtained from other terminal devices by the user during the use of the terminal device.
当然,对于开发者来说,开发者可以编写应用程序并安装到该层。应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。其中,窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。Of course, for developers, developers can write applications and install to this layer. The application framework layer can include window managers, content providers, view systems, telephony managers, resource managers, notification managers, etc. Among them, the window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
在本申请一些实施例中,应用程序层可以用于实现设置界面的呈现,上述设置界面可以用于用户设置第一电子设备101的数据协作功能。例如,用户可以在设置界面中进行数据协作功能的开启或关闭设置,还可以在设置界面中进行数据协作功能的配置,如数据协作功能可用的文档类型设置、登录认证的用户名和密码设置等。示例性的,上述设置界面可以为第一电子设备101的触摸屏上所显示的状态栏或通知栏中的内容,还可以是第一电子设备101的触摸屏上所显示的协作控制界面。In some embodiments of the present application, the application layer may be used to implement the presentation of a setting interface, and the above setting interface may be used by the user to set the data cooperation function of the first electronic device 101 . For example, the user can enable or disable the data collaboration function in the setting interface, and can also configure the data collaboration function in the setting interface, such as the document type settings available for the data collaboration function, and the user name and password settings for login authentication. Exemplarily, the above-mentioned setting interface may be the content in the status bar or notification bar displayed on the touch screen of the first electronic device 101 , or may be the cooperation control interface displayed on the touch screen of the first electronic device 101 .
一种可能的实现方式中,应用程序可以使用Java语言开发,通过调用应用程序框架层所提供的应用程序编程接口(application programming interface,API)来完成,开发者可以通过应用程序框架来与操作系统的底层(例如硬件抽象层、内核层等)进行交互,开发自己的应用程序。该应用程序框架主要是操作系统的一系列的服务和管理系统。In a possible implementation, the application can be developed using the Java language, by calling the application programming interface (API) provided by the application framework layer, and the developer can communicate with the operating system through the application framework. interact with the underlying layers (such as hardware abstraction layer, kernel layer, etc.) to develop their own applications. The application framework is mainly a series of services and management systems of the operating system.
在本申请一些实施例中,该应用程序框架层包含有文档编辑发现服务,其主要负责调用与硬件抽象层之间通信的服务接口,以将开启或关闭数据协作功能的请求传递到硬件抽象层,还负责进行文档编辑发现服务信息的管理,如触发文档编辑发现服务的文稿类型的管理(word\outlook\txt\notepad++\UltraEdit等),登录认证的用户名和密码的管理等。示例性的,文档编辑发现服务可以包括用于管理数据协作功能各种的模块。例如,文档编辑发现服务包括界面适配器、文稿发现设置、文稿发现状态机、本地控制器等。文档编辑发现服务还可以包括配置文件。其中,配置文件中可以包括可以触发文档编辑发现服务对应的文稿创作的应用的白名单。举例来说,白名单中的应用可以包括:文档编辑的应用,例如word,excel,wps,txt,notepad++,UltraEdit等。还可以是邮件应用,例如,outlook等邮件应用,还可以是即时通信应用,例如,微信,钉钉,淘宝客户端等,还可以是浏览器应用,例如,IE,火狐,等。当然,还可以是其他可能存在文稿创作的应用,例如,照片编辑应用等多媒体应用。例如,用户在制作相册、视频文件、语音文件等多媒体文件时可能需要进行文本编辑,因此,用户可以将该应用添加至白名单中,从而使得白名单中的应用存储于上述配置文件中,以使文档编辑发现服务可以在白名单中的应用开启时确定开启文档编辑场景。In some embodiments of the present application, the application framework layer includes a document editing discovery service, which is mainly responsible for invoking a service interface that communicates with the hardware abstraction layer, so as to transmit a request for enabling or disabling the data collaboration function to the hardware abstraction layer , is also responsible for the management of document editing discovery service information, such as the management of document types that trigger the document editing discovery service (word\outlook\txt\notepad++\UltraEdit, etc.), the management of user names and passwords for login authentication, etc. Illustratively, the document editing discovery service may include various modules for managing data collaboration functions. For example, document editing discovery services include interface adapters, document discovery settings, document discovery state machines, local controllers, and more. The document editing discovery service may also include configuration files. The configuration file may include a whitelist of applications that can trigger document creation corresponding to the document editing discovery service. For example, the applications in the whitelist may include: document editing applications, such as word, excel, wps, txt, notepad++, UltraEdit, and so on. It can also be a mail application, for example, an email application such as Outlook, an instant messaging application, such as WeChat, DingTalk, Taobao client, etc., or a browser application, such as IE, Firefox, etc. Of course, there may also be other applications where document creation may exist, for example, multimedia applications such as photo editing applications. For example, the user may need to edit the text when creating multimedia files such as photo albums, video files, and voice files. Therefore, the user can add the application to the whitelist, so that the applications in the whitelist are stored in the above configuration file, so that the Enables the document editing discovery service to determine the opening of the document editing scenario when the application in the whitelist is opened.
在其他一些实施例中,数据协作功能是作为第一电子设备中原有文档编辑功能的一个子功能实现,例如,数据协作功能可以作为华为手机的华为分享(Huawei Share)功能的一个子功能实现,此时,文档编辑发现服务可以以子模块的形式存在于Huawei Share应用中。In some other embodiments, the data collaboration function is implemented as a sub-function of the original document editing function in the first electronic device. For example, the data collaboration function can be implemented as a sub-function of the Huawei Share function of the Huawei mobile phone, At this point, the document editing discovery service can exist in the Huawei Share application in the form of a submodule.
其中,上述界面适配器用于为上层设置界面提供服务,例如,当用户对数据协作功能的协作开关按钮进行操作时,界面适配器可以为设置界面提供对应的服务,以便在设置界面中改变数据协作功能的协作开关按钮的状态(如,由关闭状态切换为开启状态)。上述文档编辑发现服务设置主要负责保存触发文档编辑发现服务的文稿类型和/或登录认证的用户名和密码。上述文稿发现状态机主要负责监控底层协作服务的运行状态。上述本地控制 器主要负责对底层的信号进行控制。上述配置文件主要用于存储协作目录、文件目录、用户的协作范围设置等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。电话管理器用于提供终端设备的通信功能。例如通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端设备振动,指示灯闪烁等。The above interface adapter is used to provide services for the upper-layer setting interface. For example, when the user operates the cooperation switch button of the data collaboration function, the interface adapter can provide corresponding services for the setting interface, so as to change the data collaboration function in the setting interface. The state of the cooperating switch button (eg, switching from an off state to an on state). The above document editing discovery service settings are mainly responsible for saving the document type that triggers the document editing discovery service and/or the username and password for login authentication. The above manuscript finds that the state machine is mainly responsible for monitoring the running state of the underlying collaboration service. The above local controller is mainly responsible for controlling the underlying signals. The above configuration files are mainly used to store collaboration directories, file directories, and user collaboration scope settings. Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures. The telephony manager is used to provide the communication function of the terminal device. For example, the management of call status (including connecting, hanging up, etc.). The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on. The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the terminal device vibrates, and the indicator light flashes.
本申请实施例中,应用程序框架层还可以包含文件观察器、WI-FI服务、通知管理器,这三个模块主要负责配合文档编辑发现服务以提供数据协作功能。如WI-FI服务用于监控第一电子设备是否接入无线接入点。再例如,通知管理器用于向上层传输通知消息,以便在第一电子设备的触摸屏中进行呈现。In the embodiment of the present application, the application framework layer may further include a file observer, a WI-FI service, and a notification manager. These three modules are mainly responsible for cooperating with the document editing and discovery service to provide a data collaboration function. For example, the WI-FI service is used to monitor whether the first electronic device is connected to the wireless access point. For another example, the notification manager is configured to transmit the notification message to the upper layer for presentation on the touch screen of the first electronic device.
安卓运行时包括核心库和虚拟机。安卓运行时负责安卓系统的调度和管理。安卓系统的核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓系统的核心库。应用程序层和应用程序框架层运行在虚拟机中。以java举例,虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The Android runtime includes core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system. The core library of the Android system consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of the Android system. The application layer and the application framework layer run in virtual machines. Taking java as an example, the virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器,媒体库,三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了二维和三维图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。二维图形引擎是二维绘图的绘图引擎。A system library can include multiple functional modules. For example: surface manager, media library, 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc. The Surface Manager manages the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing. A 2D graphics engine is a drawing engine for 2D drawing.
在本申请一些实施例中,系统库还可以包括:数据协作配置,文档编辑发现服务密码,文档编辑发现配置文件,用于负责提供与应用程序框架层进行通信的服务接口,还负责管理数据协作服务,管理文稿发现配置文件、文档编辑发现服务密码等。该文稿发现配置文件可用于存储文档编辑发现服务信息,例如,文档编辑发现服务的密码可用于存储登录认证的用户名和密码等信息。In some embodiments of the present application, the system library may further include: data collaboration configuration, document editing discovery service password, document editing discovery configuration file, responsible for providing a service interface for communicating with the application framework layer, and also responsible for managing data collaboration Services, manage document discovery configuration files, document editing discovery service passwords, etc. The document discovery configuration file can be used to store the information of the document editing discovery service, for example, the password of the document editing discovery service can be used to store information such as the user name and password of the login authentication.
硬件抽象层(Hardware Abstraction Layer,HAL)是应用程序框架的支撑,是连接应用程序框架层与Linux内核层的重要纽带,其可通过应用程序框架层为开发者提供服务。The Hardware Abstraction Layer (HAL) is the support of the application framework and an important link between the application framework layer and the Linux kernel layer. It can provide services for developers through the application framework layer.
示例性的,可以通过在硬件抽象层配置第一进程来实现本申请实施例中数据协作服务和文档编辑发现服务的功能,第一进程可以是在硬件抽象层中单独构建的子进程。其中,第一进程可以包括接口、文档编辑发现控制器、数据协作控制器和文档编辑发现配置接口等模块。其中,上述接口是与应用程序框架层进行通信的服务接口。其中,文档编辑发现控制器用于对上层的文档编辑发现服务配置进行监控,例如,对是否需要进行鉴权进行控 制等。上述文档编辑发现控制器主要负责监控第一电子设备中输入的数据是否需要缓存或有更新,当输入的数据需要缓存或者有更新时,可以通知上层进行协作目录等的缓存或更新。硬件抽象层中还可以包含有守护进程,该守护进程可以用于缓存第一进程中的数据,其可以是在硬件抽象层中单独构建的子进程。Exemplarily, the functions of the data collaboration service and the document editing discovery service in the embodiments of the present application may be implemented by configuring the first process in the hardware abstraction layer, and the first process may be a subprocess constructed separately in the hardware abstraction layer. The first process may include modules such as an interface, a document editing discovery controller, a data collaboration controller, and a document editing discovery configuration interface. The above interface is a service interface that communicates with the application framework layer. The document editing discovery controller is used to monitor the configuration of the upper-layer document editing discovery service, for example, to control whether authentication is required. The above-mentioned document editing discovery controller is mainly responsible for monitoring whether the input data in the first electronic device needs to be cached or updated. A daemon process may also be included in the hardware abstraction layer, and the daemon process may be used to cache data in the first process, which may be a subprocess constructed separately in the hardware abstraction layer.
Linux内核(Linux Kernel)层提供操作系统的核心系统服务,如安全性、内存管理、进程管理、网络协议栈和驱动模型等都基于Linux内核。Linux内核同时也作为硬件和软件栈之间的抽象层。该层有许多与电子设备相关的驱动程序,主要的驱动有:显示驱动;基于Linux的帧缓冲驱动;作为输入设备的键盘驱动;基于内存技术设备的Flash驱动;照相机驱动;音频驱动;蓝牙驱动;WI-FI驱动等。在本申请一些实施例中,Linux内核依赖于本地文件系统。通过协作服务可以访问该本地文件系统,通过硬件抽象层的服务接口可以对本地文件系统中的协作数据进行配置。The Linux Kernel layer provides the core system services of the operating system, such as security, memory management, process management, network protocol stack and driver model, all based on the Linux kernel. The Linux kernel also acts as an abstraction layer between the hardware and software stacks. This layer has many drivers related to electronic devices, the main drivers are: display driver; Linux-based frame buffer driver; keyboard driver as input device; Flash driver based on memory technology device; camera driver; audio driver; Bluetooth driver ; WI-FI driver, etc. In some embodiments of the present application, the Linux kernel relies on the local file system. The local file system can be accessed through the collaboration service, and the collaboration data in the local file system can be configured through the service interface of the hardware abstraction layer.
以下实施例中所涉及的技术方案均可以在具有上述硬件架构和软件架构的电子设备中实现。The technical solutions involved in the following embodiments can all be implemented in an electronic device having the above-mentioned hardware architecture and software architecture.
为了便于理解,本申请实施例以第一电子设备为手机,第二电子设备为笔记本电脑,且通过笔记本电脑访问手机中的协作数据为例,对本申请实施例提供的多设备的文本处理方法进行具体介绍。如图4a所示,包括以下步骤:For ease of understanding, in this embodiment of the present application, the first electronic device is a mobile phone, the second electronic device is a laptop computer, and the collaboration data in the mobile phone is accessed through the laptop computer as an example, and the text processing method for multiple devices provided in the embodiment of the present application is performed. Specific introduction. As shown in Figure 4a, the following steps are included:
S401、第二电子设备的文档编辑发现服务,确定第二电子设备处于文档编辑的场景。S401. The document editing discovery service of the second electronic device determines that the second electronic device is in a scene of document editing.
在本申请的一些实施例中,响应于在所述第二电子设备的文档编辑应用上的第一操作,在所述第二电子设备上显示所述文档编辑应用的第一文档编辑框。其中,所述第一操作,可以包括以下至少一项:开启第一文档编辑应用的操作,点击第一文档编辑应用中的文档编辑框的操作,切换第一文档编辑应用的操作,切换第一文档编辑应用中的文档编辑框的操作。In some embodiments of the present application, in response to a first operation on the document editing application of the second electronic device, a first document editing box of the document editing application is displayed on the second electronic device. The first operation may include at least one of the following: an operation of opening a first document editing application, an operation of clicking a document editing box in the first document editing application, an operation of switching the first document editing application, and an operation of switching the first document editing application. The operation of the document editing box in the document editing application.
一种可能的方式,文档编辑发现服务可以通过查看当前进程,确定第二电子设备当前开启的文档编辑的应用。例如,响应于作用于在第二电子设备上开启word应用的操作,第二电子设备开启word应用的进程,从而,文档编辑发现服务可以在进程中确定word应用的进程已启用,再比如,响应于用于在第二电子设备上开启邮件应用的操作,第二电子设备开启邮件应用的进程,从而,文档编辑发现服务可以在进程中确定邮件应用的进程已启用。或者,上述应用还可以是浏览器应用,即时通信应用等属于白名单的应用,在此不作限定。In a possible manner, the document editing discovery service may determine the document editing application currently opened by the second electronic device by viewing the current process. For example, in response to the operation for opening the word application on the second electronic device, the second electronic device starts the process of the word application, so that the document editing discovery service can determine in the process that the process of the word application has been enabled, and for another example, in response to In the operation for opening the mail application on the second electronic device, the second electronic device starts the process of the mail application, so that the document editing discovery service can determine during the process that the process of the mail application has been enabled. Alternatively, the above application may also be a browser application, an instant messaging application and other applications belonging to a white list, which are not limited herein.
另一种可能的方式,第二电子设备可以设置有文档编辑发现服务,例如,文档编辑发现服务可以识别第二电子设备当前的焦点为文本编辑框。文本编辑框可以为具有文本编辑功能的应用中的文本编辑框。具有文本编辑功能的应用(文档编辑应用)可以是浏览器,邮件收发应用,图片编辑应用,通话应用,视频浏览应用,文档编辑应用等。In another possible manner, the second electronic device may be provided with a document editing discovery service, for example, the document editing discovery service may identify that the current focus of the second electronic device is a text editing box. The text editing box may be a text editing box in an application with a text editing function. An application with a text editing function (document editing application) may be a browser, a mail sending and receiving application, a picture editing application, a calling application, a video browsing application, a document editing application, and the like.
下面通过方式1-方式2举例说明第二电子设备的文档编辑发现服务确定第二电子设备处于文档编辑场景的可能的方式。The following describes possible ways in which the document editing discovery service of the second electronic device determines that the second electronic device is in a document editing scenario by way of example 1 to way 2.
方式1,以文档编辑应用为word为例,响应于用户开启word应用的操作,第二电子设备开启word应用,并在第二电子设备的显示屏上显示文档开启界面,文档开启界面中可以显示用于开启文档的控件(例如,如图4b所示,打开控件4013)等。如图4b所示,响应于用户开启第一文档的操作,第二电子设备可以显示打开文档界面4016,其中,打开文档界面4016可以包括多个文本编辑框4017,例如,输入文件名的文本编辑框,输入文 档路径的文本编辑框,搜索输入框。第二电子设备在word应用中显示第一文档的编辑界面。如图4c所示,第一文档的编辑界面中可以包括至少一个可编辑的文本编辑框,例如,可以包括文本编辑的主界面4010,还可以包括搜索栏的文本编辑框4011,还可以包括工具栏中的文本编辑框,例如,在工具栏中的开始标签页中,可以包括字体、字号的文本编辑框4012,在工具栏中的页面布局标签页中,可以包括段落相应的文本编辑框,再比如,如图4d所示,在word开启公式编辑器的界面时,还可以公式编辑器的界面可以包括公式编辑的文本编辑框4014,或者,如图4e所示,word的编辑界面中,还可以包括可编辑的文本编辑框4015,该文本编辑框中可以插入的内容包括:图片类型,ppt类型,还可以是其他可编辑的图类型,例如,viso等画图应用生成的文件。Mode 1, taking the document editing application as word as an example, in response to the user's operation of opening the word application, the second electronic device opens the word application, and displays a document opening interface on the display screen of the second electronic device, and the document opening interface can display A control for opening a document (eg, as shown in FIG. 4b, open control 4013), and the like. As shown in FIG. 4b, in response to the user's operation of opening the first document, the second electronic device may display an open document interface 4016, wherein the open document interface 4016 may include a plurality of text editing boxes 4017, for example, text editing for entering a file name box, text edit box to enter the document path, search input box. The second electronic device displays the editing interface of the first document in the word application. As shown in FIG. 4c, the editing interface of the first document may include at least one editable text editing box, for example, it may include a main interface 4010 for text editing, a text editing box 4011 for a search bar, and a tool The text edit box in the bar, for example, in the start tab page in the toolbar, the text edit box 4012 of font and font size can be included, and in the page layout tab page in the toolbar, the text edit box corresponding to the paragraph can be included, For another example, as shown in Figure 4d, when word opens the interface of the formula editor, the interface of the formula editor may also include a text editing box 4014 for formula editing, or, as shown in Figure 4e, in the editing interface of word, It can also include an editable text editing box 4015, and the content that can be inserted in the text editing box includes: picture type, ppt type, and other editable picture types, for example, files generated by drawing applications such as viso.
响应于作用于可编辑的文本编辑框的点击操作时,word应用可以将可编辑的文本编辑框处于可编辑状态(例如,如图4e所示的4015表示的虚线框,当然还可以是通过其他方式标识可编辑状态,在此不做限定),此时,用户可以对插入的内容进行编辑。响应于作用于可编辑的文本编辑框的关闭操作时,word应用可以将可编辑的文本编辑框处于不可编辑状态,此时,word应用关闭对插入的内容进行编辑的功能。In response to a click operation acting on the editable text edit box, the word application can put the editable text edit box in an editable state (for example, the dotted box represented by 4015 shown in FIG. The mode identifies the editable state, which is not limited here), at this time, the user can edit the inserted content. In response to the closing operation acting on the editable text editing box, the word application may place the editable text editing box in an uneditable state, and at this time, the word application disables the function of editing the inserted content.
下面以方式1.1-方式1.3举例说明确定触发S403的可能场景。The following uses mode 1.1 to mode 1.3 to illustrate possible scenarios for determining the triggering of S403.
方式1.1,文档编辑发现服务将应用中的文档编辑框,都作为文档编辑场景的文档编辑框。此时,第二电子设备可以在确定文档编辑场景后,执行S403。In mode 1.1, the document editing discovery service uses the document editing boxes in the application as the document editing boxes of the document editing scene. At this time, the second electronic device may execute S403 after determining the document editing scene.
响应于作用于文本编辑框的操作,word应用可以将焦点在文本编辑框之间进行切换,例如,响应于作用于主界面的点击操作,word应用将第一文档的光标显示在主界面4010上。此时,文档编辑发现服务可以识别第二电子设备当前的焦点为主界面4010。响应于作用于文本编辑框4015的点击操作,word应用将第一文档的焦点显示在文本编辑框4015内。此时,文档编辑发现服务可以识别第二电子设备当前的焦点为文本编辑框4015。响应于作用于文本编辑框4015的关闭操作,word应用将第一文档的焦点显示在主界面4010内。此时,文档编辑发现服务可以识别第二电子设备当前的焦点为文本编辑框4010。In response to an operation acting on the text edit boxes, the word application can switch the focus between the text edit boxes. For example, in response to a click operation acting on the main interface, the word application displays the cursor of the first document on the main interface 4010 . At this time, the document editing discovery service can identify the current focus of the second electronic device as the main interface 4010 . In response to the click operation acting on the text edit box 4015 , the word application displays the focus of the first document within the text edit box 4015 . At this time, the document editing discovery service may identify that the current focus of the second electronic device is the text editing box 4015 . In response to the closing operation acting on the text edit box 4015 , the word application displays the focus of the first document in the main interface 4010 . At this time, the document editing discovery service may identify that the current focus of the second electronic device is the text editing box 4010 .
方式1.2,可以通过下述S403中由用户确认触发数据协作场景中的文档编辑框,从而通过用户确认建立数据协作场景,以触发第二电子设备向第一电子设备发送第一通知消息。In Manner 1.2, the document editing box in the data collaboration scenario can be triggered by user confirmation in the following S403, thereby establishing a data collaboration scenario through user confirmation, so as to trigger the second electronic device to send the first notification message to the first electronic device.
举例来说,如图4f中的(a)所示,触发数据协作场景的操作可以是文档编辑发现服务界面上的触发数据协作场景的控件4018,如图4f中的(b)所示,也可以是嵌入文档编辑应用的文档编辑发现控件4018,在此不做限定。在该方式下,响应于用户选择文档编辑应用的文本编辑框(例如,主界面4010)和触发数据协作场景的控件的操作,第二电子设备可以确定触发数据协作场景。For example, as shown in (a) of FIG. 4f, the operation to trigger the data collaboration scenario may be the control 4018 on the document editing discovery service interface that triggers the data collaboration scenario, as shown in (b) of FIG. 4f, and also It may be the document editing discovery control 4018 embedded in the document editing application, which is not limited here. In this manner, in response to the user selecting the text editing box (eg, the main interface 4010 ) of the document editing application and the operation of the control triggering the data collaboration scenario, the second electronic device may determine to trigger the data collaboration scenario.
方式1.3,文档编辑发现服务可以根据应用中的文档编辑框的类型,确定触发文档编辑的场景的文档编辑框。举例来说,响应于用户选择预设类型的文本编辑框的操作,第二电子设备确定触发数据协作场景。例如,预设类型的文本编辑框可以为用户或系统预设的可能用于数据协作的文本编辑框,该文本编辑框可以是输入长文本的文本编辑框。结合上述例子,预设类型的文本编辑框可以是主界面4010,文本编辑框4010等。此时,第二电子设备可以根据第二电子设备的显示焦点位于主界面4010,可以确定触发数据协作场景,以执行S403。In mode 1.3, the document editing discovery service may determine the document editing box of the scene that triggers the document editing according to the type of the document editing box in the application. For example, in response to the user's operation of selecting a text editing box of a preset type, the second electronic device determines to trigger a data collaboration scenario. For example, a text editing box of a preset type may be a text editing box preset by a user or a system that may be used for data collaboration, and the text editing box may be a text editing box for inputting long text. In combination with the above examples, the text editing box of the preset type may be the main interface 4010, the text editing box 4010, and the like. At this time, the second electronic device may be located on the main interface 4010 according to the display focus of the second electronic device, and may determine to trigger a data collaboration scenario to execute S403.
方式2,以文档编辑应用为邮件应用为例,响应于用户开启邮件应用的操作,第二电子设备开启邮件应用,并在第二电子设备的显示屏上显示邮件应用界面,如图4g中的(a) 所示,邮件应用界面中可以显示用于开启邮件编辑的控件(例如,如图4g中的(a)中的文件控件),还可以包括搜索栏的文本编辑框4021等。响应于用户开启第一邮件的操作,第二电子设备在邮件应用中显示第一邮件的编辑界面。如图4g中的(b)所示,第一邮件的编辑界面中可以包括至少一个可编辑的文本编辑框,例如,可以包括文本编辑的主界面4020、收件人编辑框4022、主题编辑框4023等,还可以包括搜索栏中的文本编辑框4024。Mode 2, taking the document editing application as the mail application as an example, in response to the operation of the user opening the mail application, the second electronic device opens the mail application, and displays the mail application interface on the display screen of the second electronic device, as shown in Figure 4g. As shown in (a), the mail application interface may display a control for enabling mail editing (eg, the file control in (a) in FIG. 4g ), and may also include a text editing box 4021 of the search bar and the like. In response to the user's operation of opening the first email, the second electronic device displays an editing interface of the first email in the email application. As shown in (b) of FIG. 4g, the editing interface of the first email may include at least one editable text editing box, for example, may include a text editing main interface 4020, a recipient editing box 4022, a subject editing box 4023, etc., and may also include a text edit box 4024 in the search bar.
下面以方式2.1-方式2.3举例说明确定触发S403的可能场景。The following uses Mode 2.1 to Mode 2.3 as an example to illustrate the possible scenarios for determining the triggering of S403.
方式2.1,文档编辑发现服务将应用中的编辑框,例如,文本编辑框4021,主界面4020、收件人编辑框4022、主题编辑框4023,文本编辑框4024等,都作为文档编辑场景的文档编辑框。此时,第二电子设备可以在确定文档编辑场景后,执行S403。Mode 2.1, the document editing discovery service uses the editing boxes in the application, for example, the text editing box 4021, the main interface 4020, the recipient editing box 4022, the subject editing box 4023, the text editing box 4024, etc., as the documents of the document editing scene Edit box. At this time, the second electronic device may execute S403 after determining the document editing scene.
响应于作用于文本编辑框的操作,邮件应用可以将焦点在文本编辑框之间进行切换,例如,响应于作用于主界面4020的点击操作,邮件应用将第一文档的光标显示在主界面4020上。此时,文档编辑发现服务可以识别第二电子设备当前的焦点为主界面4020。响应于作用于文本编辑框4022的操作,邮件应用将第一文档的焦点显示在文本编辑框4022内。此时,文档编辑发现服务可以识别第二电子设备当前的焦点为文本编辑框4022。In response to the operation acting on the text editing boxes, the mail application can switch the focus between the text editing boxes. For example, in response to the clicking operation acting on the main interface 4020, the mail application displays the cursor of the first document on the main interface 4020. superior. At this time, the document editing discovery service may identify the current focus of the second electronic device as the main interface 4020 . In response to the operation on the text edit box 4022, the mail application displays the focus of the first document within the text edit box 4022. At this time, the document editing discovery service may identify that the current focus of the second electronic device is the text editing box 4022 .
方式2.2,可以通过下述S403中由用户确认触发数据协作场景中的文档编辑框,从而通过用户确认建立数据协作场景,以触发第二电子设备向第一电子设备发送第一通知。Mode 2.2, the document editing box in the data collaboration scenario can be triggered by user confirmation in S403, so as to establish a data collaboration scenario through user confirmation to trigger the second electronic device to send the first notification to the first electronic device.
举例来说,触发数据协作场景的操作可以是文档编辑发现服务界面上的触发数据协作场景的控件,也可以是嵌入文档编辑应用的文档编辑发现控件,在此不做限定。在该方式下,响应于用户选择文档编辑应用的文本编辑框4020和触发数据协作场景的控件的操作,第二电子设备可以确定触发数据协作场景。具体可以参考方式1.2中的实施方式,在此不再赘述。For example, the operation for triggering the data collaboration scenario may be a control on the document editing discovery service interface that triggers the data collaboration scenario, or may be a document editing discovery control embedded in a document editing application, which is not limited herein. In this manner, in response to the user selecting the text editing box 4020 of the document editing application and the operation of the control triggering the data collaboration scenario, the second electronic device may determine to trigger the data collaboration scenario. For details, reference may be made to the implementation manner in manner 1.2, which will not be repeated here.
方式2.3,文档编辑发现服务可以根据应用中的文档编辑框的类型,确定触发文档编辑的场景的文档编辑框。举例来说,响应于用户选择预设类型的文本编辑框的操作,第二电子设备确定触发数据协作场景。例如,预设类型的文本编辑框可以为用户或系统预设的可能用于数据协作的文本编辑框,该文本编辑框可以是输入长文本的文本编辑框。结合上述例子,预设类型的文本编辑框可以是主界面4020,文本编辑框4024等。此时,第二电子设备可以根据第二电子设备的显示焦点位于主界面4020,可以确定触发数据协作场景,以执行S403。In mode 2.3, the document editing discovery service may determine the document editing box of the scene that triggers the document editing according to the type of the document editing box in the application. For example, in response to the user's operation of selecting a text editing box of a preset type, the second electronic device determines to trigger a data collaboration scenario. For example, a text editing box of a preset type may be a text editing box preset by a user or a system that may be used for data collaboration, and the text editing box may be a text editing box for inputting long text. In combination with the above examples, the text editing box of the preset type may be the main interface 4020, the text editing box 4024, and so on. At this time, the second electronic device may be located on the main interface 4020 according to the display focus of the second electronic device, and may determine to trigger a data collaboration scenario to execute S403.
在本申请一些实施例中,文档编辑发现服务可以作为第二电子设备中数据协作功能的一个子功能实现,例如,在华为电脑中数据协作功能可以作为该电脑的Huawei Share功能的一个子功能实现。参见图5a,用户可以在电脑的显示屏上所显示的数据协作控制界面上进行操作,以开启第二电子设备的文档编辑发现服务。例如,在数据协作控制界面510中,可以包括Huawei Share功能的开关按钮520,文档编辑发现服务的开关按钮。从而,响应于以作用于Huawei Share功能的开关按钮的操作,以开启或关闭Huawei Share功能。或者,响应于作用于文档编辑发现服务的开关按钮的操作,以开启或关闭文档编辑发现服务。In some embodiments of the present application, the document editing discovery service may be implemented as a sub-function of the data collaboration function in the second electronic device. For example, the data collaboration function in a Huawei computer may be implemented as a sub-function of the Huawei Share function of the computer . Referring to Fig. 5a, the user may operate on the data collaboration control interface displayed on the display screen of the computer to enable the document editing discovery service of the second electronic device. For example, the data collaboration control interface 510 may include a switch button 520 for the Huawei Share function, and a switch button for the document editing discovery service. Thus, in response to the operation of the switch button acting on the Huawei Share function, the Huawei Share function is turned on or off. Or, in response to the operation of the switch button acting on the document editing discovery service, the document editing discovery service is turned on or off.
再比如,参见图5b,用户可以在电脑的显示屏上所显示的协作控制界面上进行操作,也可以是对第二电子设备的通知栏或任务栏中的提示框进行操作,上述提示框用于设置第二电子设备是否开启数据协作功能或文档编辑发现服务。在图5b中的(a)所示,为用户未进行操作时第二电子设备的提示框。在图5b中的(b)所示,为用户对Huawei Share功能的控件进行操作时显示的第二电子设备的提示框,此时,Huawei Share功能的控件包括 Huawei Share功能的开启控件和关闭控件。上述操作还可以是对第二电子设备的通知栏或任务栏中的相关图标的操作,在此不做限定。For another example, referring to Fig. 5b, the user may operate on the collaborative control interface displayed on the display screen of the computer, or may operate the prompt box in the notification bar or task bar of the second electronic device. For setting whether to enable the data collaboration function or the document editing discovery service on the second electronic device. As shown in (a) of FIG. 5b, it is a prompt box of the second electronic device when the user does not operate. As shown in (b) of Figure 5b, it is the prompt box of the second electronic device displayed when the user operates the controls of the Huawei Share function. At this time, the controls of the Huawei Share function include the on and off controls of the Huawei Share function . The above operation may also be an operation on a related icon in the notification bar or task bar of the second electronic device, which is not limited herein.
为避免文档编辑发现服务的误触发,该服务中可以配置文档编辑白名单及文稿编辑控件ID,文档编辑白名单中可以包括:触发文档编辑发现服务的应用类型,例如word\outlook\txt\notepad++\UltraEdit等,当用户输入焦点切换到处于这些白名单应用的白名单应用时,触发文档编辑发现服务向第二电子设备发送通知消息。示例性的,文档编辑白名单中的应用可以为用户设置。示例性的,如图5a所示,数据协作控制界面501中,还可以包括触发文档编辑发现服务的文档编辑白名单。In order to avoid false triggering of the document editing discovery service, the document editing whitelist and document editing control ID can be configured in this service. The document editing whitelist can include: the application type that triggers the document editing discovery service, such as word\outlook\txt\notepad++ \UltraEdit, etc., when the user's input focus is switched to a whitelisted application in these whitelisted applications, the document editing discovery service is triggered to send a notification message to the second electronic device. Exemplarily, the applications in the document editing whitelist may be set for the user. Exemplarily, as shown in FIG. 5a , the data collaboration control interface 501 may further include a document editing whitelist that triggers the document editing discovery service.
进一步的,如图5a所示,数据协作控制界面501中,还可以包括对第一电子设备列表的控件,以设置数据协作功能可使用的第一电子设备的名单,避免不可信的第一电子设备可以与第二电子设备建立数据协作的连接,以提高数据协作功能的安全性。Further, as shown in FIG. 5a, the data cooperation control interface 501 may also include a control for the list of the first electronic devices to set the list of the first electronic devices that can be used by the data cooperation function, so as to avoid untrusted first electronic devices. The device may establish a data collaboration connection with the second electronic device to improve the security of the data collaboration function.
S402、第一电子设备与第二电子设备建立通信连接。S402, the first electronic device establishes a communication connection with the second electronic device.
第一电子设备与第二电子设备建立通信连接的方式可以有多种,第一电子设备与第二电子设备可以通过蓝牙、NFC、WIFI建立通信连接。例如,第二电子设备通过NFC方式触发通信连接,以发现第一电子设备,从而接收来自第一电子设备的通信连接请求,进而,与第一电子设备建立通信连接。下面以方式a1-方式a3举例说明。The first electronic device and the second electronic device can establish a communication connection in various ways, and the first electronic device and the second electronic device can establish a communication connection through Bluetooth, NFC, or WIFI. For example, the second electronic device triggers a communication connection through NFC to discover the first electronic device, thereby receiving a communication connection request from the first electronic device, and then establishing a communication connection with the first electronic device. The mode a1-mode a3 is used as an example for illustration below.
方式a1,第一电子设备和第二电子设备可以与同一个WI-FI/热点建立无线连接,第二电子设备可以通过通信连接,查找到与第二电子设备建立通信连接的第一电子设备,其中,第二电子设备与WI-FI热点建立无线连接后,可以广播WI-FI帧,该WI-FI帧中可以携带与第二电子设备建立无线连接的WI-FI热点的标识,以便第一电子设备根据接收到的WI-FI帧获知第二电子设备与第一电子设备是否与同一个WI-FI热点建立了无线连接。Mode a1, the first electronic device and the second electronic device can establish a wireless connection with the same WI-FI/hotspot, and the second electronic device can find the first electronic device that establishes a communication connection with the second electronic device through a communication connection, Wherein, after the second electronic device establishes a wireless connection with the WI-FI hotspot, it can broadcast a WI-FI frame, and the WI-FI frame can carry the identifier of the WI-FI hotspot that establishes a wireless connection with the second electronic device, so that the first The electronic device learns, according to the received WI-FI frame, whether the second electronic device and the first electronic device have established a wireless connection with the same WI-FI hotspot.
在第二电子设备的数据协作功能的界面中可以显示第二电子设备发现的第一电子设备的标识。第一电子设备的标识可以包括第一电子设备的设备图标和/或第一电子设备作为协作服务端时的发现名。示例性的,如图5c中的(a)所示,以第一电子设备是手机,第二电子设备是笔记本电脑为例,用户打开笔记本电脑的数据协作功能。响应于用户的点击操作,笔记本电脑显示第一查找设备界面,该第一查找设备界面可以为笔记本电脑的数据协作服务的查找设备界面530,该查找设备界面530中可以包括可发现的第一电子设备的标识,具体的,如图5c所示,查找设备界面中包括手机的图标540和该手机作为协作服务端时的发现名550。这样,能够方便用户区分第二电子设备发现的协作服务端的设备的类型,如协作服务端的设备类型是平板电脑,还是手机。在本申请其他一些实施例中,第一查找设备界面中也可以不按照协作服务端的设备的类型对发现的设备进行区分。The identifier of the first electronic device discovered by the second electronic device may be displayed in the interface of the data cooperation function of the second electronic device. The identifier of the first electronic device may include a device icon of the first electronic device and/or a discovery name when the first electronic device acts as a collaboration server. Exemplarily, as shown in (a) of FIG. 5c, taking the first electronic device as a mobile phone and the second electronic device as a notebook computer as an example, the user enables the data collaboration function of the notebook computer. In response to the user's click operation, the notebook computer displays a first search device interface, which may be the search device interface 530 of the data collaboration service of the notebook computer, and the search device interface 530 may include a discoverable first electronic device. The identification of the device, specifically, as shown in FIG. 5c , the device search interface includes an icon 540 of a mobile phone and a discovery name 550 when the mobile phone is used as a collaboration server. In this way, it is convenient for the user to distinguish the type of the device of the collaboration server discovered by the second electronic device, for example, whether the device type of the collaboration server is a tablet computer or a mobile phone. In some other embodiments of the present application, the discovered devices may not be distinguished according to the types of the devices of the collaboration server in the first device search interface.
示例性的,在其他一些实施例中,用户可以对第二电子设备的通知栏或任务栏中的提示框进行操作,响应于上述操作,第二电子设备打开上述第一查找设备界面。在另外一些实施例中,用户可以对第二电子设备的通知栏或任务栏中的相关图标进行操作,响应于上述操作,第二电子设备打开上述第一查找设备界面。响应于作用于第一查找设备界面的数据协作请求的操作,第二电子设备显示登录界面,该登录界面用于提示用户输入登录认证的用户名和密码。其中,上述登录界面也可以称为验证界面,用于提示用于输入登录认证的用户名和密码。Exemplarily, in some other embodiments, the user may operate the notification bar or the prompt box in the task bar of the second electronic device, and in response to the above operation, the second electronic device opens the above-mentioned first search device interface. In some other embodiments, the user may operate a relevant icon in the notification bar or task bar of the second electronic device, and in response to the above operation, the second electronic device opens the above-mentioned first search device interface. In response to the operation of the data collaboration request acting on the first search device interface, the second electronic device displays a login interface for prompting the user to input a user name and password for login authentication. The above login interface may also be referred to as an authentication interface, which is used to prompt for input of a user name and password for login authentication.
在第一电子设备侧不允许免密访问的情况下,用户在图5c所示的第一查找设备界面中,对第一电子设备的标识进行操作后,响应于上述操作,第二电子设备显示登录界面,供用 户输入登录认证的用户名和密码。第二电子设备将用户输入的用户名和密码携带在通信连接请求信息中发送至第一电子设备。In the case where password-free access is not allowed on the side of the first electronic device, after the user operates the identifier of the first electronic device in the first device search interface shown in FIG. 5c, in response to the above operation, the second electronic device displays The login interface is for the user to enter the user name and password for login authentication. The second electronic device carries the user name and password input by the user in the communication connection request information and sends it to the first electronic device.
其中,在第二电子设备接收到用户的确认输入后,第二电子设备可以将用户输入的用户名和密码携带在通信连接请求信息中经上述无线接入点发送至第一电子设备。Wherein, after the second electronic device receives the user's confirmation input, the second electronic device can carry the user name and password input by the user in the communication connection request information and send it to the first electronic device via the wireless access point.
示例性的,结合图5c中的(a),用户在图5c中的(a)所示第一查找设备界面530中,点击第一电子设备的标识后,响应于作用于第一电子设备的标识的点击操作,如图5c中的(b)所示,笔记本电脑显示登录界面560,该登录界面560可以包括供用户输入登录认证的用户名和密码的弹窗。在笔记本电脑显示弹窗后,用户可以在上述弹窗中输入用户名和密码,并在输入完成后点击连接按钮。响应于作用于连接按钮的点击操作,笔记本电脑将用户输入的用户名和密码携带在通信连接请求信息中经无线接入点发送至手机。Exemplarily, in conjunction with (a) in FIG. 5c, after the user clicks on the identifier of the first electronic device in the first search device interface 530 shown in (a) in FIG. For the click operation of the logo, as shown in (b) of FIG. 5 c , the laptop computer displays a login interface 560 , which may include a pop-up window for the user to input the user name and password for login authentication. After the laptop displays the pop-up window, the user can enter the user name and password in the above-mentioned pop-up window, and click the connect button after the input is completed. In response to the click operation acting on the connection button, the notebook computer carries the user name and password input by the user in the communication connection request information and sends it to the mobile phone via the wireless access point.
第一电子设备从第一端口接收到第二电子设备的通信连接请求,对通信连接请求中携带的用户名和密码进行合法性验证。第一端口为局域网协作访问协议的服务端口。The first electronic device receives the communication connection request of the second electronic device from the first port, and verifies the validity of the user name and password carried in the communication connection request. The first port is the service port of the LAN cooperation access protocol.
其中,在第一电子设备打开数据协作功能后,可以对第一端口进行监听,以及时获知是否有其他电子设备需要与本机建立通信连接。在第一电子设备从第一端口接收到第二电子设备经无线接入点转发的通信连接请求信息后,第一电子设备可以基于该通信连接请求信息对第二电子设备的合法性进行验证,即第一电子设备可以对接收到的通信连接请求信息中携带的用户输入的用户名和密码进行验证。示例性的,上述合法性验证操作可以是应用程序层执行的,也可以是硬件抽象层执行的。Wherein, after the first electronic device enables the data cooperation function, it can monitor the first port to know in time whether there are other electronic devices that need to establish a communication connection with the device. After the first electronic device receives the communication connection request information forwarded by the second electronic device via the wireless access point from the first port, the first electronic device can verify the legitimacy of the second electronic device based on the communication connection request information, That is, the first electronic device can verify the user name and password input by the user carried in the received communication connection request information. Exemplarily, the above-mentioned validity verification operation may be performed by the application layer, or may be performed by the hardware abstraction layer.
在本申请其他一些实施例中,在第一电子设备对第二电子设备的合法性验证通过后,第一电子设备还可以显示通知消息,以通知用户有设备与第一电子设备已成功建立连接,其可以建立与第一电子设备中的协作数据的传输场景。示例性的,以硬件抽象层执行合法性验证为例。在硬件抽象层对第二电子设备的合法性验证通过之后,硬件抽象层可以向应用程序框架层发送已有电子设备与本机成功建立连接,其可与本机建立数据协作的通知消息。应用程序框架层接收到通知消息后,将该通知消息转发给应用程序层。应用程序层接收到通知消息后,可在手机触摸屏所显示的通知栏或状态栏上显示用于指示已有电子设备与本机成功建立连接,其可与本机建立数据协作的通知消息。例如,手机可以在手机触摸屏所显示的通知栏中,显示通知消息,以向用户提示已有电子设备与本机成功建立连接,其可与本机建立数据协作场景。In some other embodiments of the present application, after the legality verification of the second electronic device by the first electronic device is passed, the first electronic device may also display a notification message to notify the user that a device has successfully established a connection with the first electronic device , which can establish a transmission scenario with the cooperation data in the first electronic device. Illustratively, take the hardware abstraction layer performing legality verification as an example. After the hardware abstraction layer passes the legality verification of the second electronic device, the hardware abstraction layer can send a notification message to the application framework layer that the existing electronic device has successfully established a connection with the local machine, and that it can establish data cooperation with the local machine. After the application framework layer receives the notification message, it forwards the notification message to the application layer. After receiving the notification message, the application layer can display the notification message on the notification bar or the status bar displayed on the touch screen of the mobile phone to indicate that an existing electronic device has successfully established a connection with the machine and can establish data cooperation with the machine. For example, the mobile phone may display a notification message in the notification bar displayed on the touch screen of the mobile phone to prompt the user that an existing electronic device has successfully established a connection with the local machine, and it can establish a data collaboration scenario with the local machine.
在本申请其他一些实施例中,在第一电子设备侧允许免密访问的情况下,用户在图5c所示的第一查询设备界面中,对第一电子设备的标识进行操作后,响应于作用于第一电子设备的标识的操作,第二电子设备可以向第一电子设备发送数据协作请求信息,以请求对第一电子设备的数据协作功能的启用。In some other embodiments of the present application, when the first electronic device side allows password-free access, after the user operates the identifier of the first electronic device in the first query device interface shown in FIG. 5c, the user responds to Acting on the operation of the identification of the first electronic device, the second electronic device may send data cooperation request information to the first electronic device to request enabling of the data cooperation function of the first electronic device.
方式a2,第二电子设备可以查找到与第二电子设备建立通信连接的第一电子设备。In manner a2, the second electronic device may find the first electronic device that establishes a communication connection with the second electronic device.
其中,第一电子设备与第二电子设备建立通信连接的方式可以为上述提及的各种方式,第一种可能的实现方式,第二电子设备通过局域网发现第一电子设备;例如,可以是第一电子设备与第二电子设备位于相同的局域网,从而,第二电子设备搜索第二电子设备所在的局域网内的所有第一电子设备。还可以是,第二电子设备通过NFC方式发现第一电子设备。此时,第一电子设备与第二电子设备并不限定于都接入局域网中,也可以发现第一电子设备。例如,第一电子设备未联网,第二电子设备通过数据流量接入移动网络,此时,第二电子设备可以通过NFC的方式,查找到第一电子设备。The manner in which the first electronic device establishes a communication connection with the second electronic device may be the various manners mentioned above. In the first possible implementation manner, the second electronic device discovers the first electronic device through a local area network; for example, it may be The first electronic device and the second electronic device are located in the same local area network, so that the second electronic device searches for all the first electronic devices in the local area network where the second electronic device is located. It is also possible that the second electronic device discovers the first electronic device by means of NFC. At this time, the first electronic device and the second electronic device are not limited to be connected to the local area network, and the first electronic device can also be discovered. For example, the first electronic device is not connected to the Internet, and the second electronic device accesses the mobile network through data traffic. At this time, the second electronic device can find the first electronic device by means of NFC.
示例性的,可以通过第一电子设备触发通信连接请求,即第一电子设备向第二电子设备发送通信连接请求。例如,用户可以通过第一电子设备的扫描功能,对第二电子设备的二维码等标识进行扫描,从而第一电子设备根据获取的第二电子设备的标识,向第二电子设备发送通信连接请求;或者,用户可以通过第一电子设备的NFC功能,获取的第二电子设备的NFC的标识,以向第二电子设备发送通信连接请求。第二电子设备可以响应于作用于查找到的第一电子设备的通信连接请求的操作,向该第一电子设备发送通信连接响应。第一电子设备根据发送通信连接响应,确认与第一电子设备建立通信连接。Exemplarily, the communication connection request may be triggered by the first electronic device, that is, the first electronic device sends a communication connection request to the second electronic device. For example, the user can scan an identifier such as a QR code of the second electronic device through the scanning function of the first electronic device, so that the first electronic device sends a communication connection to the second electronic device according to the acquired identifier of the second electronic device Alternatively, the user may obtain the NFC identifier of the second electronic device through the NFC function of the first electronic device, so as to send a communication connection request to the second electronic device. The second electronic device may send a communication connection response to the first electronic device in response to the operation acting on the found communication connection request of the first electronic device. The first electronic device confirms to establish a communication connection with the first electronic device according to the sending of the communication connection response.
再比如,也可以通过第二电子设备触发通信连接请求。例如,用户可以通过第二电子设备的蓝牙功能,获取的第一电子设备的蓝牙的标识,以向第一电子设备发送通信连接请求。第一电子设备接收到通信连接请求后,向该第二电子设备发送通信连接响应。第二电子设备根据发送通信连接响应,确认与第一电子设备建立通信连接。另外,第一电子设备在向第二电子设备发送通信连接响应之前,还可以在第一电子设备上显示连接请求界面,响应于作用于通信连接请求界面的操作,确认与第二电子设备建立通信连接。For another example, the communication connection request may also be triggered by the second electronic device. For example, the user may obtain the Bluetooth identifier of the first electronic device through the Bluetooth function of the second electronic device, so as to send a communication connection request to the first electronic device. After receiving the communication connection request, the first electronic device sends a communication connection response to the second electronic device. The second electronic device confirms to establish a communication connection with the first electronic device according to the sending of the communication connection response. In addition, before sending a communication connection response to the second electronic device, the first electronic device may also display a connection request interface on the first electronic device, and in response to an operation acting on the communication connection request interface, confirm to establish communication with the second electronic device connect.
在方式a2中发送通信连接请求以在第一电子设备上进行验证的过程可以参考方式a1,在此不再赘述。For the process of sending a communication connection request to perform verification on the first electronic device in the manner a2, reference may be made to the manner a1, which will not be repeated here.
方式a3,第一电子设备和第二电子设备可以分别与WI-FI热点建立连接,且第一电子设备与第二电子设备互相信任的情况下,确定可以与第二电子设备建立通信连接的第一电子设备。Mode a3, the first electronic device and the second electronic device can respectively establish a connection with the WI-FI hotspot, and when the first electronic device and the second electronic device trust each other, determine the first electronic device that can establish a communication connection with the second electronic device. an electronic device.
一种可能的实现方式,第二电子设备与第一电子设备默认建立通信连接,避免对用户的打扰。In a possible implementation manner, the second electronic device establishes a communication connection with the first electronic device by default to avoid disturbing the user.
其中,互相信任的场景可以有多种,下面以方式b1和方式b2举例说明。Among them, there may be multiple scenarios of mutual trust, and the following takes the mode b1 and the mode b2 as an example to illustrate.
方式b1,第一电子设备与第二电子设备登录同一账号。上述账号可以为运营商为用户提供的账号,如荣耀账号、华为账号等,还可以为应用账号,如社交应用账号、视频应用账号等。WI-FI帧中还可以携带有上述账号,以便第一电子设备根据WI-FI帧获知第二电子设备与第一电子设备是否登录了同一个账号。Mode b1, the first electronic device and the second electronic device log into the same account. The above account may be an account provided by the operator for the user, such as a glory account, a Huawei account, etc., or may be an application account, such as a social application account, a video application account, and the like. The above account number may also be carried in the WI-FI frame, so that the first electronic device can know whether the second electronic device and the first electronic device have logged into the same account according to the WI-FI frame.
示例性的,第一电子设备在与第二电子设备与同一个WI-FI热点建立连接时,获取第二电子设备的第二用户标识,如第二电子设备登录的华为账号,并确定第二电子设备的第二用户标识与第一电子设备存储的第一用户标识,如第一电子设备登录的华为账号是否相同。若第一电子设备确定第二用户标识与第一用户标识相同,表明第一电子设备与第二电子设备是相互信任的,此时,第一电子设备可以自动与第二电子设备建立通信连接。Exemplarily, when the first electronic device establishes a connection with the second electronic device and the same WI-FI hotspot, obtains the second user identifier of the second electronic device, such as the Huawei account logged in by the second electronic device, and determines the second user ID of the second electronic device. Whether the second user identifier of the electronic device is the same as the first user identifier stored in the first electronic device, such as the Huawei account logged in by the first electronic device. If the first electronic device determines that the second user ID is the same as the first user ID, it indicates that the first electronic device and the second electronic device trust each other, and at this time, the first electronic device can automatically establish a communication connection with the second electronic device.
方式b2,互相信任的场景可以是在历史建立过通信连接的第一电子设备和第二电子设备。In manner b2, the mutual trust scenario may be the first electronic device and the second electronic device that have established a communication connection in history.
举例来说,在第二电子设备中,可以存储有历史建立过通信连接的第一电子设备,第二电子设备可以将上述第一电子设备作为可信任的第一电子设备,此时,第二电子设备的界面上可以显示可信任的第一电子设备的标识列表,响应于作用于可信任的第一电子设备的标识列表中的选中操作,确定当前与第二电子设备建立通信连接的第一电子设备,从而向第一电子设备发送通信连接的请求,接收第一电子设备返回的通信连接的响应,以完成第一电子设备与第二电子设备通信连接的建立。For example, in the second electronic device, the first electronic device that has historically established a communication connection may be stored, and the second electronic device may regard the above-mentioned first electronic device as a trusted first electronic device, at this time, the second electronic device An identification list of the trusted first electronic device may be displayed on the interface of the electronic device, and in response to a selection operation acting on the identification list of the trusted first electronic device, the first electronic device that currently establishes a communication connection with the second electronic device is determined. The electronic device sends a communication connection request to the first electronic device, and receives a communication connection response returned by the first electronic device, so as to complete the establishment of the communication connection between the first electronic device and the second electronic device.
可选的,在第二电子设备的显示屏上也可以显示通知消息,例如,在第二电子设备上显示第一连接消息;所述第一连接消息用于提示用户所述第二电子设备与所述第一电子设 备建立通信连接。同样的,在第一电子设备的触摸屏上也可以显示通知消息,用于通知用户第二电子设备与第一电子设备建立了通信连接。例如,在第一电子设备上显示第一连接消息;第一连接消息用于提示用户第二电子设备与第一电子设备建立通信连接。Optionally, a notification message may also be displayed on the display screen of the second electronic device, for example, a first connection message is displayed on the second electronic device; the first connection message is used to prompt the user that the second electronic device is connected to the second electronic device. The first electronic device establishes a communication connection. Similarly, a notification message may also be displayed on the touch screen of the first electronic device for notifying the user that the second electronic device has established a communication connection with the first electronic device. For example, a first connection message is displayed on the first electronic device; the first connection message is used to prompt the user to establish a communication connection between the second electronic device and the first electronic device.
在方式a3中发送通信连接请求以在第一电子设备上进行验证的过程可以参考方式a1,在此不再赘述。For the process of sending a communication connection request to perform verification on the first electronic device in the manner a3, reference may be made to the manner a1, which will not be repeated here.
可选的,在第二电子设备的显示屏上也可以显示第一响应消息,第一响应消息用于确认所述第一电子设备与所述第二电子设备开启数据协作。即该第一响应消息用于通知用户第一电子设备打开了数据协作功能,且第一电子设备与第二电子设备建立通信连接。如图5d所示,在第二电子设备的通知栏上也可以显示数据协作控制界面,该数据协作控制界面包括提示信息,该提示信息可以为:“使用HUWEI p40与本机进行数据协作”。数据控制界面510还可以包括建立连接的第一电子设备(例如,第一电子设备的发现名为HUAWEI p40)的提示信息,该提示信息可以为:“已连接HUAWEI p40”。从而,通知用户第一电子设备打开了数据协作功能,且第一电子设备与第二电子设备建立通信连接。同样的,在第一电子设备的触摸屏上也可以显示通知消息,用于通知用户第一电子设备打开了数据协作功能,第二电子设备与第一电子设备建立了通信连接。例如,如图6b中的(a)所示,在第一电子设备的通知栏上,显示数据协作控制界面710,数据协作控制界面710上包括数据协作服务的提示信息,该提示信息可以为:“使用手机与HUWEI MATEBOOK数据协作”。数据控制界面710还可以包括建立连接的第二电子设备(例如,第二电子设备的发现名为HUWEI MATEBOOK)的提示信息,该提示信息可以为:“已连接HUAWEI MATEBOOK”。Optionally, a first response message may also be displayed on the display screen of the second electronic device, where the first response message is used to confirm that the first electronic device and the second electronic device enable data cooperation. That is, the first response message is used to notify the user that the first electronic device has turned on the data cooperation function, and the first electronic device has established a communication connection with the second electronic device. As shown in Figure 5d, a data collaboration control interface can also be displayed on the notification bar of the second electronic device, and the data collaboration control interface includes prompt information, and the prompt information can be: "Use HUWEI p40 to perform data collaboration with this machine". The data control interface 510 may also include prompt information of the first electronic device for which the connection is established (for example, the discovery name of the first electronic device is HUAWEI p40), and the prompt information may be: "Connected to HUAWEI p40". Thus, the user is notified that the first electronic device has turned on the data cooperation function, and the first electronic device establishes a communication connection with the second electronic device. Similarly, a notification message may also be displayed on the touch screen of the first electronic device to notify the user that the first electronic device has turned on the data cooperation function and that the second electronic device has established a communication connection with the first electronic device. For example, as shown in (a) of FIG. 6b, on the notification bar of the first electronic device, a data collaboration control interface 710 is displayed, and the data collaboration control interface 710 includes prompt information of the data collaboration service, and the prompt information may be: "Working with HUWEI MATEBOOK Data Using Your Mobile Phone". The data control interface 710 may also include prompt information of the second electronic device that establishes the connection (for example, the discovery name of the second electronic device is HUWEI MATEBOOK), and the prompt information may be: "HUAWEI MATEBOOK is connected".
在第一电子设备与第二电子设备建立通信连接的场景下,第二电子设备便可以发现第一电子设备,以为后续用户能够在第二电子设备上接收到第一电子设备发送的协作数据做好准备。In the scenario where the first electronic device establishes a communication connection with the second electronic device, the second electronic device can discover the first electronic device, so that subsequent users can receive the collaboration data sent by the first electronic device on the second electronic device. ready.
进一步的,在第一电子设备与第二电子设备建立通信连接的过程中,为避免用户对数据协作功能的频繁操作,一种可能的实现方式,第二电子设备可以预先设置开启数据协作功能的触发条件,例如,在第一电子设备与第二电子设备建立通信连接,且第二电子设备开启了文档编辑的应用时,第二电子设备自动开启数据协作功能。Further, in the process of establishing a communication connection between the first electronic device and the second electronic device, in order to avoid the frequent operation of the data cooperation function by the user, a possible implementation manner, the second electronic device may preset the data cooperation function to be enabled. The trigger condition, for example, when the first electronic device establishes a communication connection with the second electronic device, and the second electronic device starts the application of document editing, the second electronic device automatically enables the data collaboration function.
相应的,第一电子设备也可以预先设置开启数据协作功能的触发条件,例如,在第一电子设备与第二电子设备建立通信连接后,第一电子设备自动开启数据协作功能。在开启数据协作后,向第二电子设备发送第一响应消息,第一响应消息用于第二电子设备确认所述第一电子设备与所述第二电子设备开启数据协作。可选的,第二电子设备还可以在显示屏上显示第一响应消息,该第一响应消息可以在通知栏显示(例如,如图5d中显示“已连接HUAWEI p40”),也可以通过弹窗的方式显示,具体显示方式可以参考第一通知消息的显示方式,在此不再赘述。Correspondingly, the first electronic device may also preset a trigger condition for enabling the data cooperation function. For example, after the first electronic device establishes a communication connection with the second electronic device, the first electronic device automatically enables the data cooperation function. After data collaboration is enabled, a first response message is sent to the second electronic device, where the first response message is used by the second electronic device to confirm that the first electronic device and the second electronic device enable data collaboration. Optionally, the second electronic device can also display the first response message on the display screen, and the first response message can be displayed in the notification bar (for example, as shown in Figure 5d, "HUAWEI p40 is connected"), or it can be displayed by popping the button. The window is displayed, and the specific display method can refer to the display method of the first notification message, which will not be repeated here.
另一种可能的实现方式,考虑到该通信连接是用于实现数据协作功能的,因此,用户可以在第二电子设备中的数据协作控制界面设置:查找的第一电子设备为开启了数据协作功能的电子设备。从而,使得第二电子设备仅与开启了数据协作功能的第一电子设备建立通信连接,以提高通信连接的安全性。示例性的,在第二电子设备确定第一电子设备开启数据协作功能时,与第一电子设备建立通信连接。Another possible implementation manner, considering that the communication connection is used to realize the data collaboration function, therefore, the user can set on the data collaboration control interface in the second electronic device: the first electronic device to be searched for has enabled data collaboration functional electronic equipment. Therefore, the second electronic device only establishes a communication connection with the first electronic device with the data cooperation function turned on, so as to improve the security of the communication connection. Exemplarily, when the second electronic device determines that the first electronic device enables the data cooperation function, a communication connection is established with the first electronic device.
相应的,第一电子设备可以预先设置开启数据协作功能。Correspondingly, the first electronic device may be preset to enable the data cooperation function.
下面举例说明开启数据协作功能的方式A1-A5。The following examples illustrate ways A1-A5 for enabling the data collaboration function.
方式A1,第二电子设备可以响应于作用于查找到的第一电子设备的数据协作请求操作,向该第一电子设备发送数据协作请求。第一电子设备响应于作用于数据协作请求的确认操作,显示数据协作控制界面。响应于作用于数据协作控制界面的操作,确认开启数据协作功能。Manner A1, the second electronic device may send a data cooperation request to the first electronic device in response to a data cooperation request operation acting on the found first electronic device. The first electronic device displays a data collaboration control interface in response to the confirmation operation acting on the data collaboration request. In response to the operation acting on the data cooperation control interface, it is confirmed that the data cooperation function is turned on.
本申请实施例中,第一电子设备的数据协作功能可以作为第一电子设备中文稿编辑服务功能的一个子功能实现,例如,在华为手机中数据协作功能可以作为该手机的Huawei Share功能的一个子功能实现,此时,参见图6a,用户在手机触摸屏上所显示的协作控制界面上进行操作,以对第一电子设备的数据协作功能进行设置。例如,在数据协作控制界面610中,包括Huawei Share功能的开关按钮620,数据协作服务的开关按钮630,还可以包括第二电子设备触发数据协作功能的文档编辑白名单,及可信的第二电子设备对应的第二电子设备列表。In this embodiment of the present application, the data collaboration function of the first electronic device may be implemented as a sub-function of the document editing service function in the first electronic device. For example, the data collaboration function in a Huawei mobile phone may be used as a sub-function of the Huawei Share function of the mobile phone The sub-function is realized. At this time, referring to FIG. 6a, the user operates on the cooperation control interface displayed on the touch screen of the mobile phone to set the data cooperation function of the first electronic device. For example, the data collaboration control interface 610 includes the switch button 620 of the Huawei Share function, the switch button 630 of the data collaboration service, and may also include a document editing whitelist for triggering the data collaboration function by the second electronic device, and a trusted second The second electronic device list corresponding to the electronic device.
其中,Huawei Share功能的开关按钮620的主要功能是开启/关闭Huawei Share功能。用户可以对Huawei Share功能的开关按钮620进行操作,手机接收到用户对Huawei Share功能的开关按钮620的操作后,可以调用相关的系统服务接口以开启/关闭Huawei Share功能,并可以响应于用户的操作,切换Huawei Share功能的开关按钮602的状态(如,由关闭状态切换为开启状态)。上述数据协作控制界面610中还可以包括Huawei Share功能的实时状态标识(图6a中未示出)。同理,数据协作服务的开关按钮630的主要功能是开启/关闭数据协作服务。用户可以对数据协作服务的开关按钮630进行操作,手机接收到作用于数据协作服务的开关按钮630的操作后,可以调用相关的系统服务接口以开启/关闭数据协作服务,并可以响应于用户的操作,切换数据协作服务的开关按钮630的状态(如,由关闭状态切换为开启状态)。上述数据协作控制界面610中还可以包括数据协作服务的实时状态标识(图6a中未示出)。Among them, the main function of the switch button 620 of the Huawei Share function is to turn on/off the Huawei Share function. The user can operate the switch button 620 of the Huawei Share function. After receiving the user's operation of the switch button 620 of the Huawei Share function, the mobile phone can call the relevant system service interface to enable/disable the Huawei Share function, and can respond to the user's operation. Operation, switch the state of the switch button 602 of the Huawei Share function (eg, switch from an off state to an on state). The above-mentioned data collaboration control interface 610 may also include a real-time status identifier of the Huawei Share function (not shown in FIG. 6a ). Similarly, the main function of the switch button 630 of the data collaboration service is to enable/disable the data collaboration service. The user can operate the switch button 630 of the data cooperation service. After receiving the operation of the switch button 630 acting on the data cooperation service, the mobile phone can call the relevant system service interface to turn on/off the data cooperation service, and can respond to the user's request. Operation, switch the state of the switch button 630 of the data cooperation service (eg, switch from the off state to the on state). The above-mentioned data cooperation control interface 610 may further include a real-time status identifier of the data cooperation service (not shown in FIG. 6a ).
一种可能的实施例中,如图6b中的(a)所示,用户在手机触摸屏上所显示的通知栏中的第一提示框710上对数据协作功能的协作控件720(输入)进行操作,用于开启第一电子设备的数据协作功能。上述通知栏可以是用户在手机触摸屏上所显示的界面,如手机的主屏幕中执行滑动操作后显示的。In a possible embodiment, as shown in (a) of FIG. 6b, the user operates the collaboration control 720 (input) of the data collaboration function on the first prompt box 710 in the notification bar displayed on the touch screen of the mobile phone. , which is used to enable the data cooperation function of the first electronic device. The above notification bar may be an interface displayed by the user on the touch screen of the mobile phone, for example, displayed after performing a sliding operation on the home screen of the mobile phone.
示例性的,结合图3和图5a,当用户想要实现第一电子设备与第二电子设备协同创作文本时,用户可以在第一电子设备的触摸屏上所显示的协作控制界面501中,对数据协作功能的协作开关按钮502进行触摸操作。此时,运行在手机中的操作系统的应用程序层可以检测到开启数据协作功能的操作。应用程序层将检测到的上述操作转换为开启数据协作功能的请求后,传递到运行在手机中的操作系统的应用程序框架层。应用程序框架层接收到请求后,调用与运行在手机中的操作系统的硬件抽象层之间通信的服务接口,以将开启数据协作功能的请求传递到硬件抽象层。硬件抽象层接收到开启数据协作功能的请求后,开启手机的数据协作功能。例如,硬件抽象层可以启动两个守护进程,以开启手机的数据协作功能。其中,第一守护进程能够提供数据协作服务、用户权限验证等功能,其可开启文档编辑发现服务,第二守护进程能够使笔记本电脑接收手机中的操作系统的Linux内核层的本地文本数据文件。Exemplarily, with reference to FIG. 3 and FIG. 5a, when the user wants to realize the collaborative creation of text between the first electronic device and the second electronic device, the user may, in the collaborative control interface 501 displayed on the touch screen of the first electronic device, The cooperation switch button 502 of the data cooperation function is touch-operated. At this time, the application layer of the operating system running in the mobile phone can detect the operation of enabling the data cooperation function. The application layer converts the detected operation into a request for enabling the data cooperation function, and then transfers it to the application framework layer of the operating system running in the mobile phone. After receiving the request, the application framework layer calls the service interface that communicates with the hardware abstraction layer of the operating system running in the mobile phone, so as to transmit the request for enabling the data cooperation function to the hardware abstraction layer. After receiving the request for enabling the data collaboration function, the hardware abstraction layer enables the data collaboration function of the mobile phone. For example, the hardware abstraction layer can start two daemons to turn on the data cooperation function of the mobile phone. The first daemon process can provide functions such as data collaboration services and user authority verification, which can enable document editing and discovery services, and the second daemon process can enable the laptop to receive local text data files of the Linux kernel layer of the operating system in the mobile phone.
在本申请另外一些实施例中,上述数据协作功能的协作开关按钮可以是物理按键,该按键可以设置在第一电子设备的一个表面上;当用户的手指按下或拨动该物理按键后(也即上述第一输入),该第一电子设备开启数据协作功能,当用户的手指再次按下或拨动该物理 按键后,该第一电子设备可以关闭数据协作功能。In some other embodiments of the present application, the cooperation switch button of the above-mentioned data cooperation function may be a physical button, and the button may be set on a surface of the first electronic device; when the user's finger presses or toggles the physical button ( That is, the above-mentioned first input), the first electronic device enables the data cooperation function, and when the user's finger presses or toggles the physical button again, the first electronic device can disable the data cooperation function.
方式A2,第二电子设备与第一电子设备默认建立通信连接,第一电子设备自动开启数据协作功能,避免对用户的打扰。Manner A2, the second electronic device establishes a communication connection with the first electronic device by default, and the first electronic device automatically enables the data cooperation function to avoid disturbing the user.
举例来说,第一电子设备可以在没有与第二电子设备建立通信连接之前,响应于用户在数据协作控制界面上设置默认开启数据协作功能,开启数据协作功能。For example, before establishing a communication connection with the second electronic device, the first electronic device may enable the data cooperation function in response to the user setting on the data cooperation control interface to enable the data cooperation function by default.
方式A3,第一电子设备也可以是在满足特定条件(例如,S404、第一电子设备接收到第二电子设备的数据协作请求、第一电子设备满足预设手势等条件)时,第一电子设备自动开启第一电子设备的数据协作功能。Manner A3, the first electronic device may also be the first electronic device when certain conditions are met (for example, S404, the first electronic device receives a data collaboration request from the second electronic device, the first electronic device satisfies a preset gesture, etc.) The device automatically enables the data cooperation function of the first electronic device.
方式A4,第一电子设备和第二电子设备可以分别与WI-FI热点建立连接,且第一电子设备与第二电子设备互相信任的情况下,确定可以与第二电子设备建立通信连接的第一电子设备,第一电子设备可以自动开启数据协作功能。Mode A4, the first electronic device and the second electronic device can respectively establish a connection with the WI-FI hotspot, and when the first electronic device and the second electronic device trust each other, determine the first electronic device that can establish a communication connection with the second electronic device. An electronic device, the first electronic device can automatically enable the data cooperation function.
举例来说,第一电子设备可以在数据协作控制界面中设置可信的第二电子设备建立通信连接后,第一电子设备开启数据协作功能。For example, after the first electronic device can set a trusted second electronic device in the data cooperation control interface to establish a communication connection, the first electronic device enables the data cooperation function.
方式A5,第二电子设备的界面上可以显示可信任的第一电子设备的标识列表,响应于作用于可信任的第一电子设备的标识列表中的选中操作,确定当前与第二电子设备建立通信连接的第一电子设备,第二电子设备向该第一电子设备发送数据协作请求。第一电子设备响应于作用于数据协作请求的确认操作,确认开启数据协作功能,并与第二电子设备建立通信连接。Mode A5, the interface of the second electronic device can display the identification list of the trusted first electronic device, and in response to the selection operation acting on the identification list of the trusted first electronic device, it is determined that the current connection with the second electronic device is established. The first electronic device connected in communication, and the second electronic device sends a data cooperation request to the first electronic device. In response to the confirmation operation acting on the data cooperation request, the first electronic device confirms that the data cooperation function is enabled, and establishes a communication connection with the second electronic device.
在本申请实施例中,在数据协作功能开启后,第一电子设备的触摸屏中还可以显示协作状态标识,该协作状态标识用于指示数据协作功能已开启。示例性的,在硬件抽象层将数据协作功能开启后,可以向应用程序框架层发送已将数据协作功能开启的通知消息。应用程序框架层接收到通知消息后,将该通知消息转发给应用程序层。应用程序层接收到通知消息后,可在手机触摸屏上显示用于指示数据协作功能已开启的协作状态标识。例如,如图6c所示,手机可以在手机触摸屏上所显示的状态栏730中,显示协作图标740,以向用户提示手机的数据协作功能已打开。第一电子设备可以以注册观察者的方式监听设置数据库中数据协作服务的实时状态,随着数据协作服务的状态的改变,可以在该控制界面601中对数据协作服务的实时状态标识作相应的更新,也可以在通知栏中更新数据协作服务的实时状态标识,在此不做限定。In this embodiment of the present application, after the data collaboration function is enabled, the touch screen of the first electronic device may further display a collaboration state identifier, where the collaboration state identifier is used to indicate that the data collaboration function has been enabled. Exemplarily, after the hardware abstraction layer enables the data collaboration function, a notification message that the data collaboration function has been enabled may be sent to the application framework layer. After the application framework layer receives the notification message, it forwards the notification message to the application layer. After receiving the notification message, the application layer can display a collaboration status indicator on the touch screen of the mobile phone for indicating that the data collaboration function has been turned on. For example, as shown in FIG. 6c, the mobile phone may display a collaboration icon 740 in the status bar 730 displayed on the touch screen of the mobile phone to prompt the user that the data collaboration function of the mobile phone has been turned on. The first electronic device can monitor the real-time status of the data collaboration service in the setting database by means of a registered observer. With the change of the status of the data collaboration service, the real-time status identifier of the data collaboration service can be correspondingly marked in the control interface 601. Update, you can also update the real-time status identifier of the data collaboration service in the notification bar, which is not limited here.
结合上述实施例,在数据协作控制界面610中,还可以包括对第二电子设备可见的开关按钮。示例性的,当数据协作服务的开关按钮630和对建立通信连接的第二电子设备可见的开关按钮同时开启的情况下,第一电子设备才可以接收到第二电子设备的数据协作请求。In combination with the above embodiments, the data cooperation control interface 610 may further include a switch button visible to the second electronic device. Exemplarily, only when the switch button 630 of the data cooperation service and the switch button visible to the second electronic device establishing the communication connection are turned on at the same time, the first electronic device can receive the data cooperation request from the second electronic device.
可选的,数据协作控制界面610中还可以包括切换可见范围的弹框(图6a中未示出),该弹框用于用户切换数据协作的可见范围。用户可以在设置界面或通知栏的通知选项中进行操作以触发在手机的触摸屏上显示上述弹框。在数据协作服务的状态发生改变时,若有显示上述弹框,则上述弹框消失。在一些实施例中,在用户选择可见范围为“所有设备”可见的情况下,在手机连接到开放的无线接入点或允许其他电子设备免密访问时,手机可以显示提示弹窗,以提醒用户开启数据协作服务有风险。另外,在用户开启数据协作服务时,手机还可以对用户的权限,如是否允许开启数据协作服务和/或是否允许获取华为账号进行验证。Optionally, the data collaboration control interface 610 may further include a pop-up box (not shown in FIG. 6a ) for switching the visible range, where the pop-up box is used for the user to switch the visible range of the data collaboration. The user can operate the setting interface or the notification option of the notification bar to trigger the display of the above-mentioned pop-up box on the touch screen of the mobile phone. When the status of the data collaboration service changes, if the above-mentioned pop-up box is displayed, the above-mentioned pop-up box disappears. In some embodiments, when the user selects the visible range to be visible to "all devices", when the mobile phone is connected to an open wireless access point or allows password-free access to other electronic devices, the mobile phone may display a prompt pop-up window to remind It is risky for users to open the data collaboration service. In addition, when the user enables the data collaboration service, the mobile phone can also verify the user's permissions, such as whether to allow the data collaboration service to be enabled and/or whether to obtain a Huawei account.
在本申请其他一些实施例中,用户还可以在协作控制界面中对第一电子设备作为协作服务端时的发现名、协作客户端能够访问的协作数据的范围以及登录认证的用户名和密码等的进行设置。In some other embodiments of the present application, the user can also identify, in the collaboration control interface, the discovery name of the first electronic device as the collaboration server, the scope of collaboration data that the collaboration client can access, and the username and password for login authentication, etc. Make settings.
示例性的,结合图3和图5a-图5d所示,以用户想要对登录认证的用户名和密码进行设置为例,数据协作控制界面510中还包括电脑访问验证选项。用户可以对数据协作控制界面510中的电脑访问验证选项进行操作。此时,应用程序层可以检测到上述操作。应用程序层将上述操作转换为设置登录认证的用户名和密码的请求后,传递到应用程序框架层。应用程序框架层接收到请求后,向应用程序层提供设置登录认证的用户名和密码的功能。此时,应用程序层可根据应用程序框架层提供的功能,响应于上述操作,在手机的触摸屏上显示用户名和密码设置窗口。用户可以在该用户名和密码设置窗口中输入相应的用户名和密码,在输入完成之后,点击确定按钮。应用程序层根据作用于确定按钮的点击操作,将用户输入的用户名和密码传输到应用程序框架层。应用程序框架层接收到用户名和密码后,调用与硬件抽象层之间通信的服务接口,以将接收到的用户名和密码传递到硬件抽象层。硬件抽象层接收到用户名和密码后,将接收到的用户名和密码存储到文档编辑发现服务密码中,以实现登录认证的用户名和密码的设置。在本申请另外一些实施例中,登录认证的用户名和密码除了保存在硬件抽象层的文档编辑发现服务密码中,还可以将该用户名和密码在应用程序框架层保存一份副本,这样,在验证用户在电脑端输入的用户名和密码的合法性时,可以从应用程序层中保存的副本中查询合法的用户名和密码,减少了各层之间的交互。在本申请其他一些实施例中,用户也可以不对登录认证的用户名和密码进行设置,这样,登录认证的用户名和密码将采用默认的配置。在本申请另外一些实施例中,对于登录认证的用户名和密码的设置,若用户将默认登录认证的用户名和密码删除,并且未设置新的登录认证的用户名和密码,则第二电子设备在访问第一电子设备时,便无需输入用户名和密码,可自动访问。另外,在本申请一些实施例中,第一电子设备还可以向用户提供选择第二电子设备访问是否需要验证的界面,以决定是否开启免密访问功能。Exemplarily, as shown in FIG. 3 and FIGS. 5a-5d, taking the user wanting to set the user name and password for login authentication as an example, the data collaboration control interface 510 also includes a computer access verification option. The user can operate the computer access verification option in the data collaboration control interface 510 . At this point, the application layer can detect the above operation. After the application layer converts the above operation into a request to set the user name and password for login authentication, it is passed to the application framework layer. After the application framework layer receives the request, it provides the application layer with the function of setting the user name and password for login authentication. At this time, the application layer can display the user name and password setting window on the touch screen of the mobile phone according to the functions provided by the application framework layer in response to the above operation. The user can enter the corresponding user name and password in the user name and password setting window, and click the OK button after the input is completed. The application layer transmits the user name and password entered by the user to the application framework layer according to the click action on the OK button. After the application framework layer receives the username and password, it calls the service interface that communicates with the hardware abstraction layer to pass the received username and password to the hardware abstraction layer. After receiving the user name and password, the hardware abstraction layer stores the received user name and password in the document editing discovery service password, so as to realize the setting of the user name and password for login authentication. In other embodiments of the present application, the user name and password for login authentication are not only stored in the document editing and discovery service password of the hardware abstraction layer, but also a copy of the user name and password may be stored in the application framework layer. When users enter the validity of the username and password on the computer, they can query the valid username and password from the copy saved in the application layer, which reduces the interaction between layers. In some other embodiments of the present application, the user may also not set the user name and password for login authentication. In this way, the user name and password for login authentication will adopt the default configuration. In other embodiments of the present application, for the setting of the user name and password for login authentication, if the user deletes the default user name and password for login authentication, and does not set a new user name and password for login authentication, the second electronic device is accessing When the first electronic device is used, there is no need to enter a user name and password, and it can be accessed automatically. In addition, in some embodiments of the present application, the first electronic device may further provide the user with an interface for selecting whether the access of the second electronic device requires authentication, so as to decide whether to enable the password-free access function.
示例性的,以用户想要对手机作为协作服务端时的发现名进行设置为例,如图5a所示,用户可以对数据协作控制界面510中的电脑端显示名称选项(第一电子设备列表)进行操作。此时,应用程序层可以检测到上述操作。应用程序层将上述操作转换为设置发现名的请求后,传递到应用程序框架层。应用程序框架层接收到请求后,向应用程序层提供设置发现名的功能。此时,应用程序层可根据应用程序框架层提供的功能,响应于上述操作,在手机的触摸屏上显示发现名的设置窗口。用户可以在该发现名的设置窗口中输入相应的名称,在输入完成之后,点击确定按钮。应用程序层根据作用于确定按钮的点击操作,将用户输入的名称传输到应用程序框架层。应用程序框架层接收到名称,调用与硬件抽象层之间通信的服务接口,以将接收到的名称传递到硬件抽象层。硬件抽象层接收到名称后,将接收到的名称存储到数据协作配置文件中,以实现发现名的设置。在一些实施例中,手机还可以在用户点击确定按钮之前,对用户输入的发现名进行合法性检测,并在检测到用户输入的发现名合法的情况下,用户才可以对确定按钮进行操作,若检测到用户输入的发现名不合法,则可以显示提示框向用户提示该发现名不合法。在本申请另外一些实施例中,发现名除了保存在硬件抽象层的数据协作配置文件中,还可以将该发现名在应用程序框架层保存一份副本,这样,在后续需要查询发现名时,可以从应用程序层中保存的副本中查询到,减少了各层之间的交互。在本申请其他一些实施例中,用户也可以不对发现名进行 设置,这样,发现名将采用默认的配置。例如,如图5c中的(a)所示,手机作为协作服务端时的发现名默认为:华为手机1。若用户未对该发现名进行修改,则笔记本电脑端搜索到的协作服务端的名称则为华为笔记本。Exemplarily, taking the user wanting to set the discovery name when the mobile phone is used as the collaboration server as an example, as shown in FIG. ) to operate. At this point, the application layer can detect the above operation. After the application layer converts the above operation into a request to set the discovery name, it is passed to the application framework layer. After the application framework layer receives the request, it provides the application layer with the function of setting the discovery name. At this time, the application layer can display the setting window of the discovery name on the touch screen of the mobile phone in response to the above operation according to the function provided by the application framework layer. The user can input the corresponding name in the setting window of the discovery name, and click the OK button after the input is completed. The application layer transmits the name entered by the user to the application framework layer based on the click action on the OK button. The application framework layer receives the name and invokes the service interface that communicates with the hardware abstraction layer to pass the received name to the hardware abstraction layer. After the hardware abstraction layer receives the name, it stores the received name in the data collaboration configuration file to realize the setting of the discovery name. In some embodiments, before the user clicks the OK button, the mobile phone can also perform legality detection on the discovery name input by the user, and the user can operate the OK button only when the discovery name input by the user is detected to be valid. If it is detected that the discovery name input by the user is invalid, a prompt box may be displayed to prompt the user that the discovery name is invalid. In other embodiments of the present application, in addition to saving the discovery name in the data collaboration configuration file of the hardware abstraction layer, a copy of the discovery name may also be saved in the application framework layer, so that when the discovery name needs to be queried subsequently, Can be queried from replicas held in the application layer, reducing interactions between layers. In some other embodiments of the present application, the user may also not set the discovery name, in this way, the discovery name will adopt the default configuration. For example, as shown in (a) of Figure 5c, the default discovery name when the mobile phone is used as the collaboration server is: Huawei mobile phone 1. If the user does not modify the discovery name, the name of the collaboration server searched by the laptop is Huawei laptop.
在本申请实施例中,在用户第一次进行数据协作功能的设置时,第一电子设备可以显示一系列的引导界面,以引导用户对该数据协作功能进行设置,第一电子设备还可以保存用户的设置偏好,以便下次可以根据用户的设置偏好对协作功能进行设置。In this embodiment of the present application, when the user sets the data collaboration function for the first time, the first electronic device may display a series of guide interfaces to guide the user to set the data collaboration function, and the first electronic device may also save The user's setting preferences, so that the collaboration function can be set according to the user's setting preferences next time.
需要说明的是,S401和S402没有先后顺序的限定,在具体实施过程中,S401和S402可以同时执行,也可以S402先执行,S401后执行,或者,也可以S401先执行,S402后执行,在此不做限定。上述开启数据协作功能的步骤可以与建立网络连接同时执行,也可以在S404之后执行,可以根据场景具体设置。在S404之后执行的具体实施方式在下面具体描述。It should be noted that S401 and S402 are not limited in order. In the specific implementation process, S401 and S402 may be executed at the same time, or S402 may be executed first, and S401 may be executed later, or, S401 may be executed first, and S402 may be executed later. This is not limited. The above step of enabling the data collaboration function may be performed simultaneously with establishing a network connection, or may be performed after S404, and may be specifically set according to the scene. The specific implementation performed after S404 is described in detail below.
S403、第二电子设备响应于作用于文档编辑应用的第一操作,第二电子设备向第一电子设备发送第一通知消息。S403. In response to the first operation acting on the document editing application, the second electronic device sends a first notification message to the first electronic device.
如图7a所示,第二电子设备可以根据第二电子设备的显示焦点位于文档编辑应用710中的文档编辑框720中,确定第二电子设备处于文档编辑场景,也可以根据第二电子设备的显示焦点位于文档编辑应用710上,确定第二电子设备处于文档编辑场景。As shown in FIG. 7a, the second electronic device may determine that the second electronic device is in the document editing scene according to the display focus of the second electronic device in the document editing box 720 in the document editing application 710, or may determine that the second electronic device is in the document editing scene according to the display focus of the second electronic device. The display focus is on the document editing application 710, and it is determined that the second electronic device is in the document editing scene.
一种可能的实现方式,第二电子设备可以在确定第二电子设备处于文档编辑场景时,即向第一电子设备发送第一通知消息。In a possible implementation manner, the second electronic device may send the first notification message to the first electronic device when it is determined that the second electronic device is in a document editing scene.
另一种可能的实现方式,第二电子设备可以在确定第二电子设备触发了数据协作场景时,向第一电子设备发送第一通知消息。其中,第二电子设备可以响应于作用于文档编辑应用的操作,确定触发数据协作场景。结合方式1和方式2,响应于用户选择文档编辑应用的文本编辑框和触发数据协作场景的操作,第二电子设备确定触发数据协作场景。还可以是响应于用户选择预设类型的文本编辑框的操作,第二电子设备确定触发数据协作场景。从而,第二电子设备可以向第一电子设备发送第一通知消息,以建立数据协作场景。In another possible implementation manner, the second electronic device may send the first notification message to the first electronic device when it is determined that the second electronic device has triggered the data collaboration scenario. Wherein, the second electronic device may determine to trigger the data collaboration scenario in response to the operation acting on the document editing application. Combining Manner 1 and Manner 2, in response to the user selecting the text editing box of the document editing application and the operation of triggering the data collaboration scenario, the second electronic device determines to trigger the data collaboration scenario. It may also be that the second electronic device determines to trigger the data collaboration scenario in response to the user's operation of selecting a text editing box of a preset type. Thus, the second electronic device can send the first notification message to the first electronic device to establish a data collaboration scenario.
第二电子设备发送的第一通知消息还可以包括第二电子设备所在焦点的文档编辑软件的标识,以通知用户是否需要通过第一电子设备在第二电子设备所在焦点的文档编辑软件中进行文本的协同输入。The first notification message sent by the second electronic device may further include the identification of the document editing software that is the focus of the second electronic device, so as to notify the user whether the user needs to use the first electronic device to edit text in the document editing software that is the focus of the second electronic device. collaborative input.
在一些可能的实施方案中,文档编辑应用可能只包括一个窗口(界面)。在另一些可能的实施方案中,文档编辑应用可能包括多个窗口(界面),如在应用窗口多开,悬浮窗等情况下。考虑到第二电子设备上可能出现多应用界面同时显示的场景,第二电子设备上包括多个编辑界面。如图7b所示,第二电子设备当前开启的应用包括文档编辑应用和应用1,其中,文档编辑应用开启了2个界面,包括文档1的界面710和文档2的界面712。界面710中包括有文档编辑的编辑框720,界面712中包括有文档编辑的编辑框722。应用1开启了1个界面711。应用1中包括有可进行文档编辑的编辑框721。第二电子设备可以在用户的焦点切换至文档编辑应用(如图7b所示的文档1的界面)时,确定第二电子设备处于文档编辑场景。也可以是在用户开启文档编辑应用(如图7b所示的文档1的界面或文档2的界面)时,即确定第二电子设备处于文档编辑场景。从而,第二电子设备可以向所述第一电子设备发送所述多个文档编辑应用的通知消息;该通知消息可以用于通知所述第二电子设备多个文档编辑应用的多个文档编辑框;从而,第一电子设备在接收到该通知消息后,在所述数据协作界面上显示所述多个文档编辑框的多个编辑预览界面(例如, 如图8a中的(b)所示的第三控件中的编辑预览界面,或者,如图8a中的(c)所示的第四控件对应显示的编辑预览界面);响应于作用于所述多个编辑预览界面的切换操作,向所述第二电子设备发送切换消息;所述切换操作用于指示切换后的第二文档编辑框;第二电子设备接收所述第一电子设备发送的切换消息后,将所述第二电子设备的焦点切换至第二文档编辑框。从而,第二电子设备可以接收所述第一电子设备发送的第三文本数据,在第二文档编辑框上显示第三文本数据。In some possible implementations, the document editing application may include only one window (interface). In other possible implementations, the document editing application may include multiple windows (interfaces), for example, in the case of multiple application windows, floating windows, and the like. Considering that a scenario where multiple application interfaces are displayed simultaneously may occur on the second electronic device, the second electronic device includes multiple editing interfaces. As shown in FIG. 7b, the applications currently opened by the second electronic device include a document editing application and an application 1, wherein the document editing application opens two interfaces, including an interface 710 of document 1 and an interface 712 of document 2. The interface 710 includes an edit box 720 for document editing, and the interface 712 includes an edit box 722 for document editing. Application 1 opens an interface 711 . Application 1 includes an edit box 721 for document editing. The second electronic device may determine that the second electronic device is in a document editing scene when the user's focus is switched to a document editing application (the interface of the document 1 shown in FIG. 7b ). It may also be determined that the second electronic device is in the document editing scene when the user starts the document editing application (as shown in FIG. 7b on the interface of document 1 or the interface of document 2). Thus, the second electronic device may send notification messages of the plurality of document editing applications to the first electronic device; the notification messages may be used to notify the second electronic device of multiple document editing boxes of the plurality of document editing applications ; Thereby, after receiving the notification message, the first electronic device displays multiple editing preview interfaces of the multiple document editing boxes on the data collaboration interface (for example, as shown in (b) in FIG. 8 a ) The editing preview interface in the third control, or, as shown in (c) in FIG. 8a, the editing preview interface displayed corresponding to the fourth control); in response to the switching operation acting on the plurality of editing preview interfaces, the the second electronic device sends a switching message; the switching operation is used to indicate the switched second document edit box; after the second electronic device receives the switching message sent by the first electronic device, The focus switches to the second document edit box. Therefore, the second electronic device can receive the third text data sent by the first electronic device, and display the third text data on the second document editing box.
S404、第一电子设备的数据协作服务接收到第一通知消息,并在第一电子设备上显示第一提示框。S404. The data cooperation service of the first electronic device receives the first notification message, and displays the first prompt box on the first electronic device.
其中,第一提示框可以在通知栏中显示,例如,如图6b中的(a)所示,在通知栏中显示第一提示框710。或者,还可以在第一电子设备的主界面显示第一提示框,例如,图6b中的(b)所示,在第一电子设备的主界面中显示第一提示框730。第一提示框可以包括第一提示信息,以显示第一通知消息。如图6b中的(a)和(b)所示,以第二电子设备的标识为HUWEI MATEBOOK为例。提示信息可以为:“使用手机与HUWEI MATEBOOK进行数据协作”。The first prompt box may be displayed in the notification bar, for example, as shown in (a) of FIG. 6b, the first prompt box 710 is displayed in the notification bar. Alternatively, the first prompt box may also be displayed on the main interface of the first electronic device. For example, as shown in (b) of FIG. 6b, the first prompt box 730 is displayed on the main interface of the first electronic device. The first prompt box may include first prompt information to display the first notification message. As shown in (a) and (b) of FIG. 6b, take the identifier of the second electronic device as HUWEI MATEBOOK as an example. The prompt information can be: "Use your mobile phone for data collaboration with HUWEI MATEBOOK".
一种可能的实现方式,响应于作用于第一提示框的操作,例如,滑动操作,选中操作等,在第一提示框上显示第一控件。In a possible implementation manner, in response to an operation acting on the first prompt box, such as a sliding operation, a selection operation, etc., the first control is displayed on the first prompt box.
如图6b中的(a)所示,第一提示框710中包括的第一控件711可以为确认控件,用于提示用户点击该第一控件,以进入数据协作显示界面。第一提示框710中还可以包括忽略控件712,用于用户关闭第一提示框710。如图6b中的(b)所示,第一提示框730中包括的第一控件731可以为确认控件,用于提示用户点击该第一控件,以进入数据协作显示界面。第一提示框730中还可以包括忽略控件732,用于用户关闭第一提示框730。As shown in (a) of FIG. 6b, the first control 711 included in the first prompt box 710 may be a confirmation control for prompting the user to click the first control to enter the data collaboration display interface. The first prompt box 710 may further include an ignore control 712 for the user to close the first prompt box 710 . As shown in (b) of FIG. 6b, the first control 731 included in the first prompt box 730 may be a confirmation control for prompting the user to click the first control to enter the data collaboration display interface. The first prompt box 730 may further include an ignore control 732 for the user to close the first prompt box 730 .
进一步的,第一控件也可以为数据协作功能的协作开关。该开关可以用于开启或关闭数据协作功能。例如,如图6a所示,第一提示框可以是第一电子设备弹出的协作控制界面,数据协作功能的协作开关按钮可以包含在协作控制界面中,例如,在一些实施例中,第一操作可以是用户在手机触摸屏上所显示的数据协作控制界面610中,对数据协作功能的协作开关按钮630的操作。响应于作用于数据协作功能的协作开关按钮630的操作,数据协作功能的协作开关按钮630的状态会发生变化,如由关闭状态转换为开启状态。当数据协作功能的协作开关按钮为开启状态时,第一电子设备确认进入数据协作场景。Further, the first control may also be a cooperation switch of the data cooperation function. This switch can be used to enable or disable the data collaboration function. For example, as shown in FIG. 6a, the first prompt box may be a collaboration control interface popped up by the first electronic device, and the collaboration switch button of the data collaboration function may be included in the collaboration control interface. For example, in some embodiments, the first operation It may be the user's operation on the collaboration switch button 630 of the data collaboration function in the data collaboration control interface 610 displayed on the touch screen of the mobile phone. In response to the operation of the cooperation switch button 630 acting on the data cooperation function, the state of the cooperation switch button 630 of the data cooperation function will change, for example, from an off state to an on state. When the collaboration switch button of the data collaboration function is in an on state, the first electronic device confirms to enter the data collaboration scene.
当用户对第一控件进行开启数据协作功能的操作时,第一电子设备显示数据协作界面。当用户对第一控件进行关闭数据协作功能的操作时,第一电子设备显示数据协作功能关闭的通知消息,该通知消息的显示方式可以参考第一提示框的显示方式,在此不再赘述。用户对第一电子设备的数据协作功能的协作开关的操作,可以包括:点击、滑动、双击、多手势操作或语音控制等操作,在此不做限定。When the user performs an operation to enable the data collaboration function on the first control, the first electronic device displays a data collaboration interface. When the user operates the first control to turn off the data cooperation function, the first electronic device displays a notification message that the data cooperation function is turned off. The display mode of the notification message can refer to the display mode of the first prompt box, which is not repeated here. The user's operation on the cooperation switch of the data cooperation function of the first electronic device may include operations such as clicking, sliding, double-clicking, multi-gesture operation, or voice control, which is not limited herein.
S405、响应于作用于第一控件的第一用户操作,弹出数据协作界面。S405. In response to the first user operation acting on the first control, pop up a data collaboration interface.
其中,第一用户操作可以是确认操作,此时,响应于作用于第一控件的确认操作,第一电子设备可以确认数据协作功能开启,可选的,第一电子设备还可以执行S405a、向第二电子设备发送第一响应消息,第一响应消息用于确认第一电子设备和第二电子设备的数据协作功能开启。从而,第二电子设备接收到该第一响应消息后,数据协作服务可以在通知栏显示,确认第一电子设备与第二电子设备建立数据协作。The first user operation may be a confirmation operation. At this time, in response to the confirmation operation acting on the first control, the first electronic device may confirm that the data collaboration function is enabled. The second electronic device sends a first response message, where the first response message is used to confirm that the data cooperation function of the first electronic device and the second electronic device is enabled. Therefore, after the second electronic device receives the first response message, the data cooperation service can be displayed on the notification bar to confirm that the first electronic device and the second electronic device establish data cooperation.
响应于作用于第一控件的确认操作,第一电子设备在显示屏上弹出数据协作界面。一 种可能的实现方式,数据协作界面可以以第一显示框的形式显示在第一电子设备上。In response to the confirmation operation acting on the first control, the first electronic device pops up a data collaboration interface on the display screen. In a possible implementation manner, the data collaboration interface may be displayed on the first electronic device in the form of a first display frame.
如图8a中的(a)所示,第一显示框810可以包括以下至少一项:第二提示信息,第二控件820。As shown in (a) of FIG. 8a , the first display box 810 may include at least one of the following: second prompt information, and a second control 820 .
其中,第二提示信息可以用于提示数据协作场景开启,请进行语音输入。Wherein, the second prompt information may be used to prompt that the data collaboration scenario is opened, and please perform voice input.
第二控件820可以包括数据协作功能的协作操作按钮。该操作按钮用于开启或关闭用户的语音收集、文本录入、文本操作等功能。The second control 820 may include a collaboration operation button of the data collaboration function. The operation button is used to enable or disable the user's voice collection, text entry, text operation and other functions.
进一步的,考虑到第二电子设备可能开启了多个文档编辑应用的界面,第一显示框810还可以包括第三控件,如图8a中的(b)所示,第三控件830可以显示第二电子设备的多个文档编辑框的编辑预览界面,即第二电子设备开启的多个文档编辑应用的界面的小图标(包括文档1,文档2和应用1),用于用户选择协作创作的文稿所对应的文档编辑应用的界面。例如,响应于作用于文档1的图标的操作,第二电子设备切换至文档1的文档编辑应用与第一电子设备进行数据协作。响应于作用于文档2的图标的操作,第二电子设备切换至文档2的文档编辑应用与第一电子设备进行数据协作。响应于作用于应用1的图标的操作,第二电子设备切换至应用1的文档编辑框与第一电子设备进行数据协作。当然,切换的过程可以是第一电子设备在确定用户选择的小图标时,向第二电子设备发送对应的界面标识,从而实现实时切换。另一种可能的方式,也可以是在第一电子设备确定待发送文本后,向第二电子设备发送待发送文本时,同时向第二电子设备发送该界面标识,从而,第二电子设备在接收到该待发送文本及该界面标识后,将焦点切换至该界面后,在该界面上显示待发送文本。Further, considering that the second electronic device may open multiple document editing application interfaces, the first display frame 810 may further include a third control. As shown in (b) of FIG. 8a, the third control 830 may display a third control. The editing preview interface of multiple document editing boxes of the second electronic device, that is, the small icons (including document 1, document 2 and application 1) of the interface of multiple document editing applications opened by the second electronic device, for the user to select the collaborative creation The interface of the document editing application corresponding to the document. For example, in response to the operation of the icon acting on the document 1, the second electronic device switches to the document editing application of the document 1 to perform data collaboration with the first electronic device. In response to the operation of the icon acting on the document 2, the second electronic device switches to the document editing application of the document 2 to perform data collaboration with the first electronic device. In response to the operation acting on the icon of the application 1, the second electronic device switches to the document editing box of the application 1 to perform data collaboration with the first electronic device. Certainly, the switching process may be that when the first electronic device determines the small icon selected by the user, it sends the corresponding interface identifier to the second electronic device, thereby realizing real-time switching. Another possible way is that after the first electronic device determines the text to be sent, when sending the text to be sent to the second electronic device, the interface identifier is sent to the second electronic device at the same time, so that the second electronic device is in the After receiving the text to be sent and the interface identifier, the focus is switched to the interface, and the text to be sent is displayed on the interface.
考虑到第二电子设备可能开启多个文档编辑应用的界面中,每个文档编辑应用可能存在至少一个可编辑的文档编辑框,可以通过接收所述第二电子设备的所述多个文档编辑应用的通知消息,第一电子设备确定第二电子设备的多个文档编辑应用。从而,在所述数据协作界面上显示所述多个文档编辑应用的多个编辑预览界面。该通知消息还可以用于向第一电子设备通知第二电子设备的多个文档编辑框,从而,第一电子设备确定第二电子设备的多个文档编辑应用的多个文档编辑框。从而,在所述数据协作界面上显示所述多个文档编辑框的多个编辑预览界面。Considering that in the interface where the second electronic device may open multiple document editing applications, each document editing application may have at least one editable document editing box, the multiple document editing applications of the second electronic device may be received by receiving the multiple document editing applications. In the notification message, the first electronic device determines a plurality of document editing applications of the second electronic device. Thus, multiple editing preview interfaces of the multiple document editing applications are displayed on the data collaboration interface. The notification message may also be used to notify the first electronic device of multiple document editing boxes of the second electronic device, so that the first electronic device determines multiple document editing boxes of multiple document editing applications of the second electronic device. Thus, multiple editing preview interfaces of the multiple document editing boxes are displayed on the data collaboration interface.
响应于作用于所述多个编辑预览界面的切换操作,向所述第二电子设备发送切换消息;所述切换操作用于指示切换后的第二文档编辑框;所述切换消息用于指示所述第二电子设备将所述第二电子设备的焦点切换至第二文档编辑框。例如,第二电子设备的当前焦点在第一文档编辑应用的第一文档编辑框上,在第二电子设备接收到该切换消息后,第二电子设备可以将焦点从第一文档编辑应用的第一文档编辑框切换至第二文档编辑应用的第二文档编辑框上。此时,若第一电子设备采集第二语音数据,将所述第二语音数据转换为第三文本数据,在所述数据协作界面显示所述第三文本数据;响应于第二用户操作,向所述第二电子设备发送所述第三文本数据。相应的,第二电子设备接收所述第一电子设备发送的第三文本数据,可以在所述第二文档编辑框上显示所述第三文本数据。In response to the switching operation acting on the plurality of editing preview interfaces, a switching message is sent to the second electronic device; the switching operation is used to indicate the switched second document editing frame; the switching message is used to indicate the The second electronic device switches the focus of the second electronic device to the second document editing frame. For example, the current focus of the second electronic device is on the first document editing box of the first document editing application, after the second electronic device receives the switching message, the second electronic device can change the focus from the first document editing application to the first document editing box. A document editing frame is switched to the second document editing frame of the second document editing application. At this time, if the first electronic device collects the second voice data, converts the second voice data into third text data, and displays the third text data on the data cooperation interface; The second electronic device sends the third text data. Correspondingly, the second electronic device receives the third text data sent by the first electronic device, and can display the third text data on the second document editing box.
一种可能的实施例中,多个编辑预览界面可以在第一显示框内显示,例如,第一显示框还可以包括第四控件,如图8a中的(c)所示,第四控件840可以为下一焦点界面(例如,编辑框)的按钮,响应于作用于第四控件840的操作,第二电子设备中的焦点可以移动至下一可编辑的编辑框。进一步的,第四控件840中,还可以包括第二电子设备中的焦点界面的编辑预览界面,以保证用户当前选择的焦点界面为用户所需的焦点界面。In a possible embodiment, multiple editing preview interfaces may be displayed in the first display frame, for example, the first display frame may further include a fourth control, as shown in (c) of FIG. 8a, the fourth control 840 It may be a button of the next focus interface (eg, edit box), and in response to the operation acting on the fourth control 840, the focus in the second electronic device may be moved to the next editable edit box. Further, the fourth control 840 may further include an editing preview interface of the focus interface in the second electronic device, so as to ensure that the focus interface currently selected by the user is the focus interface required by the user.
S406、响应于作用于第一显示框的第一操作,接收用户的第一语音数据,并在数据协作界面上显示第一文本数据。S406. In response to the first operation acting on the first display frame, receive the first voice data of the user, and display the first text data on the data collaboration interface.
用户对第一电子设备的数据协作功能的协作操作按钮的操作,可以包括:点击、滑动、双击、多手势操作或语音控制等操作,在此不做限定。The user's operation on the cooperation operation button of the data cooperation function of the first electronic device may include operations such as clicking, sliding, double-clicking, multi-gesture operation, or voice control, which is not limited herein.
用户可以基于第一显示框中的第二控件820,进行语音输入。The user can perform voice input based on the second control 820 in the first display box.
如图8a中的(a)-(c)所示,语音输入的方式,可以为长按第二控件的方式,在用户按下第二控件时,开始接收语音信号;在用户松开第二控件时,停止接收语音信号,从而完成一次语音输入。也可以是点击第二控件,触发语音录入功能的开启,并在第一显示框中,显示当前为语音输入的状态。响应于用户再次点击第二控件的操作,停止语音信号的接收,从而完成一次语音输入。As shown in (a)-(c) in Fig. 8a, the way of voice input can be the way of long pressing the second control. When the user presses the second control, the voice signal starts to be received; when the user releases the second control When the control is activated, it stops receiving voice signals, thus completing a voice input. Alternatively, the second control may be clicked to trigger the activation of the voice input function, and the current state of voice input is displayed in the first display box. In response to the user's operation of clicking the second control again, the reception of the voice signal is stopped, thereby completing a voice input.
第二控件820可以调用语音识别的应用对输入语音进行识别,本申请实施例中,第二控件调用的语音识别的应用可以是第一电子设备默认的语音识别的应用,也可以是用户在语音识别设置界面设置的第三方应用,在此不做限定。The second control 820 may call a speech recognition application to recognize the input speech. In this embodiment of the present application, the speech recognition application called by the second control may be the default speech recognition application of the first electronic device, or it may be the user's voice recognition application. Identify third-party applications set in the settings interface, which is not limited here.
将所述第一语音数据识别为初始文本数据,在所述数据协作界面上显示所述初始文本数据。一种可能的方式,如图8b中的(a)所示,第一显示框还可以包括预览界面850。预览界面850用于显示转换后的初始文本数据。The first voice data is recognized as initial text data, and the initial text data is displayed on the data collaboration interface. In a possible manner, as shown in (a) of FIG. 8 b , the first display frame may further include a preview interface 850 . The preview interface 850 is used to display the converted original text data.
显示的方式可以有多种,例如,一种可能的方式,在语音输入的同时,可以对接收到的语音数据进行识别,转换为文本,转换后的文本可以在第一显示框中的预览界面进行显示。另一种可能的方式,在完成一次语音输入后,对输入的语音数据进行识别,将识别后的文本,显示在预览界面上。进一步的,还可以针对识别出的文本,进行纠错,纠错过程可以同时显示在预览界面上。There are many ways to display, for example, one possible way is that the received voice data can be recognized and converted into text while the voice is input, and the converted text can be displayed in the preview interface in the first display box. to display. In another possible manner, after completing a voice input, the input voice data is recognized, and the recognized text is displayed on the preview interface. Further, error correction can also be performed on the recognized text, and the error correction process can be displayed on the preview interface at the same time.
S407、响应于作用于第一显示框的确认操作,向第二电子设备发送第一文本数据。S407. In response to the confirmation operation acting on the first display frame, send the first text data to the second electronic device.
作用于第一显示框的确认操作可以为确认预览界面的文本为待发送的文本数据。The confirmation operation acting on the first display box may be confirming that the text in the preview interface is text data to be sent.
示例性的,如图8b中的(b)所示,第一显示框810还可以包括编辑控件860,编辑控件860可以为确认按钮,用于用户确认预览界面的文本为待发送的文本。Exemplarily, as shown in (b) of FIG. 8b, the first display box 810 may further include an edit control 860, which may be a confirmation button, for the user to confirm that the text in the preview interface is the text to be sent.
在用户确认待发送的文本之前,用户还可以对预览界面中的文本进行编辑,此时,数据协作界面可以包括编辑控件,该编辑控件用于对预览界面中的文本进行编辑。从而,第一电子设备响应于作用于所述编辑控件的第三用户操作,确定对所述初始文本数据的编辑指令,在所述数据协作界面上显示编辑后的初始文本数据;第一电子设备响应于用户第二用户操作,将所述编辑后的初始文本数据作为所述第一文本数据。编辑方式可以有多种,下面以方式c1-c3举例说明。Before the user confirms the text to be sent, the user can also edit the text in the preview interface. In this case, the data collaboration interface can include an editing control, and the editing control is used to edit the text in the preview interface. Therefore, the first electronic device determines an editing instruction for the initial text data in response to the third user operation acting on the editing control, and displays the edited initial text data on the data collaboration interface; the first electronic device In response to a second user operation of the user, the edited initial text data is used as the first text data. There are many editing methods, the following is an example of methods c1-c3.
方式c1,预览界面850可以为可编辑界面,可编辑界面中可以显示光标,该光标用于显示当前插入文本的位置。响应于用户点击该可编辑界面的光标操作,例如,移动光标,选中至少一个文本等操作,在预览界面850显示光标的位置或者选中的至少一个文本。响应于作用于语音确认控件的操作,接收用户输入的语音数据,识别用户输入的语音,并在光标位置,或选中的至少一个文本的位置插入或更新显示的文本。In manner c1, the preview interface 850 may be an editable interface, and a cursor may be displayed in the editable interface, and the cursor is used to display the position of the currently inserted text. In response to the user clicking the cursor on the editable interface, for example, moving the cursor, selecting at least one text, etc., the position of the cursor or the selected at least one text is displayed in the preview interface 850 . In response to an operation acting on the voice confirmation control, voice data input by the user is received, the voice input by the user is recognized, and displayed text is inserted or updated at the cursor position, or at the position of at least one selected text.
方式c2,预览界面850中的文本可以被用户选中,响应于作用于文本的选中操作,显示编辑控件,该编辑控件中可以包括:删除、插入、换行、退格、复制、粘贴等编辑子控件。响应于作用于编辑控件的点击操作,对文本进行编辑。例如,对输入的文本进行换行,添加标点符号,修改文本内容等。Mode c2, the text in the preview interface 850 can be selected by the user, and in response to the selection operation acting on the text, an editing control is displayed, and the editing control can include: delete, insert, line feed, backspace, copy, paste and other editing sub-controls . The text is edited in response to a click on the edit control. For example, wrap the input text, add punctuation marks, modify the text content, etc.
方式c3,预览界面850可以为可编辑界面,响应于用户点击该可编辑界面的操作,显示键盘输入框。响应于作用于键盘输入框的操作,接收用户输入的文本,并显示在预览界面,以实现对文本进行编辑。In manner c3, the preview interface 850 may be an editable interface, and in response to the user's operation of clicking on the editable interface, a keyboard input box is displayed. In response to the operation acting on the keyboard input box, the text input by the user is received and displayed on the preview interface, so as to realize the editing of the text.
第一电子设备向第二电子设备发送的文本数据还可以为富文本数据。例如,第一电子设备发送的第一文本数据可以包括:初始文本数据和对所述初始文本数据的编辑指令。一种可能的实现方式,富文本数据中包括:富文本编辑操作的字段。文本数据满足的协议可以为预先设置的协议,例如,如图9a所示,协议字段可以包括协议的编号Cmd标识,协议请求方及响应方对应的字段,文本数据字段。例如,Cmd标识为0x01时,可以表示,协议请求方向响应方发送第一通知消息,以建立数据协作场景。Cmd标识为0x02时,可以表示,协议请求方向响应方发送第二通知消息,以通知数据协作场景中断。Cmd标识为0x03时,可以表示,协议请求方向响应方发送文本数据,以通知响应方接收文本数据,该文本数据可以是仅包括文本的数据,不包括富文本编辑指令的数据。Cmd标识为0x04时,可以表示,协议请求方向响应方发送文本数据,以通知响应方接收文本数据,该文本数据可以是包括文本的数据和富文本编辑指令的数据。其中,协议请求方及响应方对应的字段可以占用4比特,例如,0x01用于表示:第二电子设备向第一电子设备发送文本输入请求,0x81用于表示:第一电子设备向第二电子设备发送文本输入响应。0x02用于表示:第一电子设备向第二电子设备发送文本输入请求,0x82用于表示:第二电子设备向第一电子设备发送文本输入响应。The text data sent by the first electronic device to the second electronic device may also be rich text data. For example, the first text data sent by the first electronic device may include: initial text data and an editing instruction for the initial text data. In a possible implementation manner, the rich text data includes: fields for rich text editing operations. The protocol satisfied by the text data may be a preset protocol. For example, as shown in FIG. 9a, the protocol field may include the protocol number Cmd identifier, the fields corresponding to the protocol requester and the responder, and the text data field. For example, when the Cmd identifier is 0x01, it may indicate that the protocol request sends a first notification message to the responder to establish a data collaboration scenario. When the Cmd identifier is 0x02, it may indicate that the protocol request sends a second notification message to the responder to notify the interruption of the data collaboration scenario. When the Cmd identifier is 0x03, it can indicate that the protocol request sends text data to the responder to notify the responder to receive text data. When the Cmd identifier is 0x04, it can indicate that the protocol request sends text data to the responder to notify the responder to receive text data, where the text data may be data including text and data of rich text editing instructions. The fields corresponding to the protocol requester and the responder may occupy 4 bits. For example, 0x01 is used to indicate that the second electronic device sends a text input request to the first electronic device, and 0x81 is used to indicate that the first electronic device sends a text input request to the second electronic device. The device sends a text input response. 0x02 is used to indicate that the first electronic device sends a text input request to the second electronic device, and 0x82 is used to indicate that the second electronic device sends a text input response to the first electronic device.
S408、第二电子设备接收第一文本数据,并在第一文档编辑应用的第一文档编辑框中显示第一文本数据。S408. The second electronic device receives the first text data, and displays the first text data in the first document editing box of the first document editing application.
第二电子设备通过应用层接收到第一文本数据后,解析第一文本数据中的文本数据字段,向内核层发送该文本数据字段,核心层将该文本数据字段存储于键盘缓冲区,从而通过键盘缓冲区,显示在第一文档编辑应用的第一文档编辑框上。After receiving the first text data through the application layer, the second electronic device parses the text data field in the first text data, sends the text data field to the kernel layer, and the core layer stores the text data field in the keyboard buffer, so as to pass the The keyboard buffer is displayed on the first document editing box of the first document editing application.
下面以方式C1-C3举例说明应用层向核心层传输文本数据字段及文本数据的其他字段,并存储于键盘缓冲区的中的方式。如图9b所示。Modes C1-C3 are exemplified below to illustrate how the application layer transmits text data fields and other fields of text data to the core layer and stores them in the keyboard buffer. As shown in Figure 9b.
方式C1,在应用层将从协议中解析出来的文本数据字段及文本数据的其他字段,转换为UNICODE键盘码,并将转换后的UNICODE键盘码发送至内核层的键盘缓冲区。In mode C1, the text data field and other fields of the text data parsed from the protocol are converted into UNICODE keyboard codes at the application layer, and the converted UNICODE keyboard codes are sent to the keyboard buffer of the kernel layer.
方式C2,在应用层中增加键盘驱动,通过键盘驱动,解析文本数据字段及文本数据的其他字段,生成UNICODE键盘码。通过键盘驱动与键盘缓冲区的接口,发送键盘驱动生成的UNICODE键盘码至键盘缓冲区。该方式可以提高解析文本数据字段及文本数据的其他字段的成功率。In mode C2, a keyboard driver is added to the application layer, and the UNICODE keyboard code is generated by parsing the text data field and other fields of the text data through the keyboard driver. Send the UNICODE keyboard code generated by the keyboard driver to the keyboard buffer through the interface between the keyboard driver and the keyboard buffer. This method can improve the success rate of parsing text data fields and other fields of text data.
方式C3,在应用层中增加第三方应用的输入法接口,通过输入法接口,将第一文本数据传输给相应的第三方应用对应的键盘驱动,从而,通过第三方应用对应的键盘驱动解析文本数据字段及文本数据的其他字段,生成UNICODE键盘码,输入到键盘缓冲区。需要说明的是,在该方式下,需要第二电子设备加载第三方应用,以实现通过第三方应用的键盘驱动,将文本数据存储于键盘缓冲区中。Mode C3, adding an input method interface of a third-party application in the application layer, and transmitting the first text data to the keyboard driver corresponding to the corresponding third-party application through the input method interface, thereby parsing the text through the keyboard driver corresponding to the third-party application For data fields and other fields of text data, generate UNICODE keyboard codes and input them into the keyboard buffer. It should be noted that, in this manner, the second electronic device needs to load a third-party application, so as to store text data in the keyboard buffer through the keyboard driving of the third-party application.
可选的,第一电子设备确定第二电子设备接收成功第一文本数据,删除所述第一文本数据,在第一显示框的显示界面上删除第一文本数据。Optionally, the first electronic device determines that the second electronic device successfully receives the first text data, deletes the first text data, and deletes the first text data on the display interface of the first display frame.
在本申请一些实施例中,第一电子设备可以通过接收所述第二电子设备发送的第一确认消息,确定第二电子设备接收成功第一文本数据。该第一确认消息用于指示所述第二电 子设备成功接收到所述第一文本数据。In some embodiments of the present application, the first electronic device may determine that the second electronic device successfully receives the first text data by receiving the first confirmation message sent by the second electronic device. The first confirmation message is used to indicate that the second electronic device has successfully received the first text data.
在本申请另外一些实施例中,在确定第二电子设备与第一电子设备的数据协作场景结束后,可以关闭第一电子设备的数据协作功能。一种可能的实现方式,可以是用户主动关闭第一电子设备的数据协作功能。此时,响应于作用于数据协作界面的关闭操作,应用程序层可以检测到作用于数据协作界面的关闭操作。应用程序层将上述操作转换为关闭数据协作功能的请求后,传递到应用程序框架层。应用程序框架层接收到请求后,调用与硬件抽象层之间通信的服务接口,以将关闭数据协作功能的请求传递到硬件抽象层。硬件抽象层接收到关闭数据协作功能的请求后,关闭手机的数据协作功能。In some other embodiments of the present application, after it is determined that the data cooperation scenario between the second electronic device and the first electronic device ends, the data cooperation function of the first electronic device may be turned off. A possible implementation manner may be that the user actively disables the data collaboration function of the first electronic device. At this time, in response to the closing operation acting on the data collaboration interface, the application layer can detect the closing operation acting on the data collaboration interface. After the application layer converts the above operation into a request to close the data collaboration function, it is passed to the application framework layer. After the application framework layer receives the request, it calls the service interface that communicates with the hardware abstraction layer to pass the request to close the data cooperation function to the hardware abstraction layer. After receiving the request to close the data cooperation function, the hardware abstraction layer closes the data cooperation function of the mobile phone.
另一种可能的实现方式,第一电子设备还可以动态监控第一电子设备与第二电子设备间的通信连接状态,或者,第一电子设备与无线接入点的连接状态,若第一电子设备检测到与第二电子设备间的连接断开,或者与无线接入点的连接断开,第一电子设备可以自动关闭数据协作功能,以节省第一电子设备的功耗。另外,第一电子设备还可以在第一电子设备的触摸屏上显示通知消息,以提示用户由于本机与第二电子设备间的连接断开,或者与无线接入点的连接断开,因此本机的数据协作功能已自动关闭。In another possible implementation manner, the first electronic device can also dynamically monitor the communication connection state between the first electronic device and the second electronic device, or the connection state between the first electronic device and the wireless access point, if the first electronic device When the device detects that the connection with the second electronic device is disconnected, or the connection with the wireless access point is disconnected, the first electronic device can automatically turn off the data cooperation function to save power consumption of the first electronic device. In addition, the first electronic device may also display a notification message on the touch screen of the first electronic device to prompt the user that the device is disconnected from the second electronic device or disconnected from the wireless access point. The data collaboration function of the machine has been automatically turned off.
第二电子设备在协作处理文本的过程中,需要跳转至其他应用中处理其他事情,从而导致数据协作的场景中断。在本申请实施例中,如图10a所示,在多设备数据协作的方法还可以包括以下步骤:In the process of cooperatively processing text, the second electronic device needs to jump to other applications to process other things, thus causing interruption of the data cooperation scene. In this embodiment of the present application, as shown in FIG. 10a, the method for data collaboration among multiple devices may further include the following steps:
S501、第二电子设备响应于对应用的第二切换操作,在第二电子设备上显示切换后的界面;所述第二切换操作用于将所述第二电子设备的焦点切换出第三文档编辑应用之外;第三文档编辑应用为所述第一电子设备与所述第二电子设备中断数据协作时对应的第三文档编辑应用。从而,第二电子设备的数据协作服务确定第二电子设备退出数据协作场景。S501. The second electronic device displays a switched interface on the second electronic device in response to a second switching operation of the application; the second switching operation is used to switch the focus of the second electronic device to a third document In addition to the editing application; the third document editing application is a third document editing application corresponding to when the first electronic device and the second electronic device discontinue data cooperation. Thus, the data collaboration service of the second electronic device determines that the second electronic device exits the data collaboration scenario.
一种可能的实现方式,对应用的第二切换操作可以是用户跳转至其他应用,导致第二电子设备的焦点转换至其他应用的显示界面中。此处的其他应用的显示界面可以是用户新打开的应用的界面,也可以是用户将第二电子设备的焦点切换到其他已开启的应用界面上,在此不做限定。In a possible implementation manner, the second switching operation of the application may be that the user jumps to another application, causing the focus of the second electronic device to be switched to the display interface of the other application. The display interface of other applications here may be the interface of the application newly opened by the user, or may be the user switching the focus of the second electronic device to the interface of other opened applications, which is not limited herein.
另一种可能的实现方式,对应用的第二切换操作可以是第二电子设备上显示通知消息,或接收到其他应用(例如,即时通信应用、视频通信应用等)的弹窗,导致第二电子设备的焦点转换至其他应用的显示界面。Another possible implementation manner, the second switching operation of the application may be displaying a notification message on the second electronic device, or receiving a pop-up window of other applications (for example, instant messaging applications, video communication applications, etc.), causing the second electronic device The focus of the electronic device is shifted to the display interface of other applications.
S502、第二电子设备向第一电子设备发送第二通知消息。S502. The second electronic device sends a second notification message to the first electronic device.
其中,第二通知消息用于向第一电子设备通知第二电子设备的焦点已切换,以通知所述第二电子设备与所述第一电子设备的数据协作中断。The second notification message is used to notify the first electronic device that the focus of the second electronic device has been switched, so as to notify that the data cooperation between the second electronic device and the first electronic device is interrupted.
进一步的,第二电子设备的数据协作服务可以存储中断的文档编辑应用(第三文档编辑应用)的第三文档编辑框,以便恢复数据协作场景时,第二电子设备可以根据存储的第三文档编辑应用的第三文档编辑框,直接在第二电子设备上显示第三文档编辑应用的第三文档编辑框,或者,将第二电子设备的焦点移动至第三文档编辑应用的第三文档编辑框上,提高恢复数据协作场景的响应速度。Further, the data collaboration service of the second electronic device can store the third document editing box of the interrupted document editing application (third document editing application), so that when the data collaboration scene is restored, the second electronic device can store the third document according to the stored third document. Edit the third document editing box of the application, directly display the third document editing box of the third document editing application on the second electronic device, or move the focus of the second electronic device to the third document editing application of the third document editing application On the box, improve the response speed of recovery data collaboration scenarios.
S503、第一电子设备接收第二通知消息,在第一电子设备上显示第二提示框。S503. The first electronic device receives the second notification message, and displays a second prompt box on the first electronic device.
第二提示框用于提示用户第二电子设备的焦点已切换。The second prompt box is used to prompt the user that the focus of the second electronic device has been switched.
如图10b中的(a)所示,第二提示框1010可以包括第三提示信息,该第三提示信息可以为:“HUAWEI MATEBOOK数据协作的场景已中断”。进一步的,第二提示框1010还可以包括停止输入的控件1020,从而,响应于作用于停止输入的控件1020的操作,第一电子设备关闭数据协作界面。As shown in (a) of FIG. 10b, the second prompt box 1010 may include third prompt information, and the third prompt information may be: "The scenario of HUAWEI MATEBOOK data collaboration has been interrupted". Further, the second prompt box 1010 may further include a control 1020 for stopping input, so that in response to the operation of the control 1020 for stopping input, the first electronic device closes the data collaboration interface.
S504、保存预览界面上未发送的第二文本数据。S504. Save the second text data that has not been sent on the preview interface.
一种可能的实现方式,第二文本数据可以直接存储于数据协作服务中的缓存区中,或者,第二文本数据还可以根据用户选择的第二电子设备的文档编辑应用,建立该应用相对应的文件,从而,将第二文本数据缓存至相应的文件中。In a possible implementation manner, the second text data can be directly stored in the buffer area in the data collaboration service, or the second text data can also be established according to the document editing application of the second electronic device selected by the user, corresponding to the application. file, so that the second text data is cached in the corresponding file.
在本申请一些实施例中,上述文件可以动态更新,例如,应用程序框架层可以对手机中的预览界面中的文本数据进行监控,当监测到预览界面中的文本数据发生变化时,通知硬件抽象层,以便硬件抽象层对相应的文件进行更新。In some embodiments of the present application, the above files may be updated dynamically. For example, the application framework layer may monitor the text data in the preview interface in the mobile phone, and notify the hardware abstraction when the text data in the preview interface is monitored to change. layer so that the hardware abstraction layer can update the corresponding files.
进一步的,第一电子设备可以关闭预览界面。Further, the first electronic device may close the preview interface.
从而,第二电子设备在满足第一条件时,在第二电子设备上显示第三文档编辑应用的第三文档编辑框;第一条件用于指示所述第一电子设备与所述第二电子设备的数据协作恢复;第一条件可以包括多种,例如,通过第二电子设备触发第一电子设备与第二电子设备的数据协作恢复,还可以通过第一电子设备触发第一电子设备与第二电子设备的数据协作恢复,下面以S505a和S505c举例说明。Therefore, when the second electronic device satisfies the first condition, the third document editing box of the third document editing application is displayed on the second electronic device; the first condition is used to indicate the first electronic device and the second electronic device The data cooperative recovery of the device; the first condition may include various, for example, triggering the data cooperative recovery between the first electronic device and the second electronic device through the second electronic device, or triggering the first electronic device and the second electronic device through the first electronic device. The data cooperative recovery of the two electronic devices is described below by taking S505a and S505c as examples.
S505a、响应于第二电子设备对应用的第一切换操作,所述第一切换操作用于将所述第二电子设备的焦点切换回所述第三文档编辑应用,第三文档编辑应用为所述第一电子设备与所述第二电子设备中断数据协作时对应的文档编辑应用。从而,第二电子设备的数据协作服务确定第二电子设备恢复数据协作场景,从而,向第一电子设备发送第三请求消息,第三请求消息用于请求恢复所述第一电子设备与所述第二电子设备的数据协作。S505a. In response to a first switching operation of the application by the second electronic device, the first switching operation is used to switch the focus of the second electronic device back to the third document editing application, where the third document editing application is the A document editing application corresponding to when the first electronic device and the second electronic device discontinue data collaboration. Therefore, the data cooperation service of the second electronic device determines the recovery data cooperation scenario of the second electronic device, and thus sends a third request message to the first electronic device, where the third request message is used to request to restore the first electronic device and the Data collaboration of the second electronic device.
S506a、第一电子设备接收第二电子设备发送的第三请求消息,在第一电子设备上显示第三提示框。S506a, the first electronic device receives the third request message sent by the second electronic device, and displays a third prompt box on the first electronic device.
第三提示框用于提示用户第二电子设备的焦点已恢复至第三文档编辑应用的第三文档编辑框。第三提示框可以是在通知栏显示,也可以是在主界面显示,在此不做限定。The third prompt box is used to prompt the user that the focus of the second electronic device has been restored to the third document editing box of the third document editing application. The third prompt box may be displayed on the notification bar, or may be displayed on the main interface, which is not limited herein.
以在通知栏显示第三提示框为例,如图10b中的(b)所示,第三提示框1011可以包括提示信息,该提示信息可以为:“是否使用手机与HUAWEI MATEBOOK数据协作”。进一步的,第三提示框1011还可以包括恢复输入的控件1021,从而,响应于作用于恢复输入的控件的操作,第一电子设备显示数据协作界面,并向第二电子设备发送恢复数据协作消息,该恢复数据协作消息用于确认第一电子设备与第二电子设备恢复数据协作。此处,数据协作界面可以为如图8a-图8b所示的数据协作界面。在此不再赘述。Taking the display of the third prompt box in the notification bar as an example, as shown in (b) in Figure 10b, the third prompt box 1011 may include prompt information, and the prompt information may be: "whether to use a mobile phone to cooperate with HUAWEI MATEBOOK data". Further, the third prompt box 1011 may further include a control 1021 for restoring input, so that in response to the operation of the control acting on restoring input, the first electronic device displays a data collaboration interface and sends a restoring data collaboration message to the second electronic device , the restoring data cooperation message is used to confirm that the first electronic device and the second electronic device restore data cooperation. Here, the data collaboration interface may be the data collaboration interface shown in FIGS. 8a-8b. It is not repeated here.
在S505a-S506a方案中,通过第一电子设备进行确认,才恢复第一电子设备与第二电子设备的数据协作场景,避免用户中断第一电子设备上可能进行的其他事件,提高用户体验。In the solutions S505a-S506a, the data collaboration scene between the first electronic device and the second electronic device is restored only after confirmation by the first electronic device, so as to prevent the user from interrupting other events that may be performed on the first electronic device and improve the user experience.
S505b、响应于第二电子设备对应用的第一切换操作,所述第一切换操作用于将所述第二电子设备的焦点切换回所述文档编辑应用,从而,第二电子设备的数据协作服务确定第二电子设备恢复数据协作场景,从而,向第一电子设备发送第三通知消息,第三通知消息用于确认恢复所述第一电子设备与所述第二电子设备的数据协作。相应的,第一电子设备接收第二电子设备发送的第三通知消息,在第一电子设备上显示第三提示框。此时,第 三提示框可以包括提示信息,该提示信息可以为:“恢复使用手机与HUAWEI MATEBOOK数据协作”。S505b. In response to the first switching operation of the second electronic device on the application, the first switching operation is used to switch the focus of the second electronic device back to the document editing application, so that the data collaboration of the second electronic device The service determines a data collaboration scenario for the second electronic device to resume, and thus sends a third notification message to the first electronic device, where the third notification message is used to confirm that the data collaboration between the first electronic device and the second electronic device is resumed. Correspondingly, the first electronic device receives the third notification message sent by the second electronic device, and displays a third prompt box on the first electronic device. At this time, the third prompt box may include prompt information, and the prompt information may be: "Resume the use of mobile phone and HUAWEI MATEBOOK data collaboration".
在S505b方案中,第一电子设备无需进行确认,直接恢复第一电子设备与第二电子设备的数据协作场景,避免用户过度确认,提高用户体验。In the solution of S505b, the first electronic device does not need to confirm, and directly restores the data collaboration scene between the first electronic device and the second electronic device, so as to avoid excessive confirmation by the user and improve user experience.
S505c、在第一电子设备确定满足第一触发条件时,第二电子设备的数据协作服务确定第一电子设备恢复数据协作场景,从而,向第二电子设备发送恢复数据协作消息。S505c: When the first electronic device determines that the first trigger condition is met, the data cooperation service of the second electronic device determines the first electronic device to restore the data cooperation scenario, thereby sending a restore data cooperation message to the second electronic device.
其中,第一触发条件用于触发所述第一电子设备的数据协作服务。下面以方式d1-d2举例说明第一触发条件的可能的实现方式。Wherein, the first trigger condition is used to trigger the data cooperation service of the first electronic device. A possible implementation manner of the first trigger condition is illustrated below with the manners d1-d2 as an example.
方式d1,响应于第一电子设备对数据协作服务的恢复操作,该恢复操作可以为作用于第一电子设备的手势,作用于第一电子设备的手势可以包括:向上抬起,或向下移动。第一电子设备可以通过陀螺仪、加速度计、重力加速度计等设备确定用户处于向上抬起的手势,或向下移动的手势。进一步的,为提高第一电子设备触发恢复数据协作场景的准确度,第一电子设备还可以在手势满足第一手势条件时,确定第一电子设备处于数据协作场景。Manner d1, in response to a recovery operation of the first electronic device on the data collaboration service, the recovery operation may be a gesture acting on the first electronic device, and the gesture acting on the first electronic device may include: lifting up, or moving down . The first electronic device may determine that the user is in an upward lift gesture or a downward movement gesture through a gyroscope, an accelerometer, a gravitational accelerometer and other devices. Further, in order to improve the accuracy with which the first electronic device triggers the restoration of the data collaboration scenario, the first electronic device may further determine that the first electronic device is in the data collaboration scenario when the gesture satisfies the first gesture condition.
如图11所示,一种可能的实现方式,第一手势条件可以包括:第一电子设备移动至与用户的距离大于第一阈值,小于第二阈值的范围内。例如,如图11所示,第一电子设备从初始位置移动至第一位置,对应的第一距离位于第一阈值范围内。第一电子设备从初始位置移动至第二位置,对应的第一距离位于大于第二阈值的范围内。第一电子设备从初始位置移动至第三位置,对应的第一距离位于大于或等于第一阈值,小于或等于第二阈值的范围内。其中,第一阈值可以是第一电子设备接听电话与用户的距离范围。第二阈值可以是用户使用终端设备的前置摄像头的距离范围。As shown in FIG. 11 , in a possible implementation manner, the first gesture condition may include: the first electronic device moves to a range where the distance from the user is greater than a first threshold and less than a second threshold. For example, as shown in FIG. 11 , when the first electronic device moves from the initial position to the first position, the corresponding first distance is within the first threshold range. The first electronic device moves from the initial position to the second position, and the corresponding first distance is within a range greater than the second threshold. The first electronic device moves from the initial position to the third position, and the corresponding first distance is within a range greater than or equal to the first threshold and less than or equal to the second threshold. Wherein, the first threshold may be the distance range between the first electronic device to answer the call and the user. The second threshold may be the distance range within which the user uses the front camera of the terminal device.
方式d2,第一触发条件还可以包括:第一电子设备未处于通话状态,或者,第一电子设备的摄像头模块未处于开启状态等。In manner d2, the first trigger condition may further include: the first electronic device is not in a call state, or the camera module of the first electronic device is not in an on state, and the like.
第一电子设备在确定满足第一触发条件时,向第二电子设备发送恢复数据协作消息,从而,第二电子设备接收到第一电子设备的恢复数据协作消息后,将焦点切换到中断的第三文档编辑应用的第三文档编辑框。第三文档编辑应用为所述第一电子设备与所述第二电子设备中断数据协作时对应的文档编辑应用。When the first electronic device determines that the first trigger condition is satisfied, it sends a recovery data cooperation message to the second electronic device, so that the second electronic device switches the focus to the interrupted first electronic device after receiving the recovery data coordination message from the first electronic device. The third document editing box of the three document editing application. The third document editing application is a document editing application corresponding to when the first electronic device and the second electronic device discontinue data collaboration.
进一步的,第二电子设备在接收到第一电子设备的恢复数据协作消息后,可以在第二电子设备上显示第四提示框。第四提示框用于提示用户第一电子设备向第二电子设备发送的恢复数据协作消息,以便用户确定是否需要恢复数据协作。Further, after receiving the data recovery cooperation message from the first electronic device, the second electronic device may display a fourth prompt box on the second electronic device. The fourth prompt box is used to prompt the user to restore the data cooperation message sent by the first electronic device to the second electronic device, so that the user can determine whether to restore the data cooperation.
如图10c中的(a)所示,第四提示框1030可以包括提示信息,该提示信息可以为:“是否恢复使用HUAWEI p40进行数据协作”。进一步的,第四提示框1030还可以包括恢复输入的控件1031,从而,响应于作用于恢复输入的控件的操作,向第一电子设备发送恢复协作响应,以恢复数据协作的场景。As shown in (a) of FIG. 10c, the fourth prompt box 1030 may include prompt information, and the prompt information may be: "whether to resume using HUAWEI p40 for data collaboration". Further, the fourth prompt box 1030 may further include a control 1031 for restoring input, so that in response to the operation of the control acting on restoring input, a response for restoring collaboration is sent to the first electronic device to restore the scenario of data collaboration.
S506c、第一电子设备接收来自第二电子设备的第三通知消息,在第一电子设备上显示第三提示框。S506c, the first electronic device receives the third notification message from the second electronic device, and displays a third prompt box on the first electronic device.
其中,第三通知消息用于通知第一电子设备恢复与第二电子设备的数据协作。第三提示框用于提示用户第二电子设备的焦点已恢复至文档编辑应用的界面。第三提示框可以是在通知栏显示,也可以是在主界面显示,在此不做限定。第三提示框的显示方式可以参考图10b中的第三提示框1011,在此不再赘述。The third notification message is used to notify the first electronic device to resume data cooperation with the second electronic device. The third prompt box is used to prompt the user that the focus of the second electronic device has been restored to the interface of the document editing application. The third prompt box may be displayed on the notification bar, or may be displayed on the main interface, which is not limited herein. For the display manner of the third prompt box, reference may be made to the third prompt box 1011 in FIG. 10b, which will not be repeated here.
需要说明的是,S506c可以是可选的步骤,例如,第一电子设备与第二电子设备可以 预先协商,由第一电子设备触发恢复数据协作场景,无需第二电子设备的确认,即第一电子设备在确认满足第一触发条件时,确认恢复第一电子设备和第二电子设备的数据协作场景。第一电子设备在确认满足第一触发条件时,在第一电子设备上显示第三提示框。It should be noted that S506c may be an optional step, for example, the first electronic device and the second electronic device may negotiate in advance, and the first electronic device triggers the recovery of the data collaboration scenario, without the confirmation of the second electronic device, that is, the first electronic device When confirming that the first trigger condition is satisfied, the electronic device confirms to restore the data cooperation scenario of the first electronic device and the second electronic device. When confirming that the first trigger condition is satisfied, the first electronic device displays a third prompt box on the first electronic device.
S507、响应于作用于第三提示框的操作,第一电子设备显示数据协作界面。S507. In response to the operation acting on the third prompt box, the first electronic device displays a data collaboration interface.
其中,数据协作界面可以显示上次未发送的文本数据。Among them, the data collaboration interface can display the text data that was not sent last time.
进一步的,响应于作用于第三提示框的操作,第一电子设备还可以显示预览界面。Further, in response to the operation acting on the third prompt box, the first electronic device may also display a preview interface.
S508、响应于第二用户操作,向第二电子设备发送第二文本数据。S508. In response to the second user operation, send second text data to the second electronic device.
其中,第二用户操作可以是作用于数据协作界面的确认操作,第二文本数据为第一电子设备保存的预览界面上未发送的文本数据。The second user operation may be a confirmation operation acting on the data collaboration interface, and the second text data is unsent text data on the preview interface saved by the first electronic device.
在S508中,第一电子设备还可以发送恢复数据协作的确认消息(例如,第三通知消息)给第二电子设备。In S508, the first electronic device may also send a confirmation message (eg, a third notification message) for resuming the data collaboration to the second electronic device.
S509、第二电子设备在第三文档编辑框显示第二文本数据。S509, the second electronic device displays the second text data in the third document editing box.
其中,第二电子设备可以在所述第三文档编辑应用的第三文档编辑框上显示第二文本数据,可选的,第二电子设备可以在显示屏上显示第五提示框。如图10c中的(b)所示,第五提示框1040可以包括提示信息,该提示信息可以为:“已恢复使用HUAWEI p40进行数据协作”。Wherein, the second electronic device may display the second text data on the third document editing box of the third document editing application, and optionally, the second electronic device may display the fifth prompt box on the display screen. As shown in (b) of FIG. 10c, the fifth prompt box 1040 may include prompt information, and the prompt information may be: "The use of HUAWEI p40 for data collaboration has been resumed".
进一步的,用户还可以在数据协作界面上继续输入语音,以继续进行数据协作的场景。该步骤可以参考S406-S409,在此不再赘述。Further, the user may continue to input voice on the data collaboration interface to continue the data collaboration scenario. For this step, reference may be made to S406-S409, which will not be repeated here.
第一电子设备在协作处理文本的过程中,可能会被其他应用打断,例如,第一电子设备需接听电话,或者切换接入网络的方式,再比如,用户需切换至其他应用中,查找资料等,还可能第一电子设备的网络中断,进行重连的过程,从而导致数据协作的场景中断。在本申请实施例中,如图12a所示,在多设备数据协作的方法还可以包括以下步骤:The first electronic device may be interrupted by other applications in the process of cooperatively processing text. For example, the first electronic device needs to answer a call or switch the way to access the network. For another example, the user needs to switch to other applications to search for data, etc., it is also possible that the network of the first electronic device is interrupted, and the process of reconnection is performed, thereby causing interruption of the data collaboration scenario. In this embodiment of the present application, as shown in FIG. 12a, the method for data collaboration among multiple devices may further include the following steps:
S601、第一电子设备响应于对第一电子设备的切换应用操作,第一电子设备的数据协作服务确定第一电子设备退出文稿创作场景,即第二电子设备与第一电子设备的数据协作中断。S601. In response to the switching application operation of the first electronic device, the data cooperation service of the first electronic device determines that the first electronic device exits the document creation scene, that is, the data cooperation between the second electronic device and the first electronic device is interrupted .
一种可能的实现方式,切换应用操作可以是用户跳转至其他应用,导致第一电子设备的显示界面显示其他应用的显示界面。此处的其他应用的显示界面可以是用户新打开的应用,也可以是用户将第一电子设备的显示界面切换到其他已开启的应用界面上,在此不做限定。In a possible implementation manner, the application switching operation may be that the user jumps to another application, causing the display interface of the first electronic device to display the display interface of the other application. The display interface of other applications here may be an application newly opened by the user, or may be the user switching the display interface of the first electronic device to another opened application interface, which is not limited herein.
另一种可能的实现方式,切换应用操作可以是第一电子设备上显示通知消息,或接收到其他应用(例如,即时通信应用、视频通信应用等)的弹窗,导致第二电子设备显示界面显示其他应用的显示界面。Another possible implementation manner, the application switching operation may be displaying a notification message on the first electronic device, or receiving a pop-up window of other applications (eg, instant messaging applications, video communication applications, etc.), causing the second electronic device to display an interface Displays the display interface of other applications.
S602、第一电子设备向第二电子设备发送中断通知消息。S602. The first electronic device sends an interruption notification message to the second electronic device.
其中,中断通知消息用于通知第一电子设备的数据协作场景已中断。The interruption notification message is used to notify the first electronic device that the data cooperation scene has been interrupted.
相应的,第一电子设备可以关闭预览界面。Correspondingly, the first electronic device can close the preview interface.
一种可能的实现方式,第一电子设备可以保存预览界面上未发送的第二文本数据。第一电子设备保存预览界面上未发送的第二文本数据的方式可以参考S502,在此不再赘述。In a possible implementation manner, the first electronic device may save the unsent second text data on the preview interface. The manner in which the first electronic device saves the unsent second text data on the preview interface may refer to S502, which will not be repeated here.
另一种可能的实现方式,当第一电子设备在中断之前,用户已确认第二文本数据为待发送的数据,此时,第一电子设备可以向第二电子设备发送第二文本数据,以使第二电子设备在相应的文档编辑应用中显示第二文本数据。In another possible implementation manner, before the first electronic device is interrupted, the user has confirmed that the second text data is the data to be sent. At this time, the first electronic device can send the second text data to the second electronic device to The second electronic device is caused to display the second text data in the corresponding document editing application.
S603、第二电子设备接收中断通知消息,在第二电子设备上显示第三提示框。S603. The second electronic device receives the interruption notification message, and displays a third prompt box on the second electronic device.
其中,第三提示框可以用于显示第二提示界面。第二提示界面用于提示用户第一电子设备的数据协作场景已中断。The third prompt box may be used to display the second prompt interface. The second prompt interface is used to prompt the user that the data collaboration scene of the first electronic device has been interrupted.
举例来说,如图12b中的(a)所示,第二提示界面1210可以包括提示信息,该提示信息可以为:“HUAWEI P40数据协作的场景已中断”。进一步的,第二提示界面1210还可以包括停止数据协作的控件1211,从而,响应于作用于停止数据协作的控件1211的操作,第二电子设备可以停止数据协作服务,并可以存储数据协作对应的文档编辑应用的界面。例如,第二电子设备的数据协作服务可以存储中断的数据协作应用(第三文档编辑应用)的界面,以便恢复数据协作场景时,第二电子设备可以根据存储的中断的数据协作应用的界面,直接在第二电子设备上显示中断的数据协作应用的界面,或者,将第二电子设备的焦点移动至中断的数据协作应用的界面上,提高恢复数据协作场景的响应速度。For example, as shown in (a) of FIG. 12b, the second prompt interface 1210 may include prompt information, and the prompt information may be: "The scenario of HUAWEI P40 data collaboration has been interrupted". Further, the second prompt interface 1210 may further include a control 1211 for stopping data collaboration, so that, in response to the operation of the control 1211 for stopping data collaboration, the second electronic device may stop the data collaboration service, and may store the corresponding data collaboration The interface of the document editing application. For example, the data collaboration service of the second electronic device may store the interface of the interrupted data collaboration application (third document editing application), so that when the data collaboration scenario is restored, the second electronic device may store the interface of the interrupted data collaboration application according to the stored interface. The interface of the interrupted data cooperation application is directly displayed on the second electronic device, or the focus of the second electronic device is moved to the interface of the interrupted data cooperation application, so as to improve the response speed of restoring the data cooperation scene.
第一电子设备在确定满足第三条件时,在所述第一电子设备上显示所述数据协作界面,并在所述数据协作界面上显示所述第二文本数据;所述第三条件用于指示所述第一电子设备与所述第二电子设备的数据协作恢复。When the first electronic device determines that a third condition is met, the data collaboration interface is displayed on the first electronic device, and the second text data is displayed on the data collaboration interface; the third condition is used for Instructing the first electronic device and the second electronic device to collaboratively restore data.
第三条件可以包括多种方式,既可以通过第一电子设备触发,也可以通过第二电子设备触发,下面以S604a-S604c举例说明第三条件可能的场景。The third condition may include multiple ways, which may be triggered by the first electronic device or by the second electronic device. The following uses S604a-S604c as examples to illustrate the possible scenarios of the third condition.
S604a、第一电子设备满足第一触发条件时,确定开启所述第一电子设备的数据协作服务。S604a. When the first electronic device satisfies the first trigger condition, it is determined to enable the data cooperation service of the first electronic device.
方式D1,响应于第一电子设备对应用的恢复操作,第一电子设备的数据协作服务确定第一电子设备恢复数据协作场景,从而,第一电子设备向第二电子设备发送恢复数据协作消息。Manner D1, in response to the restore operation of the application by the first electronic device, the data cooperation service of the first electronic device determines a data cooperation scenario of the first electronic device restoring data, so that the first electronic device sends a restoring data cooperation message to the second electronic device.
一种可能的实现方式,恢复操作可以是作用于第一电子设备的手势,确定手势满足第一手势条件,向第二电子设备发送第三请求消息,另一种可能的实现方式,第一电子设备响应于作用于数据协作界面的开启操作,向第二电子设备发送恢复数据协作消息。从而,第二电子设备接收到第一电子设备的恢复数据协作消息后,将焦点切换到中断的第三文档编辑应用的第三文档编辑框。具体可以参考方式d1,在此不再赘述。In one possible implementation, the recovery operation may be a gesture acting on the first electronic device, determining that the gesture satisfies the first gesture condition, and sending a third request message to the second electronic device. In another possible implementation, the first electronic The device sends a resume data collaboration message to the second electronic device in response to the opening operation acting on the data collaboration interface. Therefore, after receiving the data recovery message from the first electronic device, the second electronic device switches the focus to the third document editing box of the interrupted third document editing application. For details, reference may be made to the manner d1, which is not repeated here.
方式D2,第一触发条件还可以是第一电子设备确定未处于通话状态;或者,所述第一电子设备的摄像头模块未处于开启状态。具体可以参考方式d2,在此不再赘述。In manner D2, the first trigger condition may also be that the first electronic device determines that it is not in a call state; or, the camera module of the first electronic device is not in an on state. For details, reference may be made to the manner d2, which will not be repeated here.
S605a、第二电子设备接收第一电子设备发送的恢复数据协作消息,恢复数据协作消息用于请求恢复所述第一电子设备与所述第二电子设备的数据协作;在第二电子设备上显示第三提示界面。S605a. The second electronic device receives a data recovery cooperation message sent by the first electronic device, where the recovery data cooperation message is used to request recovery of the data cooperation between the first electronic device and the second electronic device; display on the second electronic device The third prompt interface.
第三提示界面用于提示用户第一电子设备的数据协作界面已恢复。第三提示界面可以是在通知栏显示,也可以是在第三文档编辑应用的第三文档编辑框显示,在此不做限定。The third prompt interface is used to prompt the user that the data collaboration interface of the first electronic device has been restored. The third prompt interface may be displayed in the notification bar, or may be displayed in the third document editing box of the third document editing application, which is not limited herein.
举例来说,如图12b中的(b)所示,第三提示界面1220可以包括提示信息,该提示信息可以为:“恢复HUAWEI P40数据协作的场景”。进一步的,如图12c所示,第三提示界面1220还可以包括恢复数据协作的控件1221,从而,响应于作用于恢复数据协作的控件1221的操作,第二电子设备可以开启数据协作服务,并显示已存储的中断前的数据协作对应的文档编辑应用的第三文档编辑框。For example, as shown in (b) of FIG. 12b, the third prompt interface 1220 may include prompt information, and the prompt information may be: "Resume the scenario of HUAWEI P40 data collaboration". Further, as shown in FIG. 12c , the third prompt interface 1220 may further include a control 1221 for resuming data collaboration, so that, in response to the operation of the control 1221 for resuming data collaboration, the second electronic device may enable the data collaboration service, and A third document editing box of the document editing application corresponding to the stored data collaboration before the interruption is displayed.
在一些实施例中,第二电子设备响应于作用于恢复数据协作的控件的操作,可以向第一电子设备发送第三通知消息,第三通知消息用于确认恢复所述第一电子设备与所述第二 电子设备的数据协作。在另一些实施例中,第二电子设备也可以在接收到恢复数据协作消息后,确认所述第一电子设备与所述第二电子设备的数据协作已恢复,无需向第一电子设备发送第三通知消息,具体实施过程可以根据需要确定,在此不做限定。In some embodiments, the second electronic device may send a third notification message to the first electronic device in response to the operation of the control for resuming the data collaboration, the third notification message is used to confirm that the first electronic device and the all data cooperation of the second electronic device. In other embodiments, the second electronic device may also confirm that the data cooperation between the first electronic device and the second electronic device has been restored after receiving the restore data cooperation message, without sending the first electronic device the first Three notification messages, the specific implementation process can be determined as needed, which is not limited here.
S604b、响应于第二电子设备的第一切换操作,第二电子设备的数据协作服务确定第二电子设备恢复数据协作场景,从而,向第一电子设备发送第三通知消息,第三通知消息用于确认所述第一电子设备恢复与所述第二电子设备的数据协作。S604b. In response to the first switching operation of the second electronic device, the data cooperation service of the second electronic device determines that the second electronic device restores the data cooperation scenario, thereby sending a third notification message to the first electronic device, the third notification message using After confirming that the first electronic device resumes data cooperation with the second electronic device.
S604c、响应于第二电子设备的第一切换操作,第二电子设备的数据协作服务确定第二电子设备恢复数据协作场景,从而,向第一电子设备发送第三请求消息,第三请求消息用于请求所述第一电子设备恢复与所述第二电子设备的数据协作。S604c, in response to the first switching operation of the second electronic device, the data cooperation service of the second electronic device determines that the second electronic device restores the data cooperation scenario, thereby sending a third request message to the first electronic device, and the third request message uses requesting the first electronic device to resume data cooperation with the second electronic device.
具体的第二电子设备的数据协作服务确定第二电子设备恢复数据协作场景,可以参考S505a,在此不再赘述。For the specific data cooperation service of the second electronic device to determine the data cooperation scenario of the second electronic device restoring data cooperation, reference may be made to S505a, which will not be repeated here.
S605c、第一电子设备接收来自第二电子设备的恢复数据协作消息,恢复数据协作消息用于通知所述第一电子设备恢复与所述第二电子设备的数据协作,在第一电子设备上显示第四提示界面。S605c: The first electronic device receives a data recovery cooperation message from the second electronic device, where the recovery data cooperation message is used to notify the first electronic device to resume data cooperation with the second electronic device, and display it on the first electronic device The fourth prompt interface.
第四提示界面用于提示用户第二电子设备的焦点已恢复至文档编辑应用的第三文档编辑框。第四提示界面可以是在通知栏显示,也可以是在主界面显示,在此不做限定。The fourth prompt interface is used to prompt the user that the focus of the second electronic device has been restored to the third document editing box of the document editing application. The fourth prompt interface may be displayed on the notification bar or on the main interface, which is not limited herein.
举例来说,如图12c中的(a)所示,第四提示界面1230可以包括第四提示信息,该第四提示信息可以为:“恢复HUAWEI P40数据协作场景”。进一步的,第四提示界面1230还可以包括确认恢复的控件1231,从而,响应于作用于确认恢复的控件1221的操作,第二电子设备可以开启数据协作服务,并向第一电子设备发送恢复协作响应。For example, as shown in (a) of FIG. 12c, the fourth prompt interface 1230 may include fourth prompt information, and the fourth prompt information may be: "Resume the HUAWEI P40 data collaboration scene". Further, the fourth prompt interface 1230 may further include a control 1231 for confirming restoration, so that, in response to the operation of the control 1221 for confirming restoration, the second electronic device may start the data cooperation service and send the restoration cooperation to the first electronic device response.
S606、响应于作用于第一电子设备的第五提示界面的操作,第一电子设备显示预览界面。S606. In response to the operation of the fifth prompt interface acting on the first electronic device, the first electronic device displays a preview interface.
举例来说,如图12c中的(b)所示,第五提示界面1240可以包括第五提示信息,该第五提示信息可以为:“恢复HUAWEI P40数据协作的场景”。进一步的,第五提示界面1240还可以包括恢复输入的控件1241,从而,响应于作用于确认恢复的控件1241的操作,第二电子设备可以开启数据协作服务,并显示中断数据协作前的数据协作界面。其中数据协作界面中可以包括中断数据协作前的预览界面。For example, as shown in (b) of FIG. 12c , the fifth prompt interface 1240 may include fifth prompt information, and the fifth prompt information may be: "Resume the scenario of HUAWEI P40 data collaboration". Further, the fifth prompt interface 1240 may further include a control 1241 for resuming the input, so that in response to the operation of the control 1241 for confirming the restoration, the second electronic device may enable the data collaboration service and display the data collaboration before the interruption of the data collaboration interface. The data collaboration interface may include a preview interface before data collaboration is interrupted.
其中,预览界面可以显示上次未发送的文本数据。预览界面的显示方式可以参考图8b中的(a)和(b)的显示方式,在此不再赘述。The preview interface may display text data that was not sent last time. For the display manner of the preview interface, reference may be made to the display manners of (a) and (b) in FIG. 8b , which will not be repeated here.
S607、响应于第二用户操作,向第二电子设备发送第三文本数据。S607. In response to the second user operation, send third text data to the second electronic device.
其中,第二用户操作可以是作用于数据协作界面的确认操作,第三文本数据可以是第一电子设备保存的预览界面上未发送的文本数据,也可以是第一电子设备新确认的待发送的文本数据。The second user operation may be a confirmation operation acting on the data collaboration interface, and the third text data may be unsent text data on the preview interface saved by the first electronic device, or may be newly confirmed by the first electronic device to be sent text data.
S608、第二电子设备显示第三文本数据。S608, the second electronic device displays the third text data.
其中,第二电子设备可以在中断的数据协作应用的文档编辑框上显示第三文本数据,具体方式可以参考S509,在此不再赘述。可选的,用户还可以在数据协作界面上继续输入语音,以继续进行数据协作的场景。该步骤可以参考S406-S409,在此不再赘述。Wherein, the second electronic device may display the third text data on the document editing box of the interrupted data collaboration application, and the specific method may refer to S509, which will not be repeated here. Optionally, the user may also continue to input voice on the data collaboration interface to continue the data collaboration scenario. For this step, reference may be made to S406-S409, which will not be repeated here.
上述本申请提供的实施例中,从电子设备作为执行主体的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,终端设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上 述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。In the above-mentioned embodiments of the present application, the methods provided by the embodiments of the present application are introduced from the perspective of an electronic device as an execution subject. In order to realize each function in the method provided by the above-mentioned embodiments of the present application, the terminal device may include a hardware structure and/or a software module, and implement the above-mentioned functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is performed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
以上实施例中所用,根据上下文,术语“当…时”或“当…后”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。另外,在上述实施例中,使用诸如第一、第二之类的关系术语来区份一个实体和另一个实体,而并不限制这些实体之间的任何实际的关系和顺序。As used in the above embodiments, depending on the context, the terms "when" or "after" can be interpreted to mean "if" or "after" or "in response to determining..." or "in response to detecting …”. Similarly, depending on the context, the phrases "in determining..." or "if detecting (the stated condition or event)" can be interpreted to mean "if determining..." or "in response to determining..." or "on detecting (the stated condition or event)" or "in response to the detection of (the stated condition or event)". Additionally, in the above-described embodiments, relational terms such as first and second are used to distinguish one entity from another, without limiting any actual relationship and order between these entities.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘Solid State Disk(SSD))等。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), and the like.
需要指出的是,本专利申请文件的一部分包含受著作权保护的内容。除了对专利局的专利文件或记录的专利文档内容制作副本以外,著作权人保留著作权。It should be noted that a part of this patent application file contains content protected by copyright. Except for making copies of the patent files of the Patent Office or the contents of the recorded patent files, the copyright owner reserves the right to copyright.

Claims (28)

  1. 一种多设备数据协作的方法,应用于第二电子设备,其特征在于,包括:A method for multi-device data collaboration, applied to a second electronic device, comprising:
    响应于作用于第一文档编辑应用的第一操作,显示所述第一文档编辑应用的第一文档编辑框;In response to a first operation acting on the first document editing application, displaying a first document editing box of the first document editing application;
    发送第一通知消息至第一电子设备,所述第一通知消息用于建立所述第一电子设备与所述第二电子设备间的数据协作;sending a first notification message to the first electronic device, where the first notification message is used to establish data cooperation between the first electronic device and the second electronic device;
    接收所述第一电子设备发送的第一文本数据,在所述第一文档编辑框上显示所述第一文本数据。The first text data sent by the first electronic device is received, and the first text data is displayed on the first document editing box.
  2. 根据权利要求1所述的方法,其特征在于,所述第一文档编辑应用为所述第二电子设备中配置的文档编辑白名单中的应用。The method according to claim 1, wherein the first document editing application is an application in a document editing whitelist configured in the second electronic device.
  3. 根据权利要求1所述的方法,其特征在于,所述第一操作,包括以下项中至少一项:The method according to claim 1, wherein the first operation comprises at least one of the following items:
    开启所述第一文档编辑应用的操作;点击所述第一文档编辑应用中的文档编辑框的操作;切换所述第一文档编辑应用的操作;或者,切换所述第一文档编辑应用中的文档编辑框的操作。The operation of opening the first document editing application; the operation of clicking the document editing box in the first document editing application; the operation of switching the first document editing application; or, the switching of the first document editing application The operation of the document edit box.
  4. 根据权利要求1所述的方法,其特征在于,所述发送第一通知消息至第一电子设备前,还包括:The method according to claim 1, wherein before the sending the first notification message to the first electronic device, the method further comprises:
    显示第一查找设备界面,所述第一查找设备界面用于显示与所述第二电子设备建立通信连接的电子设备;displaying a first search device interface, where the first search device interface is used to display an electronic device that establishes a communication connection with the second electronic device;
    响应于选择所述电子设备中的所述第一电子设备的第二操作,确定发送所述第一通知消息至所述第一电子设备。In response to a second operation of selecting the first electronic device of the electronic devices, it is determined to send the first notification message to the first electronic device.
  5. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    接收所述第一电子设备发送的通信连接请求,其中所述通信连接请求通过近场通信发送;receiving a communication connection request sent by the first electronic device, wherein the communication connection request is sent by near field communication;
    与所述第一电子设备建立通信连接;establishing a communication connection with the first electronic device;
    显示第一连接消息,所述第一连接消息用于提示用户所述第二电子设备与所述第一电子设备建立通信连接。A first connection message is displayed, where the first connection message is used to prompt the user to establish a communication connection between the second electronic device and the first electronic device.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述发送第一通知消息至第一电子设备后,还包括:The method according to any one of claims 1-5, wherein after the sending the first notification message to the first electronic device, the method further comprises:
    接收所述第一电子设备发送的第一响应消息,所述第一响应消息用于确认所述第一电子设备与所述第二电子设备建立数据协作;receiving a first response message sent by the first electronic device, where the first response message is used to confirm that the first electronic device and the second electronic device establish data cooperation;
    显示所述第一响应消息。The first response message is displayed.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述第二电子设备上包括多个文档编辑应用,所述多个文档编辑应用至少包括所述第一文档编辑应用和第二文档编辑应用,所述方法还包括:The method according to any one of claims 1-6, wherein the second electronic device includes multiple document editing applications, and the multiple document editing applications at least include the first document editing application and the first document editing application. Two document editing applications, the method further includes:
    发送第二通知消息至所述第一电子设备,所述第二通知消息用于指示所述第二电子设备运行所述多个文档编辑应用,sending a second notification message to the first electronic device, where the second notification message is used to instruct the second electronic device to run the plurality of document editing applications,
    接收所述第一电子设备发送的切换消息,所述切换消息用于指示所述第二电子设备将焦点从所述第一文档编辑应用切换至所述第二文档编辑应用;receiving a switching message sent by the first electronic device, where the switching message is used to instruct the second electronic device to switch the focus from the first document editing application to the second document editing application;
    将所述焦点切换至所述第二文档编辑应用的第二文档编辑框;switching the focus to a second document editing box of the second document editing application;
    接收所述第一电子设备发送的第三文本数据,在所述第二文档编辑框上显示所述第三文本数据。receiving third text data sent by the first electronic device, and displaying the third text data on the second document editing box.
  8. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    满足第一条件时,在所述第二电子设备上显示第三文档编辑应用,所述第三文档编辑应用为所述第一电子设备与所述第二电子设备中断数据协作时对应的文档编辑应用;When the first condition is satisfied, a third document editing application is displayed on the second electronic device, and the third document editing application is the document editing corresponding to the interruption of data collaboration between the first electronic device and the second electronic device application;
    接收所述第一电子设备发送的第二文本数据,在所述第三文档编辑应用的第三文档编辑框上显示所述第二文本数据;receiving second text data sent by the first electronic device, and displaying the second text data on a third document editing box of the third document editing application;
    其中,所述第二文本数据为所述数据协作中断时所述第一电子设备生成的文本数据;Wherein, the second text data is text data generated by the first electronic device when the data collaboration is interrupted;
    其中,所述第一条件包括以下项中至少一项:响应于第一切换操作,所述第一切换操作将所述第二电子设备的焦点切换至所述第三文档编辑应用;Wherein, the first condition includes at least one of the following items: in response to a first switching operation, the first switching operation switches the focus of the second electronic device to the third document editing application;
    或者,接收所述第一电子设备发送的恢复数据协作消息,所述恢复数据协作消息用于请求恢复所述第一电子设备与所述第二电子设备的数据协作。Or, receive a resumption data cooperation message sent by the first electronic device, where the resumption data cooperation message is used to request resumption of data cooperation between the first electronic device and the second electronic device.
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:The method according to claim 8, wherein the method further comprises:
    响应于作用于所述第三文档编辑应用的第二切换操作,显示切换后的界面,所述第二切换操作用于将所述第二电子设备的焦点切换出所述第三文档编辑应用外;Displaying a switched interface in response to a second switching operation acting on the third document editing application, the second switching operation being used to switch the focus of the second electronic device out of the third document editing application ;
    发送第三通知消息至所述第一电子设备,所述第三通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断。Sending a third notification message to the first electronic device, where the third notification message is used to notify the second electronic device that the data cooperation between the second electronic device and the first electronic device is interrupted.
  10. 根据权利要求8所述的方法,其特征在于,所述第一电子设备与所述第二电子设备中断数据协作,包括:The method according to claim 8, wherein the interruption of data cooperation between the first electronic device and the second electronic device comprises:
    接收所述第一电子设备的中断通知消息,所述中断通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断。An interruption notification message of the first electronic device is received, where the interruption notification message is used to notify the interruption of data cooperation between the second electronic device and the first electronic device.
  11. 根据权利要求8-10任一项所述的方法,其特征在于,所述接收所述第一电子设备发送的第二文本数据之前,还包括:The method according to any one of claims 8-10, wherein before the receiving the second text data sent by the first electronic device, the method further comprises:
    发送第四通知消息至所述第一电子设备,所述第四通知消息用于通知所述第一电子设备恢复与所述第二电子设备的数据协作。Sending a fourth notification message to the first electronic device, where the fourth notification message is used to notify the first electronic device to resume data cooperation with the second electronic device.
  12. 根据权利要求8-10任一项所述的方法,其特征在于,所述接收所述第一电子设备发送的第二文本数据之前,还包括:The method according to any one of claims 8-10, wherein before the receiving the second text data sent by the first electronic device, the method further comprises:
    发送恢复请求消息至所述第一电子设备,所述恢复请求消息用于请求恢复所述第一电子设备与所述第二电子设备的数据协作;sending a recovery request message to the first electronic device, where the recovery request message is used to request recovery of data cooperation between the first electronic device and the second electronic device;
    接收所述第一电子设备发送的恢复数据协作消息,所述恢复数据协作消息用于确认恢复所述第一电子设备与所述第二电子设备的数据协作。A restore data cooperation message sent by the first electronic device is received, where the restore data cooperation message is used to confirm restoring the data cooperation between the first electronic device and the second electronic device.
  13. 一种多设备数据协作的方法,应用于第一电子设备,其特征在于,包括:A method for multi-device data collaboration, applied to a first electronic device, characterized in that it includes:
    接收第二电子设备发送的第一通知消息,显示第一提示框,所述第一通知消息用于请求所述第一电子设备与所述第二电子设备建立数据协作,所述第一提示框包括第一控件;Receive a first notification message sent by the second electronic device, and display a first prompt box, where the first notification message is used to request the first electronic device to establish data cooperation with the second electronic device, and the first prompt box including the first control;
    响应于作用于所述第一控件的第一用户操作,显示数据协作界面;displaying a data collaboration interface in response to a first user operation acting on the first control;
    采集第一语音数据,将所述第一语音数据转换为第一文本数据,在所述数据协作界面显示所述第一文本数据;collecting first voice data, converting the first voice data into first text data, and displaying the first text data on the data collaboration interface;
    响应于第二用户操作,发送所述第一文本数据至所述第二电子设备。In response to a second user operation, the first text data is sent to the second electronic device.
  14. 根据权利要求13所述的方法,其特征在于,所述数据协作界面还包括编辑控件,所述将所述第一语音数据转换为第一文本数据,包括:The method according to claim 13, wherein the data collaboration interface further comprises an editing control, and the converting the first voice data into the first text data comprises:
    将所述第一语音数据转换为初始文本数据,在所述数据协作界面上显示所述初始文本数据;converting the first voice data into initial text data, and displaying the initial text data on the data collaboration interface;
    响应于作用于所述编辑控件的第三用户操作,对所述初始文本数据执行编辑指令,在所述数据协作界面上显示编辑后的文本数据;In response to a third user operation acting on the editing control, executing an editing instruction on the initial text data, and displaying the edited text data on the data collaboration interface;
    响应于作用于所述数据协作界面的确认操作,将所述编辑后的文本数据替换所述第一文本数据。In response to a confirmation operation acting on the data collaboration interface, the edited text data is replaced with the first text data.
  15. 根据权利要求14所述的方法,其特征在于,所述第一文本数据包括初始文本数据和对所述初始文本数据的编辑指令。The method of claim 14, wherein the first text data includes initial text data and editing instructions for the initial text data.
  16. 根据权利要求13-15任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 13-15, wherein the method further comprises:
    接收所述第二电子设备发送的第一确认消息,所述第一确认消息用于指示所述第二电子设备成功接收到所述第一文本数据;receiving a first confirmation message sent by the second electronic device, where the first confirmation message is used to indicate that the second electronic device has successfully received the first text data;
    删除所述数据协作界面上显示的所述第一文本数据。The first text data displayed on the data collaboration interface is deleted.
  17. 根据权利要求13-16任一项所述的方法,其特征在于,所述接收第二电子设备发送的第一通知消息之前,还包括:The method according to any one of claims 13-16, wherein before the receiving the first notification message sent by the second electronic device, the method further comprises:
    与所述第二电子设备的距离满足第一距离阈值时,通过近场通信发送通信连接请求至所述第二电子设备;When the distance with the second electronic device meets the first distance threshold, send a communication connection request to the second electronic device through near field communication;
    与所述第一电子设备建立通信连接,显示第一连接消息,所述第一连接消息用于提示所述第二电子设备与所述第一电子设备建立通信连接。A communication connection is established with the first electronic device, and a first connection message is displayed, where the first connection message is used to prompt the second electronic device to establish a communication connection with the first electronic device.
  18. 根据权利要求13-17任一项所述的方法,其特征在于,所述响应于作用于所述第一控件的第一用户操作,还包括:The method according to any one of claims 13-17, wherein the responding to the first user operation acting on the first control further comprises:
    发送第一响应消息至所述第二电子设备,所述第一响应消息用于确认开启所述第一电子设备与所述第二电子设备的数据协作。Sending a first response message to the second electronic device, where the first response message is used to confirm that data cooperation between the first electronic device and the second electronic device is enabled.
  19. 根据权利要求13-18任一项所述的方法,其特征在于,所述第二电子设备上包括多个文档编辑应用,所述多个文档编辑应用至少包括第一文档编辑应用和第二文档编辑应用,所述方法还包括:The method according to any one of claims 13-18, wherein the second electronic device includes multiple document editing applications, and the multiple document editing applications include at least a first document editing application and a second document Editing the application, the method further includes:
    接收所述第二电子设备发送的应用通知消息,在所述数据协作界面上显示所述多个文档编辑应用的控件;所述应用通知消息用于指示所述第二电子设备包括所述多个文档编辑应用;receiving an application notification message sent by the second electronic device, and displaying the controls of the plurality of document editing applications on the data collaboration interface; the application notification message is used to indicate that the second electronic device includes the plurality of document editing applications document editing applications;
    响应于作用于所述多个文档编辑应用的控件的切换操作,发送切换消息至所述第二电子设备,其中,所述切换操作指所述第二电子设备将焦点从所述第一文档编辑应用切换至所述第二文档编辑应用,所述切换消息用于指示所述第二电子设备将所述第二电子设备的焦点切换至第二文档编辑应用的第二文档编辑框;sending a switching message to the second electronic device in response to a switching operation acting on the controls of the plurality of document editing applications, wherein the switching operation refers to the second electronic device to change focus from editing the first document The application is switched to the second document editing application, and the switching message is used to instruct the second electronic device to switch the focus of the second electronic device to the second document editing box of the second document editing application;
    采集第二语音数据,将所述第二语音数据转换为第三文本数据,在所述数据协作界面显示所述第三文本数据;collecting second voice data, converting the second voice data into third text data, and displaying the third text data on the data collaboration interface;
    响应于所述第二用户操作,发送所述第三文本数据至所述第二电子设备。In response to the second user operation, the third text data is sent to the second electronic device.
  20. 根据权利要求13-19任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 13-19, wherein the method further comprises:
    满足第二条件时,缓存第二文本数据,所述第二文本数据为所述第一电子设备与所述第二电子设备中断数据协作时在所述数据协作界面上显示的文本数据,所述第二条件用于指示所述第一电子设备与所述第二电子设备的数据协作中断;When the second condition is satisfied, second text data is cached, and the second text data is text data displayed on the data cooperation interface when the first electronic device and the second electronic device interrupt data cooperation, and the second text data is displayed on the data cooperation interface. The second condition is used to indicate that the data cooperation between the first electronic device and the second electronic device is interrupted;
    满足第三条件时,显示所述数据协作界面,并在所述数据协作界面上显示所述第二文 本数据,所述第三条件用于指示所述第一电子设备与所述第二电子设备的数据协作恢复;When a third condition is met, the data collaboration interface is displayed, and the second text data is displayed on the data collaboration interface, where the third condition is used to indicate the first electronic device and the second electronic device collaborative data recovery;
    发送所述第二文本数据至所述第二电子设备。Sending the second text data to the second electronic device.
  21. 根据权利要求20所述的方法,其特征在于,所述第二条件包括以下项中至少一项:The method of claim 20, wherein the second condition comprises at least one of the following:
    接收到所述第二电子设备发送的第二通知消息,所述第二通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断;receiving a second notification message sent by the second electronic device, where the second notification message is used to notify that the data cooperation between the second electronic device and the first electronic device is interrupted;
    或者,响应于所述第一电子设备的切换应用操作,在所述第一电子设备上显示切换后的应用界面,所述切换应用操作用于在所述第一电子设备上启动切换后的应用。Or, in response to an application switching operation of the first electronic device, a switched application interface is displayed on the first electronic device, and the switching application operation is used to start the switched application on the first electronic device .
  22. 根据权利要求21所述的方法,其特征在于,所述响应于所述第一电子设备的切换应用操作,还包括:The method according to claim 21, wherein the switching application operation in response to the first electronic device further comprises:
    发送中断通知消息至所述第二电子设备,所述中断通知消息用于通知所述第二电子设备与所述第一电子设备的数据协作中断。Sending an interruption notification message to the second electronic device, where the interruption notification message is used to notify the second electronic device that the data cooperation with the first electronic device is interrupted.
  23. 根据权利要求20所述的方法,其特征在于,所述第三条件包括以下项中至少一项:The method of claim 20, wherein the third condition comprises at least one of the following:
    检测对所述第一电子设备的手势,确定所述手势满足第一手势条件,所述第一手势条件指所述第一电子设备移动至与用户的距离大于第一阈值,小于第二阈值的范围内,所述手势包括:向上抬起,或向下移动;Detecting a gesture to the first electronic device, and determining that the gesture satisfies a first gesture condition, the first gesture condition means that the first electronic device moves to a distance from the user greater than a first threshold and less than a second threshold. Within the range, the gesture includes: lift up, or move down;
    所述第一电子设备未处于通话状态;或者,所述第一电子设备的摄像头模块未处于开启状态;接收到所述第二电子设备发送的第三通知消息,所述第三通知消息用于通知所述第一电子设备恢复与所述第二电子设备的数据协作;The first electronic device is not in a call state; or, the camera module of the first electronic device is not in an on state; a third notification message sent by the second electronic device is received, and the third notification message is used for Notifying the first electronic device to resume data cooperation with the second electronic device;
    或者,接收到所述第二电子设备发送的第三请求消息,所述第三请求消息用于请求所述第一电子设备恢复与所述第二电子设备的数据协作,在所述第一电子设备上的第二提示框中显示所述第三请求消息,响应于对所述第二提示框的操作,确认恢复所述第一电子设备与所述第二电子设备的数据协作。Or, receiving a third request message sent by the second electronic device, where the third request message is used to request the first electronic device to resume data cooperation with the second electronic device, and the first electronic device The third request message is displayed in a second prompt box on the device, and in response to the operation on the second prompt box, it is confirmed to restore the data cooperation between the first electronic device and the second electronic device.
  24. 根据权利要求23所述的方法,其特征在于,所述响应于对所述第二提示框的操作,确认恢复所述第一电子设备与所述第二电子设备的数据协作之后,还包括:The method according to claim 23, wherein after confirming that the data cooperation between the first electronic device and the second electronic device is restored in response to the operation on the second prompt box, the method further comprises:
    发送恢复数据协作消息至所述第二电子设备,所述恢复数据协作消息用于确认恢复所述第一电子设备与所述第二电子设备的数据协作。Sending a restore data cooperation message to the second electronic device, where the restore data cooperation message is used to confirm restoring the data cooperation between the first electronic device and the second electronic device.
  25. 一种电子设备,其特征在于,所述电子设备包括存储器和一个或多个处理器;其中,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;当所述计算机指令被所述处理器执行时,使得所述电子设备执行如权利要求1至12中任一项所述的方法。An electronic device, characterized in that the electronic device includes a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are When executed by the processor, the electronic device is caused to execute the method according to any one of claims 1 to 12.
  26. 一种电子设备,其特征在于,所述电子设备包括存储器和一个或多个处理器;其中,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;当所述计算机指令被所述处理器执行时,使得所述电子设备执行如权利要求13至24中任一项所述的方法。An electronic device, characterized in that the electronic device includes a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are When executed by the processor, the electronic device is caused to execute the method according to any one of claims 13 to 24.
  27. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括程序指令,当所述程序指令在终端设备上运行时,使得所述终端设备执行如权利要求1至12任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium includes program instructions, which, when the program instructions are executed on a terminal device, cause the terminal device to execute any one of claims 1 to 12 the method described.
  28. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括程序指令,当所述程序指令在终端设备上运行时,使得所述终端设备执行如权利要求13至24任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium includes program instructions, which, when the program instructions are executed on a terminal device, cause the terminal device to execute any one of claims 13 to 24 the method described.
PCT/CN2021/110646 2020-08-06 2021-08-04 Multi-device data collaboration method and electronic device WO2022028494A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010784936.3 2020-08-06
CN202010784936.3A CN114065706A (en) 2020-08-06 2020-08-06 Multi-device data cooperation method and electronic device

Publications (1)

Publication Number Publication Date
WO2022028494A1 true WO2022028494A1 (en) 2022-02-10

Family

ID=80120001

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/110646 WO2022028494A1 (en) 2020-08-06 2021-08-04 Multi-device data collaboration method and electronic device

Country Status (2)

Country Link
CN (1) CN114065706A (en)
WO (1) WO2022028494A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489920A (en) * 2022-04-18 2022-05-13 北京麟卓信息科技有限公司 Input method of android application on Linux platform

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115941674B (en) * 2023-02-21 2023-07-14 荣耀终端有限公司 Multi-device application connection method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105072246A (en) * 2015-07-01 2015-11-18 小米科技有限责任公司 Information synchronization method, device and terminal
CN109976617A (en) * 2019-04-03 2019-07-05 腾讯科技(深圳)有限公司 Document display method and apparatus
CN110321733A (en) * 2014-08-27 2019-10-11 微软技术许可有限责任公司 Content is shared using near-field communication and admissions control
CN110837275A (en) * 2014-05-30 2020-02-25 苹果公司 Switching from using one device to another
CN111367689A (en) * 2020-03-02 2020-07-03 北京字节跳动网络技术有限公司 Interactive prompt information sending method and device of online document and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110837275A (en) * 2014-05-30 2020-02-25 苹果公司 Switching from using one device to another
CN110321733A (en) * 2014-08-27 2019-10-11 微软技术许可有限责任公司 Content is shared using near-field communication and admissions control
CN105072246A (en) * 2015-07-01 2015-11-18 小米科技有限责任公司 Information synchronization method, device and terminal
CN109976617A (en) * 2019-04-03 2019-07-05 腾讯科技(深圳)有限公司 Document display method and apparatus
CN111367689A (en) * 2020-03-02 2020-07-03 北京字节跳动网络技术有限公司 Interactive prompt information sending method and device of online document and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489920A (en) * 2022-04-18 2022-05-13 北京麟卓信息科技有限公司 Input method of android application on Linux platform
CN114489920B (en) * 2022-04-18 2022-07-05 北京麟卓信息科技有限公司 Input method of android application on Linux platform

Also Published As

Publication number Publication date
CN114065706A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
US20220279062A1 (en) Screen projection method and electronic device
US20220342850A1 (en) Data transmission method and related device
CN111066306B (en) Method for sharing data in local area network and electronic equipment
AU2018421189B2 (en) Method for quickly opening application or application function, and terminal
AU2022211850B2 (en) Application function implementation method and electronic device
CN111666055B (en) Data transmission method and device
WO2022100237A1 (en) Screen projection display method and related product
US20230049548A1 (en) Audio Output Method and Terminal Device
CN111221845A (en) Cross-device information searching method and terminal device
WO2022028494A1 (en) Multi-device data collaboration method and electronic device
WO2022089294A1 (en) Inter-device screen collaboration method and device
WO2022033342A1 (en) Data transmission method and device
CN112148401A (en) View display method and electronic equipment
CN114510186A (en) Cross-device control method and device
JP7319431B2 (en) Application function implementation method and electronic device
WO2022105716A1 (en) Camera control method based on distributed control, and terminal device
WO2022194005A1 (en) Control method and system for synchronous display across devices
WO2022166614A1 (en) Method and apparatus for executing control operation, storage medium, and control
WO2022068628A1 (en) Distributed display method of interface, and electronic device and communication system
CN116069723A (en) File migration method, electronic equipment and storage medium

Legal Events

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

Ref document number: 21853953

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21853953

Country of ref document: EP

Kind code of ref document: A1