Data sharing method, system and device, terminal equipment and storage medium

By establishing wireless communication connections between multiple devices, file data sharing and editing and synchronization between terminal devices is realized, which solves the problem of cross-end data processing in the prior art, and improves the convenience and consistency of data processing sex.

CN115118714BActive Publication Date: 2024-12-03GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210730081.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-24
Publication Date
2024-12-03
Estimated Expiration
2042-06-24

AI Technical Summary

Technical Problem

The prior art is difficult to realize cross-end data processing between multiple terminal devices, and data edited by users on one device cannot be synchronized to other devices in real time.

Method used

By establishing a wireless communication connection between multiple devices, the analysis and communication modules are used to parse and send edit operation data on one device to other devices, so that the file data on multiple devices remains consistent without server intervention.

Benefits of technology

Real-time sharing and editing and synchronization of file data between multiple devices is realized. The content edited by users on one device can automatically act on other devices without repeated editing operations, which improves the convenience and consistency of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115118714B_ABST
    Figure CN115118714B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a data sharing method, system and apparatus, terminal device and storage medium, the method comprising: a first device modifies a first file in response to a first editing operation; the first device parses the data indicated to be modified in the first file by the first editing operation to obtain first shared data; there is a wireless communication connection between the first device and the second device, and the first device and the second device are in the same local network; the first device sends the first shared data to the second device based on the wireless communication connection with the second device, and the second device modifies the second file according to the first shared data, so that the first file is consistent with the second file. By implementing the embodiment of the present application, file data can be shared on multiple devices to facilitate cross-end processing of files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and specifically to a data sharing method, system and apparatus, terminal equipment and storage medium. Background Art

[0002] Currently, users can edit data at any time on terminal devices such as smartphones and personal computers. For example, most smartphones, smart tablets and other terminal devices are equipped with note-taking applications such as sticky notes. Users can create, edit and delete notes through the sticky note application to edit the note data. However, in practice, it is found that most terminal devices currently only support data editing on a single device, making it difficult to achieve cross-terminal data processing between multiple devices. Summary of the invention

[0003] The embodiments of the present application disclose a data sharing method, system and apparatus, terminal device and storage medium, which can share file data on multiple devices to facilitate cross-terminal processing of files.

[0004] An embodiment of the present application discloses a data sharing method, which is applied to a first device, wherein a wireless communication connection exists between the first device and the second device, and the first device and the second device are in the same local network; the method comprises: modifying a first file in response to a first editing operation; parsing data indicated to be modified in the first file by the first editing operation to obtain first shared data; and sending the first shared data to the second device based on the wireless communication connection, so that the second device modifies the second file according to the first shared data, so that the second file remains consistent with the first file.

[0005] An embodiment of the present application discloses a data sharing method, which is applied to a second device, where a wireless communication connection is established between the second device and the first device, and the first device and the second device are in the same local network; the method comprises: receiving first shared data sent by the first device based on the wireless communication connection; the first shared data is obtained by the first device parsing data indicated for modification in a first file by a first editing operation; and modifying the second file according to the first shared data so that the second file is consistent with the first file.

[0006] An embodiment of the present application discloses a data sharing system, including: a first device and a second device; a wireless communication connection exists between the first device and the second device, and the first device and the second device are in the same local network; the first device is used to modify a first file in response to a first editing operation; the first device is also used to parse the data indicated to be modified in the first file by the first editing operation to obtain first shared data; the first device is also used to send the first shared data to the second device based on the wireless communication connection; the second device is used to receive the first shared data sent by the first device, and modify the second file according to the first shared data, so that the second file is consistent with the first file.

[0007] An embodiment of the present application discloses a data sharing device, which is applied to a first device; there is a wireless communication connection between the first device and the second device, and the first device and the second device are in the same local network; the device includes: a first modification module, which is used to modify a first file in response to a first editing operation; a parsing module, which is used to parse the data indicated to be modified in the first file by the first editing operation to obtain first shared data; and a communication module, which is used to send the first shared data to the second device based on the wireless communication connection, so that the second device modifies the second file according to the first shared data, so that the second file is consistent with the first file.

[0008] An embodiment of the present application discloses a data sharing device, which is applied to a second device; there is a wireless communication connection between the second device and the first device, and the first device and the second device are in the same local network; the device includes: a transceiver module, which is used to receive first shared data sent by the first device based on the wireless communication connection; the first shared data is obtained by the first device parsing the data indicated to be modified in the first file by the first editing operation; a second modification module is used to modify the second file according to the first shared data, so that the second file is consistent with the first file.

[0009] An embodiment of the present application discloses a terminal device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements any one of the data sharing methods disclosed in the embodiment of the present application.

[0010] An embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, any one of the data sharing methods disclosed in the embodiment of the present application is implemented.

[0011] Compared with the related art, the embodiments of the present application have the following beneficial effects:

[0012] The first device modifies the first file in response to the first editing operation. In addition, the first device can parse the data indicated to be modified in the first file by the first editing operation to obtain the first shared data. The first device and the second device are in the same local network, and the first device can send the first shared data to the second device based on the wireless communication connection between the first device and the second device. After receiving the first shared data, the second device can modify the second file according to the first shared data so that the second file is consistent with the first file. It can be seen that by implementing the embodiment of the present application, file data can be shared on multiple devices, and the user's modification of the first file can not only act on the second file, but also on the second file on the second device, and the file can be processed across terminals without repeating the editing operation on the second device again. In addition, based on the wireless communication connection between the first device 110 and the second device 120, the first device can directly share part or all of the data of the file to the second device without the intervention of a third-party device such as a server. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0014] Figure 1 is a structural schematic diagram of a data sharing system disclosed in an embodiment;

[0015] Figure 2 is a software design architecture diagram of a terminal device disclosed in an embodiment;

[0016] Figure 3 is a flowchart of a method for creating a new note disclosed in an embodiment;

[0017] Figure 4 is a method flow diagram of a data sharing method disclosed in an embodiment;

[0018] Figure 5 is a method flow diagram of another data sharing method disclosed in an embodiment;

[0019] Figure 6 is a method flow diagram of another data sharing method disclosed in an embodiment;

[0020] Fig. 7AA schematic diagram of a method for establishing a Websocket connection based on WiFi P2P disclosed in an embodiment;

[0021] Figure 7B is a flowchart of a method for establishing a Websocket connection based on NSD disclosed in an embodiment;

[0022] Figure 8 is a structural schematic diagram of a data sharing system disclosed in an embodiment;

[0023] Fig. 9 is a structural schematic diagram of a data sharing device disclosed in an embodiment;

[0024] Fig.10 is a structural schematic diagram of another data sharing device disclosed in an embodiment;

[0025] Fig.11 The present invention is a schematic diagram of the structure of a terminal device disclosed in an embodiment. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0027] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.

[0028] The embodiments of the present application disclose a data sharing method, system and apparatus, terminal device and storage medium, which can share file data on multiple devices to facilitate cross-terminal processing of files. Detailed descriptions are given below.

[0029] First, the data sharing system disclosed in the embodiment of the present application is described. Figure 1 , Figure 1 FIG. 1 is a schematic diagram of a data sharing system disclosed in an embodiment. Figure 1As shown, the data sharing system may include at least two terminal devices, namely, a first device 110 and a second device 120. The first device 110 and the second device 120 may be any terminal device, and the device types of the first device 110 and the second device 120 may be the same or different, without specific limitation. Exemplarily, the first device 110 and the second device 120 may be two different smart phones; or, the first device 110 may be a smart phone, and the second device 120 may be a smart tablet, without specific limitation.

[0030] There is a wireless communication connection between the first device 110 and the second device 120, and they are in the same local network. In the embodiment of the present application, the first device 110 can parse the file and obtain part or all of the data of the file as shared data. The file can be any data file, such as a note file, a text document file (word document), a presentation document file (PowerPoint document), etc., without specific limitation.

[0031] The first device 110 may send the shared data to the second device 120 based on the wireless communication connection between the first device 110 and the second device 120, so that the second device 120 processes the shared data. The processing of the shared data by the second device 120 may include but is not limited to: at least one of saving, displaying, and editing.

[0032] Based on the wireless communication connection between the first device 110 and the second device 120, the first device 110 can directly share part or all of the file data to the second device 120 without the intervention of a third-party device such as a server, and the second device 120 can process the received shared data, so that the file data can be shared on multiple devices to facilitate cross-end processing of the file.

[0033] It should be noted that the data sharing system may include three or more terminal devices, each of which may establish a wireless communication connection with one or more other terminal devices, and each of which may send the shared data parsed from the file to one or more other terminal devices based on the one or more wireless communication connections. For ease of description, the following content is described by taking the data sharing between the first device 110 and the second device 120 as an example.

[0034] Optionally, the wireless communication connection between the first device 110 and the second device 120 may include a Websocket connection. That is, data transmission can be directly performed between the first device 110 and the second device 120 based on the Websocket connection. Websocket is an application layer protocol, which is a protocol that can perform full-duplex communication on a single TCP connection. In a Websocket connection, the client and the server only need to complete a handshake once, and a persistent connection can be directly created between the two, and two-way data transmission can be performed, which can better save server resources and bandwidth and achieve real-time communication.

[0035] In the embodiment of the present application, the roles of the first device 110 and the second device 120 in the Websocket connection are not limited. The first device 110 can be a client and the second device 120 can be a server; or, the first device 110 can be a server and the second device 120 can be a client.

[0036] In some embodiments, the Websocket connection can be established based on a wireless direct connection (WiFi Peer to Peer, WiFi P2P) between the first device 110 and the second device 120. The first device 110 and the second device 120 form a peer-to-peer network based on the Wi-Fi P2P connection, which is equivalent to building a physical communication channel between the first device 110 and the second device 120. In other words, the same local network in which the first device 110 and the second device 120 are located may include a peer-to-peer network based on a Wi-Fi P2P connection. On the basis of the Wi-Fi P2P connection, the first device 110 can establish a Websocket connection with the second device 120.

[0037] WiFi P2P is a technology based on WiFi technology that directly connects devices to each other, and can achieve one-to-one or one-to-many communication without the help of a hotspot (Access Point, AP). Any one of the first device 110 and the second device 120 can be a group owner (Group Owner, GO) in the WiFi P2P connection, and the other device can be a group client (Group Client, GC) in the WiFi P2P connection. For example, the first device can be a GO end or a GC end, and there is no specific limitation.

[0038] Among them, any one of the first device 110 and the second device 120 can obtain the connection information of the other device, such as the MAC address, IP address, port information, and device name, to establish a Wi-Fi P2P connection with the other device through the obtained connection information. For example, the first device 110 can obtain the second connection information, such as the MAC address, IP address, port information, and device name of the second device 120, and initiate a Wi-Fi P2P connection with the second device 120 according to the second connection information. Alternatively, the second device 120 can obtain the first connection information, such as the MAC address, IP address, port information, and device name of the first device 110, and initiate a Wi-Fi P2P connection with the first device 110 according to the first connection information.

[0039] In other embodiments, the Websocket connection may be established based on the local area network joined by the first device 110 and the second device 120. The first device 110 and the second device 120 may be in the same local area network, and the first device 110 and the second device 120 may search for other terminal devices in the same local area network and registered with the same network service through Network Service Discovery (NSD). For example, the first device 110 and the second device 120 may respectively register the same network service with the local area network, and the network service registered by the first device 110 is called the first network service, and the network service registered by the second device 120 is called the second network service. The first device 110 may register the first network service with the local area network, and the second device 120 may search for the first network service, obtain the first connection information such as the MAC address, IP address, port information, and device name of the first device 110 by parsing the first network service, and establish a Websocket connection with the first device based on the first connection information. Alternatively, the first device 110 can actively search for the second device 120 that has registered the second network service in the local area network, obtain the second connection information of the second device such as MAC address, IP address, port information, device name, etc. by parsing the second network service, and establish a Websocket connection with the second device 120 based on the second connection information.

[0040] Any one of the first device 110 and the second device 120 may be a server of the NSD, and the other device may be a client of the NSD. For example, the first device may be a server of the NSD, or may be a client of the NSD, and the specific details are not limited.

[0041] See also Figure 2 , Figure 2 The present invention is a software design architecture diagram of a terminal device disclosed in an embodiment. Figure 2 The software design architecture shown can be applied to the first device or the second device, without specific limitation.

[0042] Taking the file including the note file as an example, the terminal device can be based on Figure 2 The software design architecture shown executes the data sharing method disclosed in the embodiment of the present application.

[0043] like Figure 2 As shown, the human-computer interaction interface of the terminal device at the business layer may include: a note list page 21 and a note editing interface 22.

[0044] The note list page 21 can be used to display one or more note files that have been created; the note editing interface 22 can be used to display and edit the content of a note file. Users can enter editing operations in the note editing interface to insert, delete, and other editing operations on the note content data.

[0045] The note list page 21 and the note editing interface 22 may be a human-computer interaction interface included in a note application, wherein the note application may include: notes, memos, reminders, etc., which are not specifically limited.

[0046] Please continue reading Figure 2 , the capabilities implemented by the terminal device at the business layer may include: connection capabilities and basic note capabilities.

[0047] The connection capability can be used to establish a Websocket connection between different terminal devices. The connection capability may include the following modules: a Socket connection module 23 , a WiFi P2P connection module 24 and / or a local area network service discovery NSD module 25 .

[0048] The socket connection module 23 can be used to establish a Websocket connection and manage data transmission operations based on the Websocket connection. The socket connection module 23 can include: a socket server management module 231 and a socket client management module 232.

[0049] The WiFi P2P connection module 24 may be used to establish a WiFi P2P connection and manage data transmission operations based on the WiFi P2P connection. The WiFi P2P connection module 24 may include: a graphic code generation module 241 , a graphic code scanning module 242 , a GO management module 243 and a GC management module 244 .

[0050] The graphic code generation module 241 may be used to generate a graphic code including one or more connection information such as the MAC address, IP address, port information, and device name of the terminal device.

[0051] The graphic code scanning module 242 may be used to scan the graphic code output by other terminal devices and read the connection information included in the graphic code output by other terminal devices.

[0052] The GO management module 243 may be used to execute operations corresponding to the GO terminal device when the terminal device serves as the GO terminal of the WiFi P2P connection.

[0053] The GC management module 244 may be used to execute operations corresponding to the GC terminal device when the terminal device serves as the GC terminal of the WiFi P2P connection.

[0054] The NSD module 25 may be used to perform NSD-related operations, including but not limited to: joining a local area network, registering a network service with the local area network, searching for devices within the local area network, searching for network services registered within the local area network, etc.

[0055] Please continue reading Figure 2 ,In order to realize the data sharing function of the note files, the terminal ,device may include basic note capabilities in addition to ,connection capabilities.

[0056] The basic note capability can be used to perform operations related to note files, including but not limited to: creating, editing, deleting, etc. The basic note capability can include the following three modules: a database 26 , a rich text module 27 , and a drawing module 28 .

[0057] The database 26 can be used to store data of the note file. The data of the note file may include: rich text data and drawing data. The rich text data may include text data and image data. The image data may include computer images such as photos, screenshots, and network images, and the drawing data may include hand-drawn images input by the user through finger touch input, smart pen input, or mouse input.

[0058] The rich text module 27 can be used to display and edit rich text data. Among them, the note editing interface may include a text control and an image control. The rich text module can display and edit text data through a text control, and display and edit image data through an image control. For example, the text control can be an input box (TextView), and the image control can be an image view (ImageView).

[0059] For example, the text control and the picture control can be implemented by embedding a web view (WebView) in a custom scroll bar view (ScrollView). The ScrollView is composed of multiple WebViews, and the note file can be modified by editing the WebView.

[0060] The drawing module 28 can be used to display and edit drawing data. The note editing interface may include a drawing control. The drawing module can display and edit drawing data through the drawing control.

[0061] Exemplarily, the drawing control can be implemented through a custom view. In the custom view, the sliding coordinate points triggered by the drawing input operation input by the user through fingers, smart pens and mice can be used to identify the sliding coordinate points, and the position of each sliding coordinate point can be represented by the position coordinates of the sliding coordinate point on the display screen of the terminal device. For example, the TouchGestureDetector method in the Android system can be used to identify multiple sliding coordinate points triggered by the user's fingers. After identifying multiple sliding coordinates, a drawing graphic can be generated based on multiple sliding coordinate points. For example, the Path class provided by the Android system can be used to generate a drawing graphic based on multiple active coordinate points. The Path class can support the drawing of various graphics such as Bezier curves. The drawing graphics are written in the custom view corresponding to the drawing control, so that the user's graffiti or hand-drawn text can be drawn.

[0062] The user of the terminal device can modify the data of the note file by inputting editing operations on one or more controls among the text control, the picture control and the drawing control.

[0063] For example, see Figure 3 , Figure 3 This is a flowchart of a method for creating a new note disclosed in an embodiment. Figure 3 It can be applied to any terminal device, such as the first device or the second device. Figure 3 As shown, the following steps may be included:

[0064] 310. The rich text module initializes the rich text view.

[0065] 312. The rich text module modifies the text data included in the text control in response to the text editing operation.

[0066] Exemplarily, the terminal device may call the EditText.setText method to modify the text data included in the text control.

[0067] 314. In response to the picture insertion operation, the rich text module pulls up a picture selector and selects a target picture indicated by the picture insertion operation from the picture selections.

[0068] 316. The image selector returns a list of uniform resource locators of target images to the rich text module.

[0069] The Uniform Resource Locator (URL) list of the target image can be used to indicate the resource location and access method of the target image.

[0070] 318. The rich text module loads the target image in the image control indicated by the image insertion operation.

[0071] 320. In response to the exit operation, the rich text module sends the data document of the note to the database for storage. The exit operation is used to exit the note editing interface.

[0072] Execute as Figure 3 According to the method shown, the terminal device can create a new note file including text data and image data on the note editing interface.

[0073] It should be noted that when the files include text documents, presentation documents and other types of files, the terminal device may have the corresponding basic file capabilities and can create, edit, delete and other operations on the files, which will not be repeated in the following content.

[0074] Based on the data sharing system disclosed in the above embodiments, and the software design architecture of the terminal device. Figure 4 , Figure 4 The present invention is a flowchart of a data sharing method disclosed in an embodiment.

[0075] It should be noted that any one of the first device and the second device can initiate data sharing, and the device initiating data sharing can parse the file stored or displayed on the device to obtain the shared data content. For ease of description, the following content is described with the first device as the data sharing initiator.

[0076] like Figure 4 As shown, the following steps may be included:

[0077] 410. The first device modifies the first file in response to the first editing operation.

[0078] The first file may be any file called by the first device, including but not limited to a note file. The first editing operation may be input by a user. Exemplarily, the user may input the first editing operation in the first editing interface, and the first editing interface may be used to display the first file. Exemplarily, if the first file is a note file, the first editing interface may be the aforementioned note editing interface. It should be noted that if the first file includes multiple file pages, the first editing interface may display one or more file pages at the same time. For example, the user may reduce the display ratio of each file page of the first editing interface by adjusting the ratio adjustment operation of the interface thumbnail ratio, so that the first editing interface can display multiple file pages at the same time.

[0079] The first file may be a newly created blank file, or may be a historical file retrieved from file data stored in a database of the first device, and is not specifically limited.

[0080] The operation type of the first editing operation may include a content editing operation. The content editing operation may be used to modify the content data in the first file, such as inserting or deleting one or more data such as text data, picture data, and drawing data.

[0081] In addition, the operation type of the first editing operation may further include a format editing operation.

[0082] The format editing operation can be used to modify the display attribute tag of the content data in the first file, such as the text font, text color, alignment attribute, text display position, etc. of the text data; the image size, image display position, etc. of the image data. Exemplarily, the first file can be displayed in the hypertext markup language HTML format, and the display attribute tag can be an attribute tag in the HTML format.

[0083] In one embodiment, the user may input a first editing operation in the first editing interface. The first note editing interface may include one or more first controls, and the multiple first controls may include: a first text control, a first picture control, and a first drawing control; different types of first controls may be used to display and edit data of corresponding types. The first text control may be used to display and edit text data, the first picture control may be used to display and edit picture data, and the first drawing control may be used to display and edit drawing data.

[0084] The first device may modify the first file on the data sharing initiator side in response to the first editing operation, for example, inserting text data "This is an example" into the first file, or inserting a target image selected by the user into the first file.

[0085] 420. The first device parses the data indicated to be modified in the first file by the first editing operation to obtain first shared data.

[0086] The first shared data may include at least: content data modified by the first editing operation instruction and / or a display attribute label modified by the first editing operation instruction, which may be determined according to the operation type of the first editing operation.

[0087] The operation type of the first editing operation may include a content editing operation and a format editing operation. Optionally, if the operation type of the first editing operation is a content editing operation, the first shared data may at least include the content data modified by the first editing operation. Optionally, if the operation type of the first editing operation is a format editing operation, the first shared data may at least include a display attribute label modified by the first editing operation.

[0088] The display attribute tag may be used to identify the display attributes of the first file when it is displayed, for example, the font, color, size of the image, etc.

[0089] Optionally, if the first file is displayed on a first editing interface and the first editing operation is input on the first editing interface, step 420 may include the following steps:

[0090] A first target control that is modified by the first editing operation in the first editing interface is identified. The first target control is one of a plurality of first controls included in the first editing interface and is specified by the first editing operation.

[0091] The first target control is parsed according to the operation type of the first editing operation to obtain first shared data.

[0092] The operation type of the first editing operation is different, the specific implementation method of parsing the first target control is different, and the obtained first shared data is also different.

[0093] As an optional implementation, if the operation type of the first editing operation is a content editing operation, the first device can parse the first editing operation, the control identifier of the first target control, and the content data modified by the first editing operation in the first target control to obtain the first shared data.

[0094] Among them, the first editing operation may include at least: insertion or deletion; the control identifier of the first target control is used to mark the first target control, and may include control ID, control type and other control-related information; the content data modified in the first target control by the first editing operation is the modification object of the first editing operation.

[0095] Exemplarily, the first shared data may include {insert, ID2, "example"}. Insert corresponds to the first editing operation, ID2 is the control identifier of the first target control, and "example" is the modified content data.

[0096] As another optional implementation, if the operation type of the first editing operation is a format editing operation, the first device may parse the control identifier of the first target control and the display property label modified by the first editing operation on the first target control to obtain the first shared data.

[0097] Exemplarily, the first shared data may include {ID3, <font face="黑体">}. ID3 is the control identifier of the first target control, and "font face = "SimHei"" is the modified display property label, indicating that the text font is changed to SimHei.

[0098] 430. Send the first shared data to the second device based on the wireless communication connection.

[0099] 440. The second device modifies the second file according to the first shared data.

[0100] The second file can be a file called by the second device and corresponding to the first file.

[0101] After receiving the first shared data, the second device can parse the first shared data. If the first shared data includes the content data indicating the modification of the first edit operation, the second device can modify the second file according to the content data; if the first shared data includes the display property label indicating the modification of the first edit operation, the second device can modify the display property label of the content data in the second file according to the display property label.

[0102] After the second device modifies the second file according to the first shared data, the second file can be consistent with the modified first file, so that cross-terminal editing of files can be realized between the first device and the second device. The editing operation input by the user on the first file on the first device can act on the second file on the second device, without having to repeat the input of the editing operation on the second device again.

[0103] Exemplarily, if the first device is a smart tablet and the second device is a smart watch. Since the screen size of the smart watch is small, it is very inconvenient to edit notes, especially text editing, on the smart watch. The smart tablet can be connected to a Bluetooth keyboard, and the user can use the Bluetooth keyboard to input text data on the note (the first file) displayed on the smart tablet. The smart tablet can parse the text data input by the user to obtain the first shared data. After establishing a wireless communication connection between the smart tablet and the smart watch, the smart tablet can send the text data input by the user to the smart watch, and the smart watch can modify the note (the second file) on the watch according to the received text data, so that the user can reuse the Bluetooth keyboard of the tablet to input data in the note, improving the convenience of using the note.

[0104] Exemplarily, if the first device is a smart tablet and the second device is a smart phone, the user can create a new note as the first file on the first editing interface of the smart tablet, and record the shopping list on the note by entering the first editing operation. The smart tablet can parse the data written on the note by the first editing operation, and obtain the shopping list content written by the user as the first shared data. The smart tablet can send the first shared data to the smart phone based on the wireless communication connection between the smart phone and the smart phone. The smart phone can modify the note (second file) on the smart phone according to the received first shared data, so that the shopping list recorded on the note of the smart phone is consistent with the shopping list on the smart tablet. When shopping, the user can directly view the notes stored in the smart phone.

[0105] In some embodiments, the second device may display a second editing interface, and the second file may be displayed in the second editing interface. The second editing interface may include one or more second controls, and each second control may include at least one of a second text control, a second picture control, and a second drawing control.

[0106] Optionally, if the operation type of the first editing operation is a content editing operation, the first shared data received by the second device may include: the editing action of the first editing operation, the control identifier of the first target control, and the content data modified by the first editing operation in the first target control; the above step 440 may include the following steps:

[0107] Step 1: According to the control identifier of the first target control, determine the second target control corresponding to the first target control in the second editing interface of the second file; the first target control is displayed in the first editing interface, and the first editing interface is the same as the second editing interface.

[0108] Among them, after receiving the control identifier of the first target control, the second device can first determine whether a second control with the same control identifier as the first target control already exists in the second editing interface; if so, the control can be determined as the second target control; if not, the second device can create a new second control in the second editing interface, and associate the control identifier of the first target control with the newly created second control as the control identifier of the newly created second editing space, and determine the newly created second control as the second control.

[0109] Step 2: Edit the content data in the second target control according to the editing action of the first editing operation.

[0110] Exemplarily, if the editing action is deletion and the content data is the word "example", the second device can delete the word "example" in the second target control.

[0111] Optionally, if the operation type of the first editing operation is a format editing operation, the second shared data received by the second device may include: the control identifier of the first target control, and the display property label modified by the first editing operation on the first target control. The above step 440 may include the following steps:

[0112] Step 1: According to the control identifier of the first target control, determine a second target control corresponding to the first target control in the second editing interface of the second file.

[0113] Step 2: Display the second target control according to the display property label.

[0114] Exemplarily, if the first shared data includes {ID3, <font face="黑体">}, the second device can display the attribute tag according to the first data. <font face="黑体">, set the text font in the second target control to bold.

[0115] In the embodiment of the present application, there is no distinction between a master device and a slave device between the first device and the second device, and the device roles of the first device and the second device in the data sharing system are interchangeable.

[0116] Therefore, the first device can receive the third shared data sent by the second device, and the third shared data can be obtained by the second device parsing the data indicated to be modified in the second file by the second editing operation. After receiving the third shared data, the first device can modify the first file according to the third shared data. That is, the user can modify the first file of the first device through the second editing operation output on the second device.

[0117] In addition, in an embodiment of the present application, if the first device and the second device display the same first editing interface and the second editing interface respectively, then only the above two editing interfaces and the corresponding first file and second file can be shared between the first device and the second device, and the content displayed on the screen of the second device is not a projection of the screen of the first device. The content displayed on the screen of the second device can only have a second note page that is the same as the first editing interface displayed on the screen of the first device.

[0118] See also Figure 5 , Figure 5 This is a flow chart of another data sharing method disclosed in an embodiment. Figure 5 As shown, the method may include the following steps:

[0119] The first device modifies the first file displayed on the first editing interface in response to the first editing operation.

[0120] Three different content editing operations are described below.

[0121] Optionally, if the first editing operation includes a first text editing operation, and the first target control indicated to be modified by the first text editing operation includes a first text control, then the above step 510 may include: in response to the first text editing operation, writing the text data indicated to be modified by the first text editing operation into the first target control.

[0122] Optionally, if the first editing operation includes a first picture inserting operation, and the first target control indicated to be modified by the first picture inserting operation includes a first picture control, then the above step 510 may include: in response to the first picture inserting operation, obtaining the target picture indicated by the first picture inserting operation from a picture selector, and loading the target picture in the first target control. The picture selector may be a database storing one or more pictures.

[0123] Optionally, if the first editing operation includes a first drawing input operation, and the first image insertion operation indicates that the first target control to be modified includes a first drawing control, then the above step 510 may include: in response to the first drawing input operation, identifying multiple sliding coordinate points triggered by the first drawing input operation; generating a drawing graphic based on the multiple sliding coordinate points; and writing the drawing graphic to the first target control.

[0124] 512. The first device detects whether the second device displays the same editing interface as the first device; if not, execute step 514; if yes, execute step 520.

[0125] The first device may display a first editing interface, and the second note page may be an editing interface that is the same as the first editing interface. That is, in step 512, the first device may detect whether the second device displays the second editing interface.

[0126] In some embodiments, the two editing interfaces are identical, which may include that the two editing interfaces are identical, for example, the color, area, number, type, arrangement position of controls included in the editing interfaces, content data included in each control, and other parameters of the two editing interfaces are the same.

[0127] In other embodiments, the two editing interfaces are identical, and may include the same parameters substantially related to the file content, such as the number and type of controls of the two editing interfaces, the content data included in each control, etc., while the parameters not substantially related to the file content, such as the color, area of ​​the editing interface, and the arrangement position of the controls included in the two editing interfaces, may be different.

[0128] Optionally, the second device can identify the page displayed by the second device in the foreground, and the file called by the page displayed in the foreground, and obtain the file identifier of the file called by the page. The second device sends page information including the above-mentioned file identifier to the first device. The first device can receive the page information sent by the second device, and can determine whether the page information includes the file identifier corresponding to the first file. If the received page information includes the file identifier corresponding to the first file, the first device can determine that the second device has displayed the second editing interface; if the received page information does not include the file identifier corresponding to the first file, the first device can determine that the second device does not display the second editing interface.

[0129] In the embodiment of the present application, different files can be distinguished by file identifiers. One of the second file and the first file can be generated based on the other file, so the second file and the first file can share the same file identifier, that is, the file identifiers of the two files can be the same.

[0130] 514. The first device parses all data of the first file to obtain second shared data.

[0131] The second device does not display the second editing interface that is the same as the first editing interface, which may include but is not limited to the following situations: the second device does not display any editing interface; or the second device has displayed an editing interface, but the second device displays a third editing interface that is different from the first editing interface, and the third editing interface is used to edit another file that is different from the first file.

[0132] In any of the above cases, the first device can parse all the data of the first file to obtain the second shared data, so as to share the first file of the first device completely to the second device. Among them, all the data of the first file can at least include: content data corresponding to each control included in the first file. Optionally, all the data of the first file can also include: display property labels corresponding to each first control included in the first editing interface.

[0133] In addition, it should be noted that the second shared data obtained after the first device parses all the data of the first file may include the data modified by the first editing operation in the first file, but is not limited thereto. In other words, the second shared data may include both the data modified by the first editing operation and the data already existing in the first file before the first device modifies the first file.

[0134] 516. The first device sends the second share to the second device based on the wireless communication connection.

[0135] The second device generates a second file according to the second shared data.

[0136] The second file generated by the second device according to the second shared data may be the same as the first file on the first device, and steps 514 to 518 may be steps corresponding to the first time file sharing data is performed between the first device and the second device.

[0137] That is to say, if the second device does not display the second editing interface at the same time, the first device can determine that the second device and the first device are sharing files for the first time, and send all data of the first file to the second device so that the second device can generate a second file identical to the first file.

[0138] After generating the second file, the second device may perform any one of the following processing on the second file: saving the second file, and displaying the second file in a second editing interface.

[0139] Among them, if the first shared data includes display property labels corresponding to each first control included in the first editing interface, the second device can generate display property labels corresponding to each second control in the second editing interface according to the display property labels corresponding to each first control, and the second file may include display property labels corresponding to each second control.

[0140] 520. The first device parses the data indicated to be modified in the first file by the first editing operation to obtain first shared data.

[0141] If the second device has displayed the same second editing interface as the first editing interface, the second device may have started data sharing with the first device, and data sharing may have been performed once or multiple times for the first file currently displayed on the first editing interface. Therefore, the first device may only parse the data indicated to be modified in the first file by the first editing operation, rather than parsing all the data of the first file, so as to reduce unnecessary computing operations and reduce the data transmission pressure of the wireless communication connection.

[0142] The implementation method of obtaining the first shared data by parsing by the first device can refer to the aforementioned embodiment, which will not be described in detail below.

[0143] 522. The first device sends the first shared data to the second device based on the wireless communication connection.

[0144] 524. The second device modifies the second file according to the first shared data.

[0145] It can be seen that in the aforementioned embodiment, the first device can determine the data range for parsing the note based on whether the second device displays the same note editing interface at the same time. If the first device and the second device have already displayed the same note editing interface, only the content data that has changed in the note can be parsed to reduce unnecessary data parsing processing and ensure the real-time synchronization of the note. If the first device and the second device do not display the same note editing interface, the first device can parse all the content data of the note to synchronize all the content data of the note completely and accurately to the second device.

[0146] For example, see Figure 6 , Figure 6 The method flow chart of another data sharing method disclosed in an embodiment is as follows. The file shared in the data sharing method is a note file. Figure 6 As shown, the first device has established a wireless communication connection with the second device; the method may include the following steps:

[0147] 610. The first device parses the image data included in the first note to obtain the image data including a list of image URLs.

[0148] In step 610, the note is displayed on a first note editing interface of the first device.

[0149] 612. The first device sends the picture URL list to the second device.

[0150] 614. The second device saves the pictures indicated by the icon URL list to a database.

[0151] 616. The second device returns a save success notification to the first device.

[0152] 618. The first device parses the text data included in the first note to obtain text data.

[0153] 620. The first device sends the text data to the second device.

[0154] In the aforementioned steps 612 to 620, the first device may preferentially parse and share the image data in the first note, and after the second device successfully saves the image data shared by the first device, the first device then parses and shares the text data in the note.

[0155] 622. The second device saves the text data to a database.

[0156] 624. The second device displays a second note on the second editing interface.

[0157] In step 624, the second device displays the note on the second note editing interface, which may include retrieving the saved image data and text data from the database to generate the second note, and then displaying the second note on the second editing interface.

[0158] Before step 624, the second editing interface is not displayed on the second device. The aforementioned steps 610 to 624 may correspond to the relay stage of the sticky note, where the first device, as the sharing initiator, shares the sticky note to the second device for the first time. In subsequent steps, the first device and the second device may simultaneously display the same editing interface.

[0159] 626. When the first device detects the first text editing operation, it parses the content data included in the first text control modified by the first text editing operation to obtain the text data modified by the first text editing operation.

[0160] 628. The first device sends the text data modified by the first text editing operation instruction to the second device.

[0161] 630. The second device writes the text data modified by the first text editing operation instruction into the corresponding second text control.

[0162] 632. When detecting the first picture editing operation, the first device parses the content data included in the first picture control indicated by the first picture editing operation to obtain the target picture indicated by the first picture editing operation.

[0163] 634. The first device sends the target image to the second device.

[0164] 636. The second device saves the target image to a database.

[0165] 638. The second device refreshes the second editing interface to load the target image into the corresponding second image control.

[0166] The aforementioned steps 624 to 636 may correspond to the cross-end synchronous editing process of the sticky note. The editing operation generated on the first device will be synchronized to the second device in real time.

[0167] In addition, the wireless communication connection between the first device and the second device is the basis for file data sharing.

[0168] In one embodiment, the first device can detect a user operation on the first file. The user operation can be any user operation related to the first file input by the user in the first device, including but not limited to: a file open operation for retrieving the first file from the database, a file create operation for creating a new first file, and the above-mentioned first editing operation. After the first device detects the user operation on the first file, it can establish a wireless communication connection between the first device and the second device in response to the user operation. In other words, when the first device detects that the user needs to operate the first file, it automatically initiates a request to establish a wireless communication connection with the second device. The user does not need to connect manually, which can reduce user operations and improve the convenience of note sharing.

[0169] The wireless communication connection established by the first device in response to a user operation may include a Websocket connection established based on a Wi-Fi P2P connection; or, may include a Websocket connection established based on an NSD.

[0170] Exemplarily, the wireless communication connection established by the first device in response to the user operation may include a Websocket connection established based on the NSD. In response to the detected user operation, the first device may search for a second device registered with the second network service in the local area network, so that the first device can establish a Websocket connection with the second device according to the second connection information parsed from the second network service.

[0171] Exemplarily, the wireless communication connection established by the first device in response to the user operation may include a Websocket connection established based on a Wi-Fi P2P connection. The first device may broadcast the first connection information of the first device via Wi-Fi in response to the user operation.

[0172] The following content will be combined Figure 2 The terminal device software architecture diagram shown in the figure illustrates the two methods of establishing Websocket connections disclosed in the embodiments of the present application.

[0173] See also Fig. 7A , Fig. 7A The present invention is a flowchart of a method for establishing a Websocket connection based on WiFi P2P disclosed in an embodiment. Fig. 7A The server side shown may be a GO side, and the client side may be a GC side. The steps performed by the server side may be performed by the WiFi P2P connection module 24 of the server side; the steps performed by the client side may be performed by the WiFi P2P connection module 24 of the client side; Fig. 7A As shown, the method may include the following steps:

[0174] 710. The server initializes the graphic code interface.

[0175] Step 710 may be executed by the graphic code generation module 241 on the server side.

[0176] 712. The server initializes the GO settings and clears the P2P group.

[0177] 714. The server creates a P2P group.

[0178] The aforementioned steps 712 to 714 may be executed by the GO management module 247 of the server side. In addition, the aforementioned steps 710 to 714 may correspond to the steps of initializing the QR code.

[0179] 716. The client requests camera permission.

[0180] 718. The client initializes the camera.

[0181] The aforementioned steps 716 to 718 may be executed by the client's graphic code scanning module 242. Furthermore, the aforementioned steps 716 to 718 may correspond to the steps of initializing the camera.

[0182] 720. The server generates a graphic code.

[0183] The aforementioned step 720 may be executed by the graphic code generation module on the server side.

[0184] In one embodiment, if the server end is the first device, the graphic code generated in step 720 may be a first graphic code, which includes first connection information such as the MAC address, IP address, port information, and device name of the first device.

[0185] In another embodiment, if the server end is a second device, the graphic code generated in step 720 may be a second graphic code, which includes second connection information such as the MAC address, IP address, port information, and device name of the second device.

[0186] 722. The client scans the graphic code.

[0187] 724. The client processes the scan results.

[0188] The aforementioned steps 722 to 724 may be executed by the graphic code scanning module 242 of the client.

[0189] In one embodiment, if the server is a first device and the client is a second device, the scan result processed by the second device in step 724 may be the first connection information read by scanning the first graphic code.

[0190] In another embodiment, if the server is the second device and the client is the first device, the scanning result processed by the first device in step 724 may be the second connection information read by scanning the second graphic code.

[0191] The aforementioned steps 720 to 724 may correspond to the steps of scanning a code.

[0192] 726. The client initializes the GC device.

[0193] 728. The server waits for P2P connection.

[0194] 730. The client starts a P2P connection.

[0195] 732. The WiFi P2P connection on the server side is established successfully.

[0196] 734. The client's WiFi P2P connection is established successfully.

[0197] The aforementioned steps 726, 730, and 734 may be executed by the GC management module 244 of the client side. The aforementioned steps 728 and 732 may be executed by the GO management module 247 of the server side.

[0198] 736. The server waits for Websocket connection.

[0199] 738. The client initiates a Websocket connection and establishes a connection with the server.

[0200] 740. The server successfully connects to the client and the Websocket connection is established successfully.

[0201] 742. The client successfully connects to the server and the Websocket connection is established successfully.

[0202] The aforementioned steps 736 and 740 may be executed by the Socket server management module 271 of the server side. The aforementioned steps 738 and 742 may be executed by the Socket client management module 272 of the client side.

[0203] Fig. 7A The method shown is that the server and the client establish a Websocket connection based on the WiFi P2P connection. The client in WiFi P2P can be the initiator of the Websocket connection, actively initiating the WebSocet connection based on the connection information parsed from the graphic code. The server in WiFi P2P can be the responder of the Websocket connection, waiting for and responding to the Websocket connection initiated by the client.

[0204] In one embodiment, if the first device is a server and the second device is a client, the first device can display a first image code, the second device can read the first connection information included in the first graphic code by scanning the first graphic code, and the second device can establish a WiFi P2P connection with the first device based on the first connection information, and establish a Websocket connection based on the WiFi P2P connection.

[0205] In one embodiment, if the first device is a client and the second device is a server, the second device can display a second graphic code, the first device can scan the second graphic code output by the second device, read the second connection information included in the second graphic code, and establish a WiFi P2P connection with the first device based on the second connection information, and establish a Websocket connection based on the WiFi P2P connection.

[0206] It should be noted that, in some other possible embodiments, the first device may also broadcast the first connection information via Wi-Fi, and the second device may establish a Wi-Fi P2P connection with the first device by monitoring the broadcasted first connection information; or, the second device may also broadcast the second connection information via Wi-Fi, and the first device may establish a Wi-Fi P2P connection with the second device by monitoring the broadcasted second connection information.

[0207] See also Figure 7B , Figure 7B The present invention is a flowchart of a method for establishing a Websocket connection based on NSD disclosed in an embodiment. Figure 7B The steps performed by the server in the method shown can be performed by the NSD module 25 of the server; the steps performed by the client can be performed by the NSD module 25 of the client; Figure 7B As shown, the method may include the following steps:

[0208] 750. The client initializes NSD.

[0209] 752. The server initializes NSD.

[0210] 754. The server registers the network service in the local area network.

[0211] 756. The client searches for devices in the local area network and finds the network services registered by the server.

[0212] 758. The client parses the server's connection information from the network service.

[0213] The aforementioned steps 750, 756 and 758 may be executed by the NSD module 25 of the client. The aforementioned steps 752 and 754 may be executed by the NSD module 25 of the server.

[0214] 760. The server waits for Websocket connection.

[0215] 762. The client initiates a Websocket connection and establishes a connection with the server.

[0216] 764. The client successfully connects to the server and the Websocket connection is established successfully.

[0217] 766. The server successfully connects to the client and the Websocket connection is established successfully.

[0218] The aforementioned steps 760 and 766 may be executed by the Socket server management module 271 of the server side. The aforementioned steps 762 and 764 may be executed by the Socket client management module 272 of the client side.

[0219] Figure 7B The method of establishing a Websocket connection between the server and the client based on NSD is shown. The client in NSD can be the initiator of the Websocket connection, actively initiating the WebSocet connection based on the connection information parsed from the network service. The server in NSD can be the responder of the Websocket connection, waiting for and responding to the Websocket connection initiated by the client.

[0220] In one embodiment, if the first device is a server and the second device is a client, the first device can execute the aforementioned steps executed by the server to register the first network service with the local area network; the first network service may include the first connection information such as the MAC address, IP address, port information, and device name of the first device. The second device can execute the aforementioned steps executed by the client. After joining the local area network, the second device can search for the first network service, obtain the first connection information of the first device by parsing the first network service, and establish a Websocket connection with the first device based on the first connection information.

[0221] In another embodiment, if the first device is a client and the second device is a server, the second device can execute the aforementioned steps executed by the server to pre-register the second network service with the local area network. The first device can execute the aforementioned steps executed by the client, the first device can join the local area network, and search for the second network service registered by the second device in the local area network. The first device can parse the second connection information such as the MAC address, IP address, port information, device name, etc. of the second device from the searched second network service, and establish a Websocket connection with the second device based on the second connection information.

[0222] In some embodiments, in order to protect the privacy and security of the user, the first device outputs a first inquiry notification for asking the user whether to allow the sharing of the first file before establishing a Websocket connection with the second device, and after detecting the sharing consent operation input by the user, establishes a Websocket connection with the second device in response to the sharing consent operation; the sharing consent operation is used to indicate that the sharing of the first file is allowed.

[0223] Optionally, before establishing a Websocket connection with the first device, the second device may also output a second inquiry notification for asking the user whether to allow receiving the first shared data shared by the first device, and when a reception consent operation is detected, the second device establishes a Websocket connection with the first device in response to the reception consent operation; the reception consent operation is used to indicate that reception of the first shared data shared by the first device is allowed.

[0224] Exemplarily, the automatic Websocket connection based on NSD may have security risks that affect user privacy due to the reduction of user operations. For example, if a Websocket connection between a first device and a second device is established based on a WiFi P2P connection, it is necessary to first establish a WiFi P2P connection by scanning a code, so the user can confirm whether to allow file sharing by whether a graphic code is displayed on the device or by whether the code is scanned. However, in the scenario of automatic Websocket connection based on NSD, the second device automatically searched by the first device may be another device that is unrelated to the user of the first device, so there is a risk of privacy leakage. At this time, the first device can output a pop-up window, which may include a first inquiry notification to ask the user whether to allow file sharing. In addition, if the second device detects a connection request initiated by the first device, it can also output a pop-up window, which may include a second inquiry notification to ask the user whether to allow receiving data shared by the first device, thereby reducing the risk of privacy leakage.

[0225] The above are two implementation methods for establishing Websocket disclosed in the embodiments of this application.

[0226] In addition, in some embodiments, in order to improve the security of data transmission based on the Websocket connection between the first device and the second device, the data transmission channel of the Websocket connection can be encrypted, and the encryption protocol may include but is not limited to: encryption using the Secure Sockets Layer Protocol (SSL protocol) and using the Transport Layer Security Protocol (TLS protocol).

[0227] Optionally, when establishing a Websocket connection, the first device may send a first verification certificate to the second device. When the second device receives the first verification certificate, it may verify whether the first verification certificate belongs to a trusted certificate database. When the second device verifies that it belongs to a trusted certificate database, it may allow the establishment of a Websocket connection between the first device and the second device. The first verification certificate and the trusted certificate database may be determined according to the encryption protocol adopted by the Websocket connection, and are not specifically limited.

[0228] For example, if the second device is the initiator of the Websocket connection, the second device can initiate the Websocket connection when verifying that the first verification certificate belongs to the trusted certificate database. If the second device is the responder of the Websocket connection, the second device can respond to the connection request and establish the Websocket connection when verifying that the first verification certificate belongs to the trusted certificate database and receiving the Websocket connection request.

[0229] Optionally, when establishing a Websocket connection, the first device receives a second verification certificate sent by the second device, and allows the establishment of a Websocket connection between the first device and the second device when verifying that the second verification certificate belongs to a trusted certificate database. The second verification certificate and the trusted certificate database can be determined based on the encryption protocol used for the Websocket connection, and are not specifically limited. As a Websocket initiator or responder, the first device performs steps similar to the steps performed by the second device when verifying that the second verification certificate belongs to a trusted certificate database, and the following content will not be repeated.

[0230] See also Figure 8 , Figure 8 The present invention is a schematic diagram of the structure of a data sharing system disclosed in an embodiment. Figure 8 The data sharing system 800 shown may include a first device 810 and a second device 820. The first device 810 and the second device 820 are connected in wireless communication and are in the same local network;

[0231] The first device 810 is configured to modify the first file in response to the first editing operation;

[0232] The first device 810 is configured to parse the data modified in the first file indicated by the first editing operation to obtain first shared data;

[0233] The first device 810 sends the first shared data to the second device based on the wireless communication connection;

[0234] The second device 820 is used to modify the second file according to the first shared data, so that the second file is consistent with the first file.

[0235] The data sharing system disclosed in the embodiment of the present application includes a first device 810 and a second device 820 which can execute the operations respectively performed by the first device and the second device in the data sharing method disclosed in the aforementioned embodiment, and the following content will not be repeated.

[0236] See also Fig. 9 , Fig. 9 The present invention is a schematic diagram of the structure of a data sharing device disclosed in an embodiment. Fig. 9 The data sharing device shown can be applied to any of the first devices mentioned above. Fig. 9 As shown, the data sharing device 900 may include: a first modification module 910 , a parsing module 920 and a communication module 930 .

[0237] A first modifying module 910, configured to modify the first file in response to a first editing operation;

[0238] A parsing module 920, configured to parse the data modified in the first file by the first editing operation to obtain first shared data;

[0239] The communication module 930 is used to send the first shared data to the second device based on the wireless communication connection, so that the second device modifies the second file according to the first shared data so that the second file is consistent with the first file.

[0240] In one embodiment, the first file is displayed on a first editing interface, and the first editing operation is input on the first editing interface.

[0241] The parsing module 920 may also be used to identify a first target control that is modified by the first editing operation in the first editing interface; and parse the first target control according to the operation type of the first editing operation to obtain first shared data.

[0242] Optionally, the operation type of the first editing operation includes: content editing operation;

[0243] The parsing module 920 may also be used to parse the first editing operation, the control identifier of the first target control, and the content data modified by the first editing operation in the first target control to obtain the first shared data.

[0244] Optionally, the operation type of the first editing operation includes: format editing operation;

[0245] The parsing module 920 may also be used to parse the control identifier of the first target control and the display property label modified by the first editing operation on the first target control to obtain the first shared data.

[0246] In one embodiment, the data sharing device 900 may further include: a detection module.

[0247] A detection module, which can be used to detect whether the second device has displayed a second editing interface; the second editing interface is the same as the first editing interface;

[0248] The parsing module 920 may also be used to parse the content data modified in the first file indicated by the first editing operation to obtain the first shared data when the detection module detects that the second device has displayed the second editing interface.

[0249] In one embodiment, the parsing module 920 may also be used to parse all data of the first file to obtain second shared data when it is detected that the second device does not display the second editing interface;

[0250] The communication module 930 may also be configured to send the second shared data to the second device based on the wireless communication connection, so that the second device generates a second file according to the second shared data.

[0251] In one embodiment, the communication module 930 may also be used to receive page information sent by the second device; the page information includes a file identifier, and the file identifier is used to indicate a file called by the page displayed in the foreground of the second device;

[0252] The detection module may also be used to determine that the second device has displayed the second editing interface when the page information includes a file identifier corresponding to the first file.

[0253] In one embodiment, the communication module 930 may also be used to receive third shared data sent by the second device; the third shared data is obtained by the second device parsing the data indicated to be modified in the second file by the second editing operation;

[0254] The first modifying module 910 may also be configured to modify the first file according to the third shared data.

[0255] In one embodiment, the detection module may also be used to detect a user operation on the first file before the first modification module modifies the first file in response to the first editing operation;

[0256] The communication module 930 may also be configured to establish a wireless communication connection between the first device and the second device in response to a user operation.

[0257] In one embodiment, the wireless communication connection includes: a Websocket connection;

[0258] The communication module 930 may also be used to establish a Websocket connection based on the wireless direct connection between the first device and the second device; or,

[0259] The communication module 930 may also be used to register the first network service with the local area network so that the second device searches for the first network service, obtains the first connection information of the first device by parsing the first network service, and establishes a Websocket connection with the first device based on the first connection information; or,

[0260] Search for a second device that has registered a second network service in the local area network, obtain second connection information of the second device by parsing the second network service, and establish a Websocket connection with the second device based on the second connection information.

[0261] Optionally, the communication module 930 may also be used to search for a second device that has registered a second network service in the local area network in response to a user operation.

[0262] In one embodiment, the communication module 930 may also be used to send a first verification certificate to the second device before establishing a Websocket connection between the first device and the second device, so that the second device establishes a Websocket connection between the first device and the second device when verifying that the first verification certificate belongs to a trusted certificate database; and / or,

[0263] A second verification certificate sent by the second device is received, and upon verifying that the second verification certificate belongs to a trusted certificate database, an operation of establishing a Websocket connection between the first device and the second device is initiated.

[0264] It can be seen that the data sharing device disclosed in the above embodiment can establish a wireless communication connection with the second device, and based on the above wireless communication connection, all or part of the file data of the first file can be shared with the second device. The editing operation input by the user on the first device for the first file can be applied to the second file on the second device, without having to repeat the editing operation on the second device, and the file can be processed across terminals.

[0265] See also Fig.10 , Fig.10 It is a schematic diagram of the structure of another data sharing device disclosed in an embodiment. Fig.10 The data sharing device shown can be applied to any of the second devices mentioned above. Fig. 9 As shown, the data sharing device 1000 may include: a transceiver module 1010 and a second modifying module 1020 .

[0266] The transceiver module 1010 is configured to receive first shared data sent by a first device based on a wireless communication connection; the first shared data is obtained by the first device parsing data indicated to be modified in the first file by a first editing operation;

[0267] The second modification module 1020 may be used to modify the second file according to the first shared data so that the first file is consistent with the second file.

[0268] In one embodiment, the first shared data includes: the first editing operation, a control identifier of the first target control, and content data modified by the first editing operation in the first target control;

[0269] The second modification module 1020 can also be used to determine a second target control corresponding to the first target control in a second editing interface of the second file according to the control identifier of the first target control; the first target control is displayed in the first editing interface, and the first editing interface is the same as the second editing interface; and according to the first editing operation, the content data is edited in the second target control

[0270] In one embodiment, the first shared data includes: a control identifier of the first target control, and a display property label modified by the first editing operation on the first target control;

[0271] The second modification module 1020 can also be used to determine a second target control corresponding to the first target control in the second editing interface of the second file according to the control identifier of the first target control; the first target control is displayed in the first editing interface, and the first editing interface is the same as the second editing interface; and the second target control is displayed according to the display property label.

[0272] In one embodiment, the data sharing device 1000 may further include: an identification module.

[0273] An identification module, which can be used to identify the page displayed on the foreground by the second device and the file called by the page displayed on the foreground, and obtain the file identifier of the file called by the page;

[0274] The transceiver module 1010 may also be used to send page information including a file identifier to the first device, so that the first device detects whether the second device has displayed the second editing interface based on the page information.

[0275] In one embodiment, the transceiver module 1010 may also be used to receive second shared data sent by the first device; the second shared data is obtained by the first device parsing all data of the first file;

[0276] The second modifying module 1020 may also be configured to generate a second file according to the second shared data.

[0277] It can be seen that any of the data sharing devices applied to the second device disclosed in the aforementioned embodiments can establish a wireless communication connection with the first device, and receive part or all of the file data sent by the first device based on the above wireless communication connection. The editing operation input by the user on the first device for the first file can be applied to the second file on the second device, without having to repeat the editing operation on the second device, and the file can be processed across terminals.

[0278] See also Fig.11 , Fig.11 FIG. 1 is a schematic diagram of the structure of a terminal device disclosed in an embodiment. Fig.11 As shown, the terminal device 1100 may include:

[0279] A memory 1110 storing executable program codes;

[0280] a processor 1120 coupled to the memory 1110;

[0281] In one embodiment, Fig.11 The terminal device shown may be any of the first devices mentioned above. Fig.11 The processor 1120 shown calls the executable program code stored in the memory 1110 to execute the steps performed by the first device in any one of the data sharing methods disclosed in the aforementioned embodiments.

[0282] In another embodiment, Fig.11 The terminal device shown may be any of the second terminals described above. Fig.11 The processor 1120 shown calls the executable program code stored in the memory 1110 to execute the steps performed by the second device in any one of the data sharing methods disclosed in the aforementioned embodiments.

[0283] It should be noted that Fig.11 The terminal device shown may also include components not shown, such as a power supply, input buttons, a camera, a speaker, a screen, an RF circuit, a Wi-Fi module, a Bluetooth module, and sensors, which are not described in detail in this embodiment.

[0284] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the steps performed by the first device in any one of the data sharing methods disclosed in the aforementioned embodiments.

[0285] An embodiment of the present application discloses another computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the steps performed by the second device in any one of the data sharing methods disclosed in the aforementioned embodiments.

[0286] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the steps performed by the first device in any one of the data sharing methods disclosed in the aforementioned embodiments.

[0287] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the steps performed by the second device in any one of the data sharing methods disclosed in the aforementioned embodiments.

[0288] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.

[0289] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0290] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0291] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0292] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.

[0293] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0294] The above is a detailed introduction to the data sharing method, system and device, terminal device and storage medium disclosed in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those of ordinary skill in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.< / font> < / font> < / font>

Claims

1. A data sharing method, characterized in that: Applied to a first device, there is a wireless communication connection between the first device and the second device, and the first device and the second device are in the same local network; the method includes: In response to the first editing operation, modifying the first file; Parsing the data modified by the first editing operation in the first file to obtain first shared data, wherein the first shared data includes the content data modified by the first editing operation and / or the display attribute label modified by the first editing operation; sending the first shared data to the second device based on the wireless communication connection, so that the second device modifies the second file according to the first shared data, so that the second file is consistent with the first file, and the first file is displayed on the first editing interface; After modifying the first file in response to the first editing operation and before parsing the data indicated to be modified in the first file by the first editing operation to obtain the first shared data, the method further includes: Detecting whether the second device has displayed a second editing interface; the second editing interface is the same as the first editing interface; And, the parsing of the content data indicated to be modified by the first editing operation in the first file to obtain the first shared data includes: When it is detected that the second device has displayed the second editing interface, the content data indicated to be modified in the first file by the first editing operation is parsed to obtain first shared data.

2. The method according to claim 1, characterized in that The first editing operation is input in a first editing interface of the first file; and the data indicated to be modified by the first editing operation in the first file is parsed to obtain the first shared data, including: identifying a first target control indicated to be modified by the first editing operation in the first editing interface; The first target control is parsed according to the operation type of the first editing operation to obtain first shared data.

3. The method according to claim 2, characterized in that The operation type includes: content editing operation; and the parsing of the first target control according to the operation type of the first editing operation to obtain the first shared data includes: Parsing the first editing operation, the control identifier of the first target control, and the content data modified by the first editing operation in the first target control to obtain first shared data; or, The operation type includes: a format editing operation; and the parsing of the first target control according to the operation type of the first editing operation to obtain the first shared data includes: The control identifier of the first target control and the display property label modified by the first editing operation on the first target control are parsed to obtain first shared data.

4. The method according to claim 1, characterized in that: After detecting whether the second device has displayed the second editing interface, the method further includes: When it is detected that the second device does not display the second editing interface, all data of the first file are parsed to obtain second shared data; The second shared data is sent to the second device based on the wireless communication connection, so that the second device generates the second file according to the second shared data.

5. The method according to claim 1, characterized in that The detecting whether the second device has displayed the second editing interface includes: receiving page information sent by the second device; the page information includes a file identifier, and the file identifier is used to indicate a file called by a page displayed in the foreground of the second device; When the page information includes the file identifier corresponding to the first file, it is determined that the second device has displayed the second editing interface.

6. The method according to claim 1, characterized in that The method further comprises: receiving third shared data sent by the second device; the third shared data is obtained by the second device parsing the data indicated to be modified in the second file by the second editing operation; The first file is modified according to the third shared data.

7. The method according to any one of claims 1 to 6, characterized in that: Before modifying the first file in response to the first editing operation, the method further includes: detecting a user operation on the first file; In response to the user operation, a wireless communication connection between the first device and the second device is established.

8. The method according to claim 1, characterized in that The wireless communication connection includes: a Websocket connection; the local network includes: a peer-to-peer network based on wireless direct connection; the Websocket connection between the first device and the second device is pre-established by the following steps: Establishing the Websocket connection based on the wireless direct connection between the first device and the second device; or, The wireless communication connection includes: a Websocket connection; the local network includes: a local area network; the Websocket connection between the first device and the second device is pre-established by the following steps: registering a first network service with the local area network so that the second device searches for the first network service, obtains first connection information of the first device by parsing the first network service, and establishes a Websocket connection with the first device based on the first connection information; or, Search for a second device that has registered a second network service in the local area network, obtain second connection information of the second device by parsing the second network service, and establish a Websocket connection with the second device based on the second connection information.

9. The method according to claim 8, characterized in that Before establishing a Websocket connection between the first device and the second device, the method further includes: sending a first verification certificate to the second device, so that the second device establishes a Websocket connection between the first device and the second device when verifying that the first verification certificate belongs to a trusted certificate database; and / or, A second verification certificate sent by the second device is received, and upon verifying that the second verification certificate belongs to a trusted certificate database, a step of establishing a Websocket connection between the first device and the second device is entered.

10. The method according to claim 8, characterized in that The searching for a second device registered with a second network service in the local area network includes: detecting a user operation on the first file; In response to the user operation, searching for a second device registered with a second network service in the local area network.

11. A data sharing method, characterized in that: Applied to a second device; there is a wireless communication connection between the second device and the first device, and the first device and the second device are in the same local network; the method includes: receiving first shared data sent by the first device based on the wireless communication connection; the first shared data is obtained by the first device parsing data indicated to be modified by the first editing operation in the first file, and the first shared data includes content data indicated to be modified by the first editing operation and / or a display attribute label indicated to be modified by the first editing operation; Modify the second file according to the first shared data so that the second file is consistent with the first file; Before receiving the first shared data sent by the first device based on the wireless communication connection, the method further includes: Identify the page displayed in the foreground by the second device and the file called by the page displayed in the foreground, and obtain the file identifier of the file called by the page; Sending page information including the file identifier to the first device so that the first device detects whether the second device has displayed a second editing interface according to the page information; the second editing interface is the same as the first editing interface; the first file is displayed on the first editing interface.

12. The method according to claim 11, characterized in that The first shared data includes: the first editing operation, a control identifier of a first target control, and content data modified in the first target control by the first editing operation; and modifying the second file according to the first shared data includes: According to the control identifier of the first target control, determining a second target control corresponding to the first target control in a second editing interface of a second file; the first target control is displayed in a first editing interface, and the first editing interface is the same as the second editing interface; According to the first editing operation, the content data is edited in the second target control.

13. The method according to claim 11, characterized in that The first shared data includes: a control identifier of a first target control, and a display property label modified by the first editing operation on the first target control; and modifying the second file according to the first shared data includes: According to the control identifier of the first target control, determining a second target control corresponding to the first target control in a second editing interface of the second file; the first target control is displayed in a first editing interface, and the first editing interface is the same as the second editing interface; The second target control is displayed according to the display attribute tag.

14. The method according to claim 11, characterized in that The method further comprises: receiving second shared data sent by the first device; the second shared data is obtained by the first device parsing all data of the first file; A second file is generated according to the second shared data.

15. A data sharing device, characterized in that: Applied to a first device; there is a wireless communication connection between the first device and the second device, and the first device and the second device are in the same local network; the apparatus comprises: A first modifying module, configured to modify the first file in response to a first editing operation; a parsing module, configured to parse the data modified by the first editing operation in the first file to obtain first shared data, wherein the first shared data includes the content data modified by the first editing operation and / or the display attribute label modified by the first editing operation; a communication module, configured to send the first shared data to the second device based on the wireless communication connection, so that the second device modifies the second file according to the first shared data, so that the second file is consistent with the first file, and the first file is displayed on the first editing interface; The parsing module is also used to detect whether the second device has displayed the second editing interface; the second editing interface is the same as the first editing interface; and when it is detected that the second device has displayed the second editing interface, the content data indicated to be modified in the first file by the first editing operation is parsed to obtain the first shared data.

16. A data sharing device, characterized in that: Applied to a second device; there is a wireless communication connection between the second device and the first device, and the first device and the second device are in the same local network; the apparatus comprises: a transceiver module, configured to receive first shared data sent by the first device based on the wireless communication connection; the first shared data is obtained by the first device parsing data indicated to be modified by the first editing operation in the first file, and the first shared data includes content data indicated to be modified by the first editing operation and / or a display attribute label indicated to be modified by the first editing operation; A second modification module, configured to modify a second file according to the first shared data so that the second file is consistent with the first file; The transceiver module is also used to identify the page displayed in the foreground by the second device, and the file called by the page displayed in the foreground, and obtain the file identifier of the file called by the page; send page information including the file identifier to the first device, so that the first device detects whether the second device has displayed the second editing interface according to the page information; the second editing interface is the same as the first editing interface; the first file is displayed on the first editing interface.

17. A terminal device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 10 or 11 to 14.

18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 or 11 to 14 is implemented.