A cross-platform data replication method and related devices

By converting the copied data into text data and storing it in a database, the problem of only simple data being copied in the prior art is solved, and the copy and pasting of cross-platform complex data is realized, which improves the efficiency and flexibility of copying and pasting.

CN114741539BActive Publication Date: 2025-06-17SHENZHEN SHANJIAN INTELLIGENT SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210449475.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-26
Publication Date
2025-06-17
Estimated Expiration
2042-04-26

AI Technical Summary

Technical Problem

The prior art can only simply copy text and images, but cannot copy complex data.

Method used

By detecting the copy instruction, the copied data is converted into text data and sent to the pre-connected database. The database returns the identifier and save it to the clipboard. When the paste instruction is detected, the identifier is sent to the database. The database returns the text data and converts it to copy data for pasting.

Benefits of technology

It realizes cross-platform complex data copying and pasting, avoids the use of copy data in device memory, and improves the efficiency and flexibility of copying and pasting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114741539B_ABST
    Figure CN114741539B_ABST
Patent Text Reader

Abstract

The present invention discloses a cross-platform data replication method and related devices. The method includes: when a replication instruction is detected, converting the replication data corresponding to the replication instruction into text data; sending the text data to a pre-connected database; when an identifier returned by the database for the text data is detected, saving the identifier to the clipboard; when a paste instruction is detected, sending the identifier to the database; when the text data returned by the database for the identifier is detected, converting the text data into the replication data according to the paste object in the paste instruction and pasting it. The present invention can achieve cross-platform copy and paste, and during the copy and paste process, as much information of the copied object as possible is retained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a cross-platform data replication method and related devices. Background Art

[0002] When using an electronic device for data processing, a common function used by users is copying. Users can copy content such as pictures and text from browser A to browser B, or from browser A to document editing software C. At the underlying logic, cross-platform data replication is achieved through copy instructions. Users can copy the content to be copied into the clipboard built into the electronic device, and then when the user enters a paste instruction, the electronic device copies the content in the clipboard to the object pointed to by the paste instruction.

[0003] In this copying method, users can only copy some types of relatively simple data, such as simple text or pictures. If the picture itself has been processed, for example, on the online document editing page of browser A, the picture is tilted at a certain angle, but when the picture is copied to the document editing page of browser B, only the normally placed image will be displayed on browser B, rather than the tilted image. Summary of the Invention

[0004] The technical problem to be solved by the present invention is that only simple text and images can be copied, and complex data cannot be copied. In view of the deficiencies of the prior art, a cross-platform data replication method and related devices are provided.

[0005] To solve the above technical problems, the technical solutions adopted by the present invention are as follows:

[0006] A cross-platform data replication method, the method comprising:

[0007] When a copy instruction is detected, convert the copy data corresponding to the copy instruction into text data;

[0008] Send the text data to a pre-connected database;

[0009] When an identifier returned by the database for the text data is detected, save the identifier to the clipboard;

[0010] When a paste instruction is detected, send the identifier to the database;

[0011] When the text data returned by the database for the identifier is detected, convert the text data into the copy data according to the paste object in the paste instruction and paste it.

[0012] Optionally, the copy instruction further includes a data type; the data type includes a picture type, a music type, and / or a video type.

[0013] Optionally, when detecting a paste instruction, sending the identifier to the database includes:

[0014] When detecting a paste instruction, determining whether the intermediate data in the clipboard conforms to a preset format template;

[0015] If so, sending the intermediate data as an identifier to the database;

[0016] If not, pasting the intermediate data according to the paste object in the paste instruction.

[0017] Optionally, when detecting the text data returned by the database for the identifier, converting the text data into the copied data and pasting according to the paste object in the paste instruction includes:

[0018] When detecting the text data returned by the database for the identifier, converting the text data according to the data type to obtain the copied data;

[0019] Pasting the copied data according to the paste object in the paste instruction.

[0020] A cross-platform data copying device, the device includes:

[0021] A conversion module, configured to convert the copied data corresponding to the copy instruction into text data when detecting a copy instruction;

[0022] A first sending module, configured to send the text data to a pre-connected database;

[0023] A copying module, configured to save the identifier to the clipboard when detecting the identifier returned by the database for the text data;

[0024] A second sending module, configured to send the identifier to the database when detecting a paste instruction;

[0025] A pasting module, configured to convert the text data into the copied data and paste according to the paste object in the paste instruction when detecting the text data returned by the database for the identifier.

[0026] Optionally, the copy instruction further includes a data type; the data type includes a picture type, a music type, and / or a video type.

[0027] Optionally, the second sending module is specifically configured to:

[0028] When a paste instruction is detected, determine whether the intermediate data in the clipboard conforms to a preset format template;

[0029] If so, send the intermediate data as an identifier to the database;

[0030] If not, paste the intermediate data according to the paste object in the paste instruction.

[0031] Optionally, the paste module is specifically configured to:

[0032] When the text data returned by the database for the identifier is detected, convert the text data according to the data type to obtain the copied data;

[0033] Paste the copied data according to the paste object in the paste instruction.

[0034] A computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in any of the cross-platform data copying methods described above.

[0035] A terminal device includes: a processor, a memory, and a communication bus; a computer-readable program executable by the processor is stored on the memory;

[0036] The communication bus realizes the connection and communication between the processor and the memory;

[0037] When the processor executes the computer-readable program, the steps in any of the cross-platform data copying methods described above are implemented.

[0038] A cross-platform data copying system includes a database and the device terminal described above. The database is communicatively connected to the device terminal. It is characterized in that the database includes a generation module;

[0039] The generation module is configured to generate an identifier corresponding to the text data according to the text data when the text data sent by the terminal device is detected.

[0040] Optionally, the generation module includes:

[0041] A generation unit is configured to generate a query identifier corresponding to the text data by using the text data as an encryption object according to a preset identification algorithm;

[0042] A writing unit is configured to write the query identifier into a preset format template to obtain an identifier corresponding to the text data.

[0043] Optionally, the format template includes a special prefix, a separator, and a replaceable identifier.

[0044] Beneficial effects: The present invention provides a cross-platform data replication method and related devices. When a user uses a certain platform and the platform detects a replication instruction, it first converts the object of the replication instruction into text data in text format. Then, the text data is sent to a database. The database stores the text data and returns an identifier. When the user needs to paste, a paste instruction is input to another platform, the identifier is found in the clipboard, and the identifier is sent to the database so that the database retrieves according to the identifier to obtain the previously stored text data. The database feeds back the text data to another platform, and the other platform that receives the text data then converts the text data into replication data and performs the paste. In this process, the content being replicated is no longer media such as pictures and music, but the data after these contents are texturized. On the one hand, the device can save more complex parameters. On the second hand, the replicated content is stored in the database rather than the clipboard, so the content on the clipboard is less and will not affect the operation of the device itself. On the third hand, replication and pasting are no longer limited to a single electronic device. If the database is a cloud database, cross-electronic device data replication and pasting can also be achieved. Description of the Drawings

[0045] Figure 1 It is a flowchart of the cross-platform data replication method provided by the present invention.

[0046] Figure 2 It is a schematic diagram of the cross-platform data replication device provided by the present invention.

[0047] Figure 3 It is a schematic structural diagram of the terminal device provided by the present invention.

[0048] Figure 4 It is a schematic structural diagram of the cross-platform data replication system provided by the present invention. Detailed Embodiments

[0049] The present invention provides a cross-platform data replication method. To make the objectives, technical solutions, and effects of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0050] Those skilled in the art of the present technology can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the" and "said" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of the present invention means the presence of the stated features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of one or more of the associated listed items.

[0051] Those skilled in the art of the present technology can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of those of ordinary skill in the art to which the present invention belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have a meaning consistent with the meaning in the context of the prior art, and will not be interpreted with an idealized or overly formal meaning unless specifically defined as here.

[0052] As Figure 1 shown, the present embodiment provides a cross-platform data replication method. For the convenience of description, a common server is used as the execution subject for description. Here, the server can be replaced by devices with data processing functions such as tablets and computers. The cross-platform data replication method includes the following steps:

[0053] S10. When a replication instruction is detected, convert the replication data corresponding to the replication instruction into text data.

[0054] Specifically, when the user uses Platform A, a replication instruction is sent to the server. The replication instruction includes the object to be replicated, that is, the replication data. Common replication instructions are such as "ctrl+c" or "command+c".

[0055] In one replication mode, the data type of the replication data is text type. The text type itself includes the text itself in the replication data, and also includes text formats, etc. After obtaining the replication instruction, convert the text, text formats, etc. of the text type into text data for recording the replication data information. For example, if the replication object is "I" with a size of 4 and a font of regular script, the converted text data is "Font: regular script, Font size: 4; Text content: I".

[0056] In another replication method, the data type of the replicated data is a media type, and the media type includes picture type, music type, and / or video type. Taking the picture type as an example, the picture type can be converted into text data of the json type. Json is a lightweight data exchange format with many advantages such as simple data format, easy to read and write, and easy to understand. Replication data of various types such as music type and video type can all be converted into text data of the json type.

[0057] S20. Send the text data to a pre-connected database.

[0058] Specifically, the server is pre-connected to a database for storing data. After obtaining the text data, the server sends the text data to this database. The database can be stored locally on the server or stored in the cloud and connected to the server through a communication connection.

[0059] After the database obtains the text data, it saves it locally and returns an identifier to the server for subsequent retrieval and invocation of the saved text data.

[0060] S30. When detecting the identifier returned by the database for the text data, save the identifier to the clipboard.

[0061] Specifically, in the conventional data copy and paste process, the replicated data selected by the user is saved to the clipboard of the device and waits for a paste instruction to send the replicated data in the clipboard to the location indicated by the paste instruction.

[0062] In this embodiment, the replicated data corresponding to the copy instruction is not stored on the clipboard but sent to the database. At the same time, when detecting the identifier returned by the database for the text data, save the identifier to the clipboard. Therefore, the content stored on the clipboard is not the replicated data itself but the identifier corresponding to the replicated data. The identifier is generally short in length, so the clipboard will not bear too much data content. Even if the size of the replicated object is very large, it will not affect the operation of the device itself.

[0063] In this embodiment, the database includes a generation module for generating an identifier, and the generation module can pre-store an identification algorithm for generating an identifier.

[0064] In a method for generating an identifier, after obtaining the text data, according to a preset identification algorithm, using the text data as the encryption object, generate a query identifier corresponding to the text data, and use the query identifier as the identifier. The identification algorithm can convert the text data into a string of a certain length and has uniqueness, thus facilitating subsequent retrieval. The identification algorithm can include encryption algorithms, UUID algorithms, etc.

[0065] In terms of generating query identifiers, the database can pre-store multiple identifier values. For each piece of text data obtained, the identifier value is associated with the text data, and the corresponding identifier value is used as the query identifier corresponding to the text data. The query identifier can include unique identifiers such as user ID, random number, current time, etc. In addition, there are various encryption algorithms that can convert the text data into a fixed-length string.

[0066] S40. When a paste instruction is detected, send the identifier to the database.

[0067] Specifically, when a paste instruction is detected, instead of directly pasting the content in the clipboard into the paste instruction in the conventional way, the identifier in the clipboard is first sent to the database. Common paste instructions are like "ctrl+v or command+v". The paste instruction and the copy instruction can come from different platforms. For example, the copy instruction is for an online document in browser A, while the paste instruction is for an online document in browser B.

[0068] Furthermore, if every time a paste instruction is detected, the content in the clipboard is sent to the database, then for data that is not copied using the above-mentioned scheme, the content in the clipboard may also be sent and queried in the database. This process will inevitably cause the database to perform unnecessary retrievals and feedback, thus reducing the speed of copy and paste. Therefore, in this embodiment, the identifier returned by the database has a specific format template.

[0069] To generate an identifier with a specific format template, in another identifier generation method, the generation module includes a generation unit and a writing unit. First, according to the identification algorithm, the generation unit uses the text data as the encryption object to generate a query identifier corresponding to the text data. Then the writing unit writes the query identifier into a preset format template to obtain an identifier corresponding to the text data. In this way, the finally obtained identifier has a specific format. The type of the format template can be freely set. Since format query judgment generally proceeds in the order from front to back, a format template provided in this embodiment includes a special prefix, a separator, and a replaceable identifier. The special prefix is used to help the server quickly determine whether it meets the condition of sending the identifier to the database. The separator is used to distinguish the special prefix and the replaceable identifier, and the replaceable identifier is the part that is replaced by the query identifier when generating the identifier.

[0070] For example, if the query identifier is "12#93e9w%¥#", the special prefix is "C", and the separator is "-", then according to the format template, the generated identifier is "C-12#93e9w%¥#".

[0071] Therefore, in the process of sending the identifier to the database, the following steps can be adopted:

[0072] A10. When a paste instruction is detected, determine whether the intermediate data in the clipboard conforms to a preset format template;

[0073] Specifically, any type of data in the clipboard is regarded as intermediate data. When a paste instruction is detected, first determine whether the intermediate data in the clipboard conforms to a preset format target, that is, the format template adopted in the previous database generation of the identifier. In the case where the special prefix is "C" and the connection symbol is "-" in the above example, it is only necessary to determine whether it satisfies "C-" before.

[0074] A20. If so, send the intermediate data as an identifier to the database.

[0075] Specifically, if it is satisfied, it means that the intermediate data is an identifier, so the intermediate data is sent to the database.

[0076] Furthermore, the server can choose to directly send the identifier to the database, and the database will later extract the query identifier in the identifier and perform a search. The server can also choose to send the query identifier in the identifier to the database after determining that the intermediate data is an identifier.

[0077] A30. If not, paste the intermediate data according to the paste object in the paste instruction.

[0078] Specifically, if not, it means that the data in the clipboard is general paste data, so the intermediate data is directly pasted according to the paste object in the paste instruction.

[0079] Based on the format judgment of the intermediate data in the clipboard, the identifiers that need to be sent to the database and the data that do not need to be sent to the database can be distinguished, thereby reducing unnecessary searches in the database and improving the speed of copy and paste.

[0080] In addition, the paste instruction and the copy instruction can come from different devices. The user sends a copy instruction in device A, and device A and device B can share the clipboard so that the user can send a paste instruction in device B to process the intermediate data in the clipboard. Device A and device B sharing the clipboard can be achieved by binding the user account to the clipboard, clipboard sharing based on a local area network, etc.

[0081] S50. When the text data returned by the database for the identifier is detected, convert the text data into the copied data and paste it according to the paste object in the paste instruction.

[0082] Specifically, after the database obtains the identifier sent by the server, it queries the locally stored data to obtain the text data corresponding to the identifier. If the database queries the text data corresponding to the identifier, it returns the text data to the server; if the database cannot query the text data corresponding to the identifier, it returns empty data to the server.

[0083] When detecting the text data returned by the database for the identifier, although the text data has the same source but different displays, the server needs to convert the text data into replicated data in its original form. Finally, according to the paste object in the paste instruction, the replicated data is pasted.

[0084] In the first replication method, the replicated data type is text type, then directly based on the text data, it is determined that the replicated data is "I" with a size of No. 4 and a font of regular script.

[0085] When the type of the original replicated data is non-text type and the data obtained from the database is text data, after obtaining the text data, it needs to be converted into replicated data. The process is as follows:

[0086] C10. According to the data type, convert the text data to obtain the replicated data;

[0087] Specifically, first, according to the data type in the replication instruction, convert the text data. For example, for the original data type being image type, convert the text data into image type data to obtain the replicated data. Taking json as an example, extract the data in json and then convert it into an image to obtain the replicated data.

[0088] C20. According to the paste object in the paste instruction, paste the replicated data.

[0089] Specifically, then according to the paste object in the paste instruction, paste the replicated data to the position indicated by the paste object.

[0090] This embodiment can convert replicated data of various different types such as picture type and music type into text data, and perform copy and paste based on the text data, thereby realizing that complex multi-type copy objects can also be copied. In addition, the replication instruction and the paste instruction can be located on different platforms, even different devices, to implement a cross-platform data replication method.

[0091] Such as Figure 2 As shown, the present invention also provides a cross-platform data replication device 100, which includes:

[0092] A conversion module 110, configured to convert the replicated data corresponding to the replication instruction into text data when detecting the replication instruction;

[0093] A first sending module 120, configured to send the text data to a pre-connected database;

[0094] A copying module 130, configured to save the identifier to the clipboard when detecting the identifier returned by the database for the text data;

[0095] A second sending module 140, configured to send the identifier to the database when detecting a paste instruction;

[0096] A pasting module 150, configured to convert the text data into the copied data and paste it according to the paste object in the paste instruction when detecting the text data returned by the database for the identifier.

[0097] Wherein, the copy instruction further includes a data type; the data type includes a picture type, a music type, and / or a video type.

[0098] Wherein, the second sending module 140 is specifically configured to:

[0099] When detecting a paste instruction, determine whether the intermediate data in the clipboard conforms to a preset format template;

[0100] If so, send the intermediate data as an identifier to the database;

[0101] If not, paste the intermediate data according to the paste object in the paste instruction.

[0102] Wherein, the pasting module 150 is specifically configured to:

[0103] When detecting the text data returned by the database for the identifier, convert the text data according to the data type to obtain the copied data;

[0104] Paste the copied data according to the paste object in the paste instruction.

[0105] Based on the above cross-platform data copying method, the present invention further provides a terminal device, such as Figure 3As shown in the figure, it includes at least one processor 20; a display screen 21; and a memory 22, and may further include a communications interface 23 and a bus 24. Among them, the processor 20, the display screen 21, the memory 22, and the communications interface 23 can complete mutual communication through the bus 24. The display screen 21 is set to display a user guidance interface preset in the initial setting mode. The communications interface 23 can transmit information. The processor 20 can call the logical commands in the memory 22 to execute the methods in the above embodiments.

[0106] In addition, when the logical commands in the above-mentioned memory 22 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.

[0107] The memory 22, as a computer-readable storage medium, can be set to store software programs and computer-executable programs, such as the program commands or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes functional applications and data processing by running the software programs, commands, or modules stored in the memory 22, that is, implements the methods in the above embodiments.

[0108] The memory 22 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 22 may include high-speed random access memory and may also include non-volatile memory. For example, various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes can also be a transient computer-readable storage medium.

[0109] In addition, the specific processes of loading and executing multiple commands in the above-mentioned computer-readable storage medium and the terminal device have been described in detail in the above methods, and will not be repeated here one by one.

[0110] As Figure 4 shown, the present invention further provides a cross-platform data replication system. The system includes a database and the device terminal described above. The database is communicatively connected to the device terminal. It is characterized in that the database includes a generation module;

[0111] The generation module is used to generate an identifier corresponding to the text data according to the text data when detecting the text data sent by the terminal device.

[0112] Among them, the generating module includes:

[0113] A generating unit, configured to generate a query identifier corresponding to the text data by using the preset identification algorithm and taking the text data as an encryption object;

[0114] A writing unit, configured to write the query identifier into a preset format template to obtain an identifier corresponding to the text data.

[0115] Among them, the format template includes a special prefix, a separator, and a replaceable identifier.

[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A cross-platform data replication method, characterized in that, The method includes: When a copy instruction is detected, converting the copy data corresponding to the copy instruction into text data; Sending the text data to a pre-connected database; When an identifier returned by the database for the text data is detected, saving the identifier to the clipboard; When a paste instruction is detected, sending the identifier to the database; When text data returned by the database for the identifier is detected, converting the text data into the copy data according to the paste object in the paste instruction and pasting it; Wherein, the copy instruction further includes a data type; the data type includes a picture type, a music type, and / or a video type, and the step of sending the identifier to the database when a paste instruction is detected includes: When a paste instruction is detected, determining whether the intermediate data in the clipboard conforms to a preset format template; If so, sending the intermediate data as an identifier to the database; If not, pasting the intermediate data according to the paste object in the paste instruction.

2. The cross-platform data replication method according to claim 1, characterized in that, The step of converting the text data into the copy data and pasting it according to the paste object in the paste instruction when text data returned by the database for the identifier is detected includes: When text data returned by the database for the identifier is detected, converting the text data according to the data type to obtain the copy data; Pasting the copy data according to the paste object in the paste instruction.

3. A cross-platform data replication device, characterized in that, The cross-platform data copying device includes: A conversion module, configured to convert the copy data corresponding to the copy instruction into text data when a copy instruction is detected; A first sending module, configured to send the text data to a pre-connected database; A copying module, configured to save the identifier to the clipboard when an identifier returned by the database for the text data is detected; A second sending module, configured to send the identifier to the database when a paste instruction is detected; A pasting module, configured to convert the text data into the copy data according to the paste object in the paste instruction and paste it when text data returned by the database for the identifier is detected; Wherein, the copy instruction further includes a data type; the data type includes a picture type, a music type, and / or a video type, and the second sending module is specifically configured to: When a paste instruction is detected, determining whether the intermediate data in the clipboard conforms to a preset format template; If so, sending the intermediate data as an identifier to the database; If not, pasting the intermediate data according to the paste object in the paste instruction.

4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the cross-platform data copying method according to any one of claims 1 to 2.

5. A terminal device, characterized in that, Including: A processor, a memory, and a communication bus; The memory stores a computer-readable program executable by the processor; The communication bus realizes connection communication between the processor and the memory; When the processor executes the computer-readable program, it implements the steps in the cross-platform data replication method described in any one of claims 1 to 2.

6. A cross-platform data replication system, the cross-platform data replication system includes a database and the device terminal according to claim 5, the database is communicatively connected to the device terminal, characterized in that, The database includes a generation module; The generation module is used to generate an identifier corresponding to the text data according to the text data when detecting the text data sent by the terminal device.

7. The cross-platform data replication system according to claim 6, characterized in that, The generation module includes: A generation unit, configured to generate a query identifier corresponding to the text data by using the text data as an encryption object according to a preset identification algorithm; A writing unit, configured to write the query identifier into a preset format template to obtain an identifier corresponding to the text data.

8. The cross-platform data replication system according to claim 6, wherein The format template includes a special prefix, a separator, and a replaceable identifier.

Citation Information

Patent Citations

  • Systems and methods for transmitting and receiving data

    WO2014048308A1