Data sharing method and device, equipment and storage medium

Through random selection of conversion rules and calculating and decoding the data, the problem of insufficient data sharing security in the prior art is solved, and a high flexibility and security data sharing method is realized.

CN119106076APending Publication Date: 2024-12-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411057932.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Existing data encoding formats such as JSON and XML are at risk of leakage during data sharing. The commonly used Base64 encoding method is easy to be cracked, making it difficult to ensure the security of the data.

Method used

The randomly selected conversion rules are used to encode and decode the shared data. Through the use of the binary conversion and the use of the discarded character set, unique character strings to be shared are generated, increasing the difficulty of cracking and improving the flexibility and security of data encoding.

Benefits of technology

Even if the same user shares the same data at different points in time, the generated strings to be shared are different, which significantly increases the difficulty of cracking, and reduces the data length through the binary conversion, improving the security and visual aesthetics of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106076A_ABST
    Figure CN119106076A_ABST
Patent Text Reader

Abstract

The invention provides a data sharing method and device, equipment and a storage medium, and relates to the technical field of data sharing. The method comprises the steps of obtaining to-be-shared data of a preset application; randomly selecting one conversion rule from a plurality of preset conversion rules in a preset data conversion rule base as a target conversion rule; encoding the to-be-shared data by adopting the target conversion rule to generate a data character string of the to-be-shared data; and generating a to-be-shared character string corresponding to the to-be-shared data according to the version information of the target conversion rule and the data character string. By adopting the method provided by the invention, one conversion rule is randomly selected as the target conversion rule, so that even if the same user shares the same data at different time points, the generated to-be-shared character strings are different, and the cracking difficulty is greatly increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data sharing, and in particular to a data sharing method, apparatus, device and storage medium. Background Art

[0002] With the development of informatization, data sharing is becoming more and more important. Data sharing allows users to read other people's data and perform various operations, calculations and analyses. When sharing data, the data needs to be encoded so that users can adopt the prescribed data standards as much as possible.

[0003] Existing data encoding formats, such as JSON (JavaScript Object Notation) and XML (Extensible Markup Language), display data intuitively, which brings the risk of data leakage. Therefore, the encoded string needs to be encrypted. However, the currently commonly used encryption methods, such as Base64 encoding, are simple and easy to be cracked. Summary of the invention

[0004] In view of the deficiencies in the above-mentioned prior art, the present application provides a data sharing method, device, equipment and storage medium to solve the problems existing in the prior art.

[0005] The technical solution adopted in the embodiment of the present application is as follows:

[0006] In a first aspect, an embodiment of the present application provides a data sharing method, the method comprising:

[0007] Get the data to be shared of the preset application;

[0008] Randomly select a conversion rule from multiple preset conversion rules in a preset data conversion rule library as a target conversion rule;

[0009] The target conversion rule is adopted to encode the data to be shared, and a data string of the data to be shared is generated;

[0010] A character string to be shared corresponding to the data to be shared is generated according to the version information of the target conversion rule and the data character string.

[0011] In a second aspect, an embodiment of the present application provides a data sharing method, the method comprising:

[0012] Get the shared string for the preset application;

[0013] Obtaining target version information and target data string from the shared string;

[0014] According to the target version information, determining a target conversion rule corresponding to the target version information from a plurality of preset conversion rules in a preset data conversion rule library;

[0015] The target data string is decoded using the target conversion rule to obtain original data corresponding to the shared string.

[0016] In a third aspect, an embodiment of the present application provides a data sharing device, the method comprising:

[0017] A first acquisition module, used to acquire the to-be-shared data of a preset application;

[0018] A selection module, used to randomly select a conversion rule as a target conversion rule from a plurality of preset conversion rules in a preset data conversion rule library;

[0019] An encoding module, used to encode the data to be shared by adopting the target conversion rule to generate a data string of the data to be shared;

[0020] A generating module is used to generate a character string to be shared corresponding to the data to be shared according to the version information of the target conversion rule and the data character string.

[0021] In a fourth aspect, an embodiment of the present application provides a data sharing device, the method comprising:

[0022] A second acquisition module, used to acquire a shared character string for a preset application;

[0023] A parsing module, used for obtaining target version information and target data string from the shared string;

[0024] A determination module, configured to determine, according to the target version information, a target conversion rule corresponding to the target version information from a plurality of preset conversion rules in a preset data conversion rule library;

[0025] A decoding module is used to decode the target data string using the target conversion rule to obtain original data corresponding to the shared string.

[0026] In a fifth aspect, an embodiment of the present application provides a client device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the client device is running, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to implement the data sharing method described in any of the above embodiments.

[0027] In a sixth aspect, an embodiment of the present application provides a readable storage medium, on which program instructions are stored, and when the program instructions are executed by a processor, the data sharing method described in any of the above embodiments is implemented.

[0028] The beneficial effects of this application are:

[0029] The present application provides a data sharing method, which includes obtaining data to be shared of a preset application; randomly selecting a conversion rule as a target conversion rule from multiple preset conversion rules in a preset data conversion rule library; using the target conversion rule to encode the data to be shared and generate a data string of the data to be shared; and generating a character string to be shared corresponding to the data to be shared based on version information of the target conversion rule and the data string.

[0030] When using the method of the present application, when sharing data, a conversion rule is randomly selected as the target conversion rule, and the target conversion rule is used to encode the shared data. Even if the same user shares the same data at different time points, the generated shared character strings are different, which greatly increases the difficulty of cracking. In addition, random selection also provides higher flexibility for data encoding. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 One of the flow charts of the data sharing method provided in the embodiment of the present application;

[0033] Figure 2 The second flowchart of the data sharing method provided in the embodiment of the present application;

[0034] Figure 3 The third flowchart of the data sharing method provided in the embodiment of the present application;

[0035] Figure 4 A fourth flowchart of the data sharing method provided in an embodiment of the present application;

[0036] Figure 5 The fifth flowchart of the data sharing method provided in the embodiment of the present application;

[0037] Figure 6 Flow chart of the data sharing method provided in the embodiment of the present application is as follows;

[0038] Figure 7 Flow chart of the data sharing method provided in the embodiment of the present application is shown in FIG7;

[0039] Figure 8 8. Flow chart of the data sharing method provided in the embodiment of the present application;

[0040] Fig. 9 A schematic diagram of the structure of a data sharing device provided in an embodiment of the present application;

[0041] Fig.10 A schematic diagram of the structure of a data sharing device provided in another embodiment of the present application;

[0042] Fig.11 A schematic diagram of the structure of a client device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings 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.

[0044] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0045] In addition, the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0046] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.

[0047] In the information technology era, data sharing is an important area. Data sharing refers to the process of sharing and accessing data between organizations, systems or applications. Generally, data in a specific format is used as a carrier to complete data sharing. Common data formats in the software industry include JSON (JavaScript Object Notation) and XML (Extensible Markup Language). These data formats have become industry standards and are used for data transmission and sharing between different systems.

[0048] Data sharing simply means sharing a user's data with other users. When sharing data, if there is a need for confidentiality, the data needs to be encrypted. A common encryption method is to use Base64 encoding to encode the data twice. However, the encoding process of the string generated after Base64 encoding is completely reversible and can be easily cracked.

[0049] In response to the above problems, an embodiment of the present application provides a data sharing method, which can be generated by any client device with computing and processing capabilities. The client device can be, for example, a terminal-oriented client device.

[0050] The data sharing method provided by the present application is specifically described below through multiple examples in conjunction with the accompanying drawings.

[0051] Figure 1 One of the flow diagrams of the data sharing method provided in the embodiment of the present application is applied to a client device of a first user, wherein the first user is the sender of the shared data, such as Figure 1 As shown, the method includes:

[0052] S101: Obtain data to be shared of a preset application.

[0053] In this application, the preset application refers to the game. Data sharing is widely used in games. The data to be shared can be any data in the game, including business function data in the game and user setting data in the game. The business function data can be, for example, game face-pinching data and the user setting data can be, for example, user setting data for game operations.

[0054] S102: Randomly select a conversion rule from a plurality of preset conversion rules in a preset data conversion rule library as a target conversion rule.

[0055] The preset data conversion rule library stores a plurality of different preset conversion rules, each of which corresponds to a version information, and the version information is used to indicate the specific content of the preset conversion rule, and the version information may be a version number represented by Arabic numerals.

[0056] Each preset conversion rule can be used to encode the data to be shared, so a conversion rule can be randomly selected as the target conversion rule. The data to be shared is at least one Arabic numeral represented in decimal, and each preset conversion rule can be used to encode the decimal Arabic data to generate a data string represented in 32-hexadecimal.

[0057] S103: Encode the data to be shared by adopting the target conversion rule to generate a data string of the data to be shared.

[0058] Each preset conversion rule can be used to encode Arabic data in decimal to generate a data string represented in base 32. Therefore, after obtaining the target conversion rule, the target conversion rule is used to encode the data to be shared to generate a data string represented in base 32.

[0059] S104: Generate a character string to be shared corresponding to the data to be shared according to the version information of the target conversion rule and the data character string.

[0060] After obtaining the data string of the data to be shared, a character string to be shared corresponding to the data to be shared is generated according to the version information of the target conversion rule and the data character string, so that after the recipient of the shared data receives the data string of the data to be shared, the data character string can be decoded according to the version information to obtain the data to be shared.

[0061] In summary, this embodiment provides a data sharing method. When sharing data, a conversion rule is randomly selected as a target conversion rule, and the target conversion rule is used to encode the shared data. Even if the same data is shared by the same user at different time points, the generated character strings to be shared are different, which greatly increases the difficulty of cracking. In addition, random selection also provides higher flexibility for data encoding.

[0062] Figure 2 The second flow chart of the data sharing method provided in the embodiment of the present application is as follows: Figure 2 As shown, the step S104 of generating a character string to be shared corresponding to the data to be shared according to the version information of the target conversion rule and the data character string may include:

[0063] S201. Encapsulate the version information of the target conversion rule as a header field.

[0064] The version information of the target conversion rule is encapsulated as a header field, that is, the version information is placed at the front of the string to be shared, so that after obtaining the string to be shared, the version information can be quickly obtained, the corresponding target conversion rule can be obtained according to the version information, and the shared data can be decoded according to the target conversion rule to improve decoding efficiency.

[0065] S202: Generate a character string to be shared according to the header field and the data character string.

[0066] Place the data string after the header field to generate the string to be shared.

[0067] Figure 3 The third flow chart of the data sharing method provided in one embodiment of the present application is as follows: Figure 3 As shown, the target conversion rule is adopted in S103 to encode the data to be shared and generate a data string of the data to be shared, which may include:

[0068] S301 , using a target conversion rule to encode each data to be shared, and generating a data string for each data to be shared.

[0069] There may be multiple data to be shared, and the target conversion rule can encode each data to be shared represented in decimal to generate a data character string of each data to be shared represented in 32-decimal.

[0070] Among them, taking the number 132 as an example, the representation method of the decimal number 132 is:

[0071] 1×10 2 +3×10 1 +2×10 0 =1×100+3×10+2×1=132;

[0072] The number 132 in base 10 is represented as 44 in base 32:

[0073] 4×32 1 +4×32 0 =4×32+4×1=128+4=132;

[0074] The base of 32-decimal is 32. The default standard conversion rule between decimal and 32-decimal numbers is: 0123456789ABCDEFGHIJKLMNOPQRSTUV, which represents the decimal numbers 0, 1, 2, 3, 4, ..., 28, 29, 30, 31 from left to right. For example, the representation of the 32-decimal number V2AM is:

[0075] V×32 3 +2×32 2 +A×32 1 +M×32 0 =31×32 3 +2×32 2 +10×32 1 +22×32 0 =1018198

[0076] Converting a decimal number to base 32 usually involves a series of consecutive division operations. First, we divide the decimal number by 32 and record the remainder, which will be between 0 and 31, which corresponds to 0 to V in base 32. We start this process from the highest digit until the quotient becomes zero. Then, we put all the remainders in reverse order to get the final result.

[0077] For example, the data to be shared is a decimal data set [26642,1735,8,346], which contains 4 decimal data to be shared. Through the target conversion rule, each data to be shared in this data set can be converted into Q0I, 1M7, 8, AQ represented in 32-decimal format, respectively, to obtain the data string of each data to be shared.

[0078] The pseudo code for converting a decimal number to base 32 is as follows:

[0079] Algorithm DecimalToBase32(decimalNumber)

[0080] base32Characters←

[0081] "0123456789ABCDEFGHIJKLMNOPQRSTUV"

[0082] base32Number←""

[0083] while decimalNumber>0do

[0084] quotient,remainder←divide decimalNumber by 32

[0085] base32Number←base32Characters[remainder]+base32Number

[0086] decimalNumber←quotient

[0087] end while

[0088] if base32Number is empty then

[0089] base32Number←"0"

[0090] end if

[0091] return base32Number

[0092] End Algorithm

[0093] In addition to encryption, base conversion can also significantly reduce the length of the data to be shared. For example, suppose there is a data set containing 10 decimal numbers, each of which is 666666, and the total length of these numbers is 60. However, the 32-decimal representation of 666666 is only 4 characters long, so the total length after conversion is 40, which means that the length of the number is reduced by 33%.

[0094] S302: Concatenate the data character strings of the data to be shared in a preset order to generate a target data character string.

[0095] After obtaining the data strings of each data to be shared, the data strings of each data to be shared are spliced ​​in a preset order to generate a target data string, wherein the preset order can be the initial arrangement order of each data to be shared, or it can be other orders according to user requirements. As long as all the data strings of the data to be shared can be spliced ​​together, this application does not impose any restrictions on the preset order.

[0096] For example, the target data string [Q0I, 1M7, 8, AQ] may be generated according to the initial arrangement order of the data to be shared, or the target data string [1M7, 8, Q0I, AQ] may be generated in other orders according to user requirements.

[0097] Then, in S202, generating a character string to be shared according to the header field and the data character string includes:

[0098] S303: Generate a character string to be shared according to the header field and the target data character string.

[0099] Placing the target data string after the header field will generate the string to be shared.

[0100] In one embodiment, S201 encapsulates the version information of the target conversion rule as a header field, and may also include: encapsulating the version information of the target conversion rule, the number of data to be shared, and the data layout string as a header field; the data layout string is used to indicate: the length of the data string corresponding to each data to be shared in the target data string.

[0101] In addition to the version information of the target conversion rule, the number of data to be shared and the data layout string can also be encapsulated as header fields. The data layout string is used to indicate the length of the data string corresponding to each data to be shared in the target data string.

[0102] For example, there is a decimal data set to be shared [26642,1735,8,346]. Through the target conversion rule, the target data string corresponding to the data set to be shared is obtained [Q0I,1M7,8,AQ]. Assuming that the version information of the target conversion rule is 1, the three parts of the header field are 1 (version information), 4 (the number of data to be shared in the data set) and 3312 (data layout string, representing the length of 4 numbers 3, 3, 1, 2 respectively). By concatenating the header field and the target data string, we get the shared string of the data set to be shared [26642,1735,8,346] - 143312Q0I1M78AQ.

[0103] The function of the header field is to facilitate the receiver to decode the encoded data according to the information recorded in the header field after receiving the shared data to obtain the original data before encoding.

[0104] In one embodiment, before randomly selecting a conversion rule as a target conversion rule from a plurality of preset conversion rules in a preset data conversion rule library, the method of the present application further includes: processing the preset standard conversion rule multiple times to generate a plurality of preset conversion rules.

[0105] The preset data conversion rule library stores a plurality of preset conversion rules. These preset conversion rules may be preset conversion rules generated after processing preset standard conversion rules. Multiple preset conversion rules may be obtained by performing multiple processing.

[0106] The preset standard conversion rule may be, for example, a preset standard hexadecimal conversion character set “0123456789ABCDEFGHIJKLMNOPQRSTUV”.

[0107] Processing the preset standard conversion rule multiple times to generate multiple preset conversion rules may be: performing random processing on characters in the preset standard base conversion character set multiple times to generate multiple preset base conversion character strings.

[0108] For example, based on "0123456789ABCDEFGHIJKLMNOPQRSTUV", the preset base conversion string "61QPG3ZBDH9CENWRL7FM052YT4SV8JIO" is randomly generated, and the version information is recorded as 1. The version information is recorded as 2. Repeat the above process to generate multiple preset base conversion strings, that is, multiple preset conversion rules.

[0109] After generating multiple preset conversion rules, the multiple preset conversion rules are stored in the preset data conversion rule library. When encoding the data to be shared, a preset conversion rule is randomly extracted. For example, "61QPG3ZBDH9CENWRL7FM052YT4SV8JIO" with the number 1 is extracted. Given a decimal data set to be shared [26642,1735,8,346], the extracted preset conversion rule is used to encode the data set to be shared, and the target data string [S6F,12B,D,9S] can be obtained. The header field will contain three parts: version information 1, the number of data set elements 4, and the data layout string 3312. Combining the header field with the target data string, the shared string of the data set to be shared [26642,1735,8,346] - 143312S6F12BD9S is obtained.

[0110] This embodiment performs multiple shuffle processes on the preset standard conversion rules to generate multiple preset base conversion strings, stores the multiple preset base conversion strings in a preset data conversion rule library, and randomly extracts a preset conversion rule when encoding the shared data. Compared with only using the preset standard conversion rules, this method can further improve the security of the data.

[0111] Figure 4 A fourth flowchart of a data sharing method provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, in one embodiment, the method of performing multiple shuffling processes on characters in a preset standard base conversion character set to generate multiple preset base conversion character strings may also include:

[0112] S401: Based on a preset discarded character set, a preset standard base conversion character set is supplemented to generate a reference base conversion character set.

[0113] In base 32, 32 different characters are needed to represent a numeric value. Considering that there are 36 available characters for Arabic numerals (10) and English letters (26), we actually have more characters than we need. Therefore, after selecting 32 characters to form the preset standard base conversion character set, the remaining 4 characters are classified as obsolete characters and form the obsolete character set.

[0114] The role of the abandoned character set is to improve the security of shared data encoding and increase the difficulty of cracking by potential crackers. By inserting selected abandoned characters at random positions in the preset standard base conversion character set, it can not only increase the complexity of the encoding, but also be used to fill in gaps when necessary to meet specific length requirements.

[0115] In summary, based on the preset discarded character set, the preset standard base conversion character set is padded to generate a benchmark base conversion character set. The 32-base encoding scheme of the present application includes a 32-character main character set and a 4-character discarded character set. The main character set is used for conventional base conversion, and the discarded character set is used to add additional security measures.

[0116] S402: In each out-of-order processing, a plurality of characters are randomly selected from the reference base conversion character set, and the plurality of randomly selected characters are randomly sorted to generate a preset base conversion character string.

[0117] In each disorder processing, a plurality of (32) characters are randomly selected from the reference base conversion character set (36), and the plurality of randomly selected characters are randomly sorted to generate a preset base conversion character string.

[0118] Figure 5 A fifth flow chart of a data sharing method provided in an embodiment of the present application is as follows: Figure 5 As shown, in one embodiment, the method of the present application further includes:

[0119] S501: Display the character string to be shared on the sharing interface of the preset application.

[0120] After the character string to be shared is generated, the character string to be shared may also be displayed on a sharing interface of a preset application so that the user can copy the character string to be shared.

[0121] S502: In response to a copy event for the character string to be shared, share the character string to be shared with other applications.

[0122] After the user copies the string to be shared, the user can respond to the copy event for the string to be shared and share the string to be shared with other applications. After users of other applications obtain the shared string, they can decode it to obtain the original data.

[0123] In addition, this application also provides an interface for randomly generating preset conversion rules, allowing different systems to generate a set of exclusive preset conversion rules. Specifically, this function is implemented by using the shuffle function in Python's random library to ensure that the preset conversion rules of each system are unique. When users share data through the system, as long as the system's preset conversion rules are not leaked, the risk of data being cracked can be greatly reduced, thereby enhancing data security.

[0124] In addition to the method provided in the above embodiment, the present application also provides a data sharing method applied to a client device of a second user, wherein the second user is a recipient of the shared data. Figure 6The sixth flow chart of the data sharing method provided in one embodiment of the present application is as follows: Figure 6 As shown, the method includes:

[0125] S601: Acquire a shared character string for a preset application.

[0126] After the first user shares the character string to be shared, the second user can obtain the shared character string.

[0127] S602: Obtain target version information and target data character string from the shared character string.

[0128] The shared string includes the target version information and the target data string. After the second user obtains the shared string, the target version information and the target data string can be obtained therefrom.

[0129] S603: Determine, according to the target version information, a target conversion rule corresponding to the target version information from a plurality of preset conversion rules in a preset data conversion rule library.

[0130] The preset data conversion rule library stores multiple preset conversion rules. After obtaining the target version information of the shared string, the target conversion rule corresponding to the target version information can be determined from the multiple preset conversion rules in the preset data conversion rule library according to the target version information.

[0131] S604: Use the target conversion rule to decode the target data string to obtain the original data corresponding to the shared string.

[0132] Finally, the target conversion rule is used to decode the target data string to obtain the original data corresponding to the shared string.

[0133] In this embodiment, the target conversion rule can only be determined from the preset data conversion rule library, and the target data string can only be decoded using the target conversion rule to obtain the original data, which is difficult to crack and ensures data security.

[0134] In one embodiment, if Figure 7 As shown, S602 obtains target version information and target data string from the shared string, which may include:

[0135] S701. Parse the header field of the shared string to obtain target version information.

[0136] The target version information is stored in the header field of the shared string. The target version information can be obtained by parsing the header field.

[0137] S702: parse the other fields except the header field in the shared string to obtain the target data string.

[0138] The shared string is composed of the header field and the target data string. The target data string can be obtained by parsing other fields except the header field.

[0139] In one embodiment, if Figure 8 As shown, before S604 adopts the target conversion rule to decode the target data string to obtain the original data corresponding to the shared string, the method of the present application also includes:

[0140] S801. Parse the field after the target version information in the header field to obtain the number of data and the data layout string.

[0141] The data layout character string is used to indicate: the length of the data character string corresponding to each to-be-shared data in the target data character string.

[0142] Data decoding is basically the reverse process of data encoding. The decoding steps are as follows: First, we need to separate the header field and the target data string. As mentioned earlier, the first character of the shared string represents the version information, and the second character records the number of elements in the data set. We can obtain the version of the target conversion rule used by the shared string through the version information. Then, according to the version of the target conversion rule, the second character is converted from base 32 to base 10 to obtain the number of elements n in the data set. Therefore, the first n+2 characters of the shared string constitute the header field, of which the 3rd to n+2nd characters are the data layout string, and the part from the n+3rd character to the end of the string is the target data string we need. At this point, the parsing of the header field and the target data string is completed.

[0143] Then, the target conversion rule is adopted in S604 to decode the target data string to obtain the original data corresponding to the shared string, which may include:

[0144] S802: According to the number of data and the data layout string, a target conversion rule is used to decode the target data string to obtain at least one original data corresponding to the shared string.

[0145] In the data decoding process, we will frequently convert the 32-base number to the 10-base number. The following is the pseudo code for this base conversion:

[0146]

[0147] Through base conversion, each 32-decimal character in the data layout string in the header field can be converted into a corresponding decimal number. Each decimal number represents the length of a data (expressed in base 32) in the data set. According to the layout string, the data set can be separated from the target data string in sequence to obtain a base 32 data set. Finally, each data in the base 32 data set is converted to obtain a decimal data set. This decimal data set is the original data finally obtained.

[0148] In summary, the present invention provides a data sharing method, which has the following advantages:

[0149] 1. When sharing data, a conversion rule is randomly selected as the target conversion rule, and the shared data is encoded using the target conversion rule. Even if the same data is shared by the same user at different time points, the generated shared strings are different, which greatly increases the difficulty of cracking. In addition, random selection also provides higher flexibility for data encoding.

[0150] 2. Through base conversion, the length of the data to be shared is significantly reduced, ensuring that the generated shared string has a high visual aesthetic.

[0151] 3. Use abandoned character sets for padding to improve the security of encoding shared data, increase the difficulty of cracking by potential crackers, and can also be used to fill in gaps when necessary to meet specific length requirements.

[0152] 4. The version information of the target conversion rule is placed in the header field, so that after the receiver receives the shared data, it can decode the encoded data according to the information recorded in the header field to obtain the original data before encoding.

[0153] The following is a corresponding explanation of the device, equipment and storage medium for executing the data sharing method provided in the above embodiments of the present application. The specific implementation process and the technical effects produced are the same as those of the corresponding method embodiments mentioned above. For the sake of brief description, for the parts not mentioned in the following embodiments, please refer to the corresponding contents in the method embodiments.

[0154] Fig. 9 A schematic diagram of the structure of a data sharing device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the present application also provides a data sharing device, including:

[0155] The first acquisition module 10 is used to acquire the to-be-shared data of the preset application.

[0156] The selection module 20 is used to randomly select a conversion rule from a plurality of preset conversion rules in a preset data conversion rule library as a target conversion rule.

[0157] The encoding module 30 is used to encode the data to be shared by adopting a target conversion rule to generate a data string of the data to be shared.

[0158] The generating module 40 is used to generate a character string to be shared corresponding to the data to be shared according to the version information of the target conversion rule and the data character string.

[0159] Optionally, the generating module 40 is further configured to encapsulate the version information of the target conversion rule into a header field; and generate a character string to be shared according to the header field and the data character string.

[0160] Optionally, the encoding module 30 is used to encode each data to be shared by adopting a target conversion rule to generate a data string of each data to be shared; and to concatenate the data strings of each data to be shared in a preset order to generate a target data string.

[0161] The generating module 40 is further used to generate a character string to be shared according to the header field and the target data character string.

[0162] Optionally, the generation module 40 is further used to encapsulate the version information of the target conversion rule, the number of data to be shared, and the data layout string as a header field; the data layout string is used to indicate: the length of the data string corresponding to each data to be shared in the target data string.

[0163] Optionally, the data sharing device further comprises a processing module, which is used to process the preset standard conversion rule multiple times to generate multiple preset conversion rules.

[0164] Optionally, the preset standard conversion rule is: a preset standard base conversion character set, and the multiple preset conversion rules are: multiple preset base conversion character strings.

[0165] The processing module is also used to perform multiple random processing on the characters in the preset standard base conversion character set to generate multiple preset base conversion character strings.

[0166] Optionally, the processing module is also used to perform padding processing on a preset standard base conversion character set based on a preset discarded character set to generate a reference base conversion character set; in each disorder processing, randomly select multiple characters from the reference base conversion character set, and randomly sort the randomly selected multiple characters to generate a preset base conversion character string.

[0167] Optionally, the data sharing device further comprises a sharing module, which is used to display the character string to be shared on a sharing interface of a preset application; and in response to a copy event for the character string to be shared, share the character string to be shared with other applications.

[0168] Fig.10A structural diagram of a data sharing device provided in another embodiment of the present application is shown in FIG. Fig.10 As shown, the present application also provides a data sharing device, including:

[0169] The second acquisition module 50 is used to acquire a shared character string for a preset application.

[0170] The parsing module 60 is used to obtain target version information and target data character string from the shared character string.

[0171] The determination module 70 is used to determine, according to the target version information, a target conversion rule corresponding to the target version information from a plurality of preset conversion rules in a preset data conversion rule library.

[0172] The decoding module 80 is used to decode the target data string using the target conversion rule to obtain the original data corresponding to the shared string.

[0173] Optionally, the parsing module 60 is used to parse the header field of the shared string to obtain the target version information; and parse other fields in the shared string except the header field to obtain the target data string.

[0174] Optionally, the parsing module 60 is further used to parse the field after the target version information in the header field to obtain the number of data and a data layout string; the data layout string is used to indicate: the length of the data string corresponding to each data to be shared in the target data string.

[0175] The decoding module 80 is further used to decode the target data string according to the number of data and the data layout string using the target conversion rule to obtain at least one original data corresponding to the shared string.

[0176] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0177] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0178] Fig.11 A schematic diagram of the structure of the client device provided in the embodiment of the present application, such as Fig.11 As shown, the client device may be a local terminal device, and the client device includes a processor 100, a storage medium 200, and a bus 300, and the processor and the storage medium communicate with each other through the bus.

[0179] The storage medium stores program instructions executable by the processor. When the client device is running, the processor executes the program instructions. The implementation method includes:

[0180] Get the data to be shared of the preset application;

[0181] Randomly select a conversion rule from multiple preset conversion rules in a preset data conversion rule library as a target conversion rule;

[0182] The target conversion rule is adopted to encode the data to be shared, and a data string of the data to be shared is generated;

[0183] A character string to be shared corresponding to the data to be shared is generated according to the version information of the target conversion rule and the data character string.

[0184] Optionally, generating a character string to be shared corresponding to the data to be shared according to the version information of the target conversion rule and the data character string includes:

[0185] Encapsulating version information of the target conversion rule as a header field;

[0186] The character string to be shared is generated according to the header field and the data character string.

[0187] Optionally, the adopting the target conversion rule to encode the data to be shared to generate a data string of the data to be shared includes:

[0188] Adopting the target conversion rule, encoding each of the data to be shared, and generating a data string of each of the data to be shared;

[0189] According to a preset order, the data character strings of the data to be shared are concatenated to generate a target data character string;

[0190] The step of generating the character string to be shared according to the header field and the data character string includes:

[0191] The character string to be shared is generated according to the header field and the target data character string.

[0192] Optionally, encapsulating the version information of the target conversion rule as a header field includes:

[0193] The version information of the target conversion rule, the number of the data to be shared, and the data layout string are encapsulated as the header field; the data layout string is used to indicate: the length of the data string corresponding to each of the data to be shared in the target data string.

[0194] Optionally, before randomly selecting a conversion rule from a plurality of preset conversion rules in a preset data conversion rule library as a target conversion rule, the method further comprises:

[0195] The preset standard conversion rule is processed multiple times to generate multiple preset conversion rules.

[0196] Optionally, the preset standard conversion rule is: a preset standard base conversion character set, and the plurality of preset conversion rules are: a plurality of preset base conversion character strings;

[0197] The step of processing the preset standard conversion rule multiple times to generate multiple preset conversion rules includes:

[0198] The characters in the preset standard base conversion character set are subjected to multiple random processing to generate multiple preset base conversion character strings.

[0199] Optionally, the performing multiple random processing on the characters in the preset standard base conversion character set to generate multiple preset base conversion character strings includes:

[0200] Based on the preset discarded character set, the preset standard base conversion character set is subjected to a padding process to generate a reference base conversion character set;

[0201] In each disorder processing, a plurality of characters are randomly selected from the reference base conversion character set, and the randomly selected plurality of characters are randomly sorted to generate a preset base conversion character string.

[0202] Optionally, the data to be shared includes: business function data in a preset application and user setting data of the preset application.

[0203] Optionally, the method further comprises:

[0204] Displaying the character string to be shared on the sharing interface of the preset application;

[0205] In response to a copy event for the character string to be shared, the character string to be shared is shared with other applications.

[0206] Data sharing methods also include:

[0207] Get the shared string for the preset application;

[0208] Obtaining target version information and target data string from the shared string;

[0209] According to the target version information, determining a target conversion rule corresponding to the target version information from a plurality of preset conversion rules in a preset data conversion rule library;

[0210] The target data string is decoded using the target conversion rule to obtain original data corresponding to the shared string.

[0211] Optionally, the acquiring target version information and target data string from the shared string includes:

[0212] Parsing the header field of the shared string to obtain the target version information;

[0213] The other fields except the header field in the shared character string are parsed to obtain the target data character string.

[0214] Optionally, before adopting the target conversion rule to decode the target data string to obtain original data corresponding to the shared string, the method further includes:

[0215] Parse the field after the target version information in the header field to obtain the number of data and a data layout string; the data layout string is used to indicate: the length of the data string corresponding to each of the to-be-shared data in the target data string;

[0216] The adopting the target conversion rule to decode the target data string to obtain the original data corresponding to the shared string includes:

[0217] According to the number of data and the data layout character string, the target data character string is decoded using the target conversion rule to obtain at least one original data corresponding to the shared character string.

[0218] The present application also provides a readable storage medium, wherein the readable storage medium stores program instructions, and the program instructions are executed by a processor, and the method implemented includes:

[0219] Get the data to be shared of the preset application;

[0220] Randomly select a conversion rule from multiple preset conversion rules in a preset data conversion rule library as a target conversion rule;

[0221] The target conversion rule is adopted to encode the data to be shared, and a data string of the data to be shared is generated;

[0222] A character string to be shared corresponding to the data to be shared is generated according to the version information of the target conversion rule and the data character string.

[0223] Optionally, generating a character string to be shared corresponding to the data to be shared according to the version information of the target conversion rule and the data character string includes:

[0224] Encapsulating version information of the target conversion rule as a header field;

[0225] The character string to be shared is generated according to the header field and the data character string.

[0226] Optionally, the adopting the target conversion rule to encode the data to be shared to generate a data string of the data to be shared includes:

[0227] Adopting the target conversion rule, encoding each of the data to be shared, and generating a data string of each of the data to be shared;

[0228] According to a preset order, the data character strings of the data to be shared are concatenated to generate a target data character string;

[0229] The step of generating the character string to be shared according to the header field and the data character string includes:

[0230] The character string to be shared is generated according to the header field and the target data character string.

[0231] Optionally, encapsulating the version information of the target conversion rule as a header field includes:

[0232] The version information of the target conversion rule, the number of the data to be shared, and the data layout string are encapsulated as the header field; the data layout string is used to indicate: the length of the data string corresponding to each of the data to be shared in the target data string.

[0233] Optionally, before randomly selecting a conversion rule from a plurality of preset conversion rules in a preset data conversion rule library as a target conversion rule, the method further comprises:

[0234] The preset standard conversion rule is processed multiple times to generate multiple preset conversion rules.

[0235] Optionally, the preset standard conversion rule is: a preset standard base conversion character set, and the plurality of preset conversion rules are: a plurality of preset base conversion character strings;

[0236] The step of processing the preset standard conversion rule multiple times to generate multiple preset conversion rules includes:

[0237] The characters in the preset standard base conversion character set are subjected to multiple random processing to generate multiple preset base conversion character strings.

[0238] Optionally, the performing multiple random processing on the characters in the preset standard base conversion character set to generate multiple preset base conversion character strings includes:

[0239] Based on the preset discarded character set, the preset standard base conversion character set is subjected to a padding process to generate a reference base conversion character set;

[0240] In each disorder processing, a plurality of characters are randomly selected from the reference base conversion character set, and the randomly selected plurality of characters are randomly sorted to generate a preset base conversion character string.

[0241] Optionally, the data to be shared includes: business function data in a preset application and user setting data of the preset application.

[0242] Optionally, the method further comprises:

[0243] Displaying the character string to be shared on the sharing interface of the preset application;

[0244] In response to a copy event for the character string to be shared, the character string to be shared is shared with other applications.

[0245] Data sharing methods also include:

[0246] Get the shared string for the preset application;

[0247] Obtaining target version information and target data string from the shared string;

[0248] According to the target version information, determining a target conversion rule corresponding to the target version information from a plurality of preset conversion rules in a preset data conversion rule library;

[0249] The target data string is decoded using the target conversion rule to obtain original data corresponding to the shared string.

[0250] Optionally, the acquiring target version information and target data string from the shared string includes:

[0251] Parsing the header field of the shared string to obtain the target version information;

[0252] The other fields except the header field in the shared character string are parsed to obtain the target data character string.

[0253] Optionally, before adopting the target conversion rule to decode the target data string to obtain original data corresponding to the shared string, the method further includes:

[0254] Parse the field after the target version information in the header field to obtain the number of data and a data layout string; the data layout string is used to indicate: the length of the data string corresponding to each of the to-be-shared data in the target data string;

[0255] The adopting the target conversion rule to decode the target data string to obtain the original data corresponding to the shared string includes:

[0256] According to the number of data and the data layout character string, the target data character string is decoded using the target conversion rule to obtain at least one original data corresponding to the shared character string.

[0257] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0258] The units described 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.

[0259] 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 hardware plus software functional units.

[0260] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for enabling a client device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.

[0261] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data sharing method, characterized in that: The method comprises: Get the data to be shared of the preset application; Randomly select a conversion rule from multiple preset conversion rules in a preset data conversion rule library as a target conversion rule; The target conversion rule is adopted to encode the data to be shared, and a data string of the data to be shared is generated; A character string to be shared corresponding to the data to be shared is generated according to the version information of the target conversion rule and the data character string.

2. The method according to claim 1, characterized in that The step of generating a character string to be shared corresponding to the data to be shared according to the version information of the target conversion rule and the data character string includes: Encapsulating version information of the target conversion rule as a header field; The character string to be shared is generated according to the header field and the data character string.

3. The method according to claim 2, characterized in that The adopting the target conversion rule to encode the data to be shared to generate a data string of the data to be shared includes: Adopting the target conversion rule, encoding each of the data to be shared, and generating a data string of each of the data to be shared; According to a preset order, the data character strings of the data to be shared are concatenated to generate a target data character string; The step of generating the character string to be shared according to the header field and the data character string includes: The character string to be shared is generated according to the header field and the target data character string.

4. The method according to claim 3, characterized in that The encapsulating the version information of the target conversion rule as a header field includes: The version information of the target conversion rule, the number of the data to be shared, and the data layout string are encapsulated as the header field; the data layout string is used to indicate: the length of the data string corresponding to each of the data to be shared in the target data string.

5. The method according to claim 1, characterized in that Before randomly selecting a conversion rule from a plurality of preset conversion rules in a preset data conversion rule library as a target conversion rule, the method further includes: The preset standard conversion rule is processed multiple times to generate multiple preset conversion rules.

6. The method according to claim 5, characterized in that The preset standard conversion rule is: a preset standard base conversion character set, and the plurality of preset conversion rules are: a plurality of preset base conversion character strings; The step of processing the preset standard conversion rule multiple times to generate multiple preset conversion rules includes: The characters in the preset standard base conversion character set are subjected to multiple random processing to generate multiple preset base conversion character strings.

7. The method according to claim 6, characterized in that The step of performing multiple random processing on the characters in the preset standard base conversion character set to generate multiple preset base conversion character strings includes: Based on the preset discarded character set, the preset standard base conversion character set is subjected to a padding process to generate a reference base conversion character set; In each disorder processing, a plurality of characters are randomly selected from the reference base conversion character set, and the randomly selected plurality of characters are randomly sorted to generate a preset base conversion character string.

8. The method according to claim 1, characterized in that: The data to be shared includes: business function data in the preset application and user setting data of the preset application.

9. The method according to claim 1, characterized in that: The method further comprises: Displaying the character string to be shared on the sharing interface of the preset application; In response to a copy event for the character string to be shared, the character string to be shared is shared with other applications.

10. A data sharing method, characterized in that: The method comprises: Get the shared string for the preset application; Obtaining target version information and target data string from the shared string; According to the target version information, determining a target conversion rule corresponding to the target version information from a plurality of preset conversion rules in a preset data conversion rule library; The target data string is decoded using the target conversion rule to obtain original data corresponding to the shared string.

11. The method according to claim 10, characterized in that The step of obtaining target version information and target data string from the shared string includes: Parsing the header field of the shared string to obtain the target version information; The other fields except the header field in the shared character string are parsed to obtain the target data character string.

12. The method according to claim 11, characterized in that Before adopting the target conversion rule to decode the target data string to obtain the original data corresponding to the shared string, the method further includes: Parse the field after the target version information in the header field to obtain the number of data and a data layout string; the data layout string is used to indicate: the length of the data string corresponding to each to-be-shared data in the target data string; The adopting the target conversion rule to decode the target data string to obtain the original data corresponding to the shared string includes: According to the number of data and the data layout character string, the target data character string is decoded using the target conversion rule to obtain at least one original data corresponding to the shared character string.

13. A data sharing device, characterized in that: The device comprises: A first acquisition module, used to acquire the to-be-shared data of a preset application; A selection module, used to randomly select a conversion rule as a target conversion rule from a plurality of preset conversion rules in a preset data conversion rule library; An encoding module, used to encode the data to be shared by adopting the target conversion rule to generate a data string of the data to be shared; A generating module is used to generate a character string to be shared corresponding to the data to be shared according to the version information of the target conversion rule and the data character string.

14. A data sharing device, characterized in that: The device comprises: A second acquisition module, used to acquire a shared character string for a preset application; A parsing module, used for obtaining target version information and target data string from the shared string; A determination module, configured to determine, according to the target version information, a target conversion rule corresponding to the target version information from a plurality of preset conversion rules in a preset data conversion rule library; A decoding module is used to decode the target data string using the target conversion rule to obtain original data corresponding to the shared string.

15. A client device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the client device is running, the processor and the storage medium communicate via the bus, and the processor executes the program instructions to implement the data sharing method described in any one of claims 1 to 12.

16. A readable storage medium, characterized in that: The readable storage medium stores program instructions, and the program instructions, when executed by a processor, implement the data sharing method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Data leak prevention coding method, device and system and data leak prevention decoding method, device and system

    CN107256359A

  • Data encoding method and device, data decoding method and device, equipment and storage medium

    CN110932822A

  • Data storage and identification method and device

    CN116048397A

  • Data processing method and device, equipment, storage medium and computer program product

    CN118410088A

  • Automating quality assurance for standardized content sharing

    US9426542B1