Data sending method, data receiving method and device, equipment and medium
Patent Information
- Application Number
- CN202310518752.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-09
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-05-09
AI Technical Summary
[0002]在进行多方之间的数据通信时,可能存在数据传输安全性不足的情况,导致数据暴露或被伪造、干扰
[0012]根据本公开的另一方面,提供了一种计算机程序产品,包括计算机程序,其中,计算机程序在被处理器执行时能够实现上述数据发送方法和数据接收方法中的至少一项。
Smart Images

Figure CN116781323B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to the field of data transmission technology, specifically to a data transmission method, a data reception method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] When conducting data communication between multiple parties, there may be insufficient data transmission security, leading to data exposure, forgery, or interference.
[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0004] This disclosure provides a data transmission and data reception method, apparatus, electronic device, computer-readable storage medium, and computer program product.
[0005] According to one aspect of this disclosure, a data transmission method is provided, comprising: acquiring raw data to be transmitted, the raw data including a plurality of raw keys and a value corresponding to each of the plurality of raw keys; acquiring encoding information for the raw data, the encoding information including order information for the plurality of raw keys, wherein the order information includes the permutation ordinal number of each of the plurality of raw keys in a random sequence composed of the plurality of raw keys; determining a sequence composed of the values corresponding to each of the plurality of raw keys based on the order information to obtain target data; and transmitting the target data to a data receiving device, such that the data receiving device can determine the raw data based on decoding information and the target data, wherein the decoding information includes the plurality of raw keys and the order information.
[0006] According to another aspect of this disclosure, a data receiving method is provided, comprising: receiving target data, the target data including a plurality of values arranged in sequence; acquiring decoding information for the target data, wherein the decoding information includes a plurality of original keys and order information for the plurality of original keys; determining a one-to-one mapping relationship between the plurality of values and the plurality of original keys based on the ordinal numbers of the plurality of values in a sequence composed of the plurality of values and the order information; and determining original data corresponding to the target data based on the one-to-one mapping relationship between the plurality of values and the plurality of original keys, the original data including the plurality of original keys and a value corresponding to each of the plurality of original keys.
[0007] According to another aspect of this disclosure, a data transmission apparatus is provided, comprising: a first acquisition unit configured to acquire raw data to be transmitted, the raw data including a plurality of raw keys and a value corresponding to each of the plurality of raw keys; a second acquisition unit configured to acquire encoding information for the raw data, the encoding information including order information for the plurality of raw keys, wherein the order information includes the permutation ordinal number of each of the plurality of raw keys in a random sequence composed of the plurality of raw keys; a first determination unit configured to determine a sequence composed of the values corresponding to each of the plurality of raw keys based on the order information to obtain target data; and a transmission unit configured to transmit the target data to a data receiving device, such that the data receiving device can determine the raw data based on decoding information and the target data, wherein the decoding information includes the plurality of raw keys and the order information.
[0008] According to another aspect of this disclosure, a data receiving apparatus is provided, comprising: a receiving unit configured to receive target data, the target data including a plurality of values arranged in sequence; a third acquiring unit configured to acquire decoding information for the target data, wherein the decoding information includes a plurality of original keys and order information for the plurality of original keys; a second determining unit configured to determine a one-to-one mapping relationship between the plurality of values and the plurality of original keys based on the ordinal numbers of the plurality of values in a sequence composed of the plurality of values and the order information; and a third determining unit configured to determine original data corresponding to the target data based on the one-to-one mapping relationship between the plurality of values and the plurality of original keys, the original data including the plurality of original keys and a value corresponding to each of the plurality of original keys.
[0009] According to another aspect of this disclosure, a data transmission system is provided, including the data transmitting device and the data receiving device as described above.
[0010] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform at least one of the above-described data transmission method and data reception method.
[0011] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to perform at least one of the above-described data transmission method and data reception method.
[0012] According to another aspect of this disclosure, a computer program product is provided, including a computer program, wherein the computer program, when executed by a processor, is capable of implementing at least one of the above-described data transmission method and data reception method.
[0013] According to one or more embodiments of this disclosure, the security of data transmission can be improved.
[0014] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0015] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0016] Figure 1 A schematic diagram of an exemplary system in which various methods described herein may be implemented, according to exemplary embodiments of the present disclosure;
[0017] Figure 2 A flowchart of a data transmission method according to an exemplary embodiment of the present disclosure is shown;
[0018] Figure 3 A flowchart of a data receiving method according to an exemplary embodiment of the present disclosure is shown;
[0019] Figure 4 A structural block diagram of a data transmission apparatus according to an exemplary embodiment of the present disclosure is shown;
[0020] Figure 5 A structural block diagram of a data receiving apparatus according to an exemplary embodiment of the present disclosure is shown;
[0021] Figure 6 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0022] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0023] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to define the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0024] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0025] In related technologies, the complete plaintext data is usually encrypted before being sent, which poses a risk of obtaining the complete plaintext data through reverse analysis, resulting in insufficient security in data transmission.
[0026] Based on this, this disclosure provides a data transmission method that, for the original key-value pair data, arranges multiple values based on random key order information, and sends target data consisting of multiple randomly disordered values to a data receiving device. Only the data receiving device can reconstruct the original key-value pair data based on the decoding information containing the original key and key order information, avoiding the risk of directly reconstructing the complete original data from the target data and improving the security of data transmission.
[0027] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0028] Figure 1 A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.
[0029] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of data sending or receiving methods.
[0030] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105, and / or 106 under a Software as a Service (SaaS) model.
[0031] exist Figure 1 In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the various methods described herein, and is not intended to be limiting.
[0032] Users can use client devices 101, 102, 103, 104, 105, and / or 106 to send or receive data. The client devices can provide an interface that allows users to interact with them. The client devices can also output information to the user through this interface. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.
[0033] Client devices 101, 102, 103, 104, 105, and / or 106 may include various categories of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various categories and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices can run a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), short message service (SMS) applications, and can use various communication protocols.
[0034] Network 110 can be any type of network well known to those skilled in the art, and can use any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.) to support data communication. By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0035] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0036] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0037] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0038] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0039] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located away from server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different categories. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.
[0040] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be different categories of databases, such as key-value stores, object stores, or regular stores supported by a file system.
[0041] Figure 1The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.
[0042] Figure 2 A flowchart of a data transmission method 200 according to an exemplary embodiment of the present disclosure is shown. Figure 2 As shown, method 200 includes:
[0043] Step S201: Obtain the raw data to be sent, wherein the raw data includes multiple raw keys and the value corresponding to each of the multiple raw keys;
[0044] Step S202: Obtain encoding information for the original data, the encoding information including order information for the plurality of original keys, wherein the order information includes the permutation number of each of the plurality of original keys in a random sequence composed of the plurality of original keys;
[0045] Step S203: Based on the order information, determine the sequence consisting of the values corresponding to each of the plurality of original keys to obtain the target data; and
[0046] Step S204: Send the target data to the data receiving device so that the data receiving device can determine the original data based on the decoding information and the target data, wherein the decoding information includes the plurality of original keys and the order information.
[0047] By arranging multiple values in the original key-value pair data based on random key order information, target data consisting of multiple randomly disordered values can be obtained and sent. In this case, only the data receiving device can reconstruct the original key-value pair data based on the decoded information containing the original keys and key order information. It is impossible to directly reconstruct the complete original data from the transmitted target data, which reduces the risk of original data leakage and improves the security of data transmission.
[0048] In some examples, the original data can be data containing multiple key-value pairs, such as JSON data.
[0049] In some examples, the encoded and decoded information can be generated using encoding tools that incorporate random algorithms. For instance, this can be achieved by randomly permuting multiple raw keys to obtain a random sequence of raw keys, and then recording the permutation number of each raw key to obtain the encoding and decoding tables. By storing the encoded and decoded information separately at the data sender and receiver, security can be improved, and the risk of the target data being cracked and leaked can be reduced.
[0050] In some examples, the encoded and decoded information can be determined using algorithms deployed on the data sender and receiver respectively, which implement specific random mapping rules. Thus, the encoded and decoded information can be obtained by executing the random mapping algorithm, as long as the order information applied by the data sender and receiver is consistent. This avoids storing plaintext encoding and decoding information and further enhances security.
[0051] According to some embodiments, the original data formats of the values corresponding to each of the plurality of original keys are not all the same. Determining the sequence of values corresponding to each of the plurality of original keys based on the order information to obtain target data includes: converting the value corresponding to each of the plurality of original keys into a data item with a preset data format; and concatenating the data items corresponding to each of the plurality of original keys based on the order information to obtain the target data. The decoding information further includes data format information indicating the original data format of the values corresponding to each of the plurality of original keys, so that the data receiving device can determine the corresponding value of each data item based on the data format information. Therefore, the values in the original data can be converted into data items with a preset data format, avoiding the exposure of plaintext data and further improving the security of data transmission.
[0052] In some examples, each plaintext value can be converted into a binary data item of fixed byte length, and the corresponding data items of multiple values can be concatenated into a binary sequence to improve the efficiency and security of data transmission. Furthermore, in some examples, compression encryption algorithms can be applied to compress and encrypt the original binary sequence data to output compressed and encrypted binary data. For example, data can be compressed using a compression algorithm, and during the compression process, a digest algorithm can be used to calculate the digest information, while simultaneously using a symmetric encryption algorithm to encrypt the data. A random symmetric encryption key can be generated and encrypted using the public key of an asymmetric encryption algorithm. The final output is compressed binary data integrating the encryption algorithms, effectively improving the efficiency and security of data transmission.
[0053] In this situation, when the original data formats of the values in the original data are not all the same, it is necessary to further restore the target data to the original data based on the data format information. In this case, encoding tools can be used to generate encoding and decoding information containing order information and data format information based on the data format description file of the original data, so that the data receiver can restore the original data based on the data format information, thereby further improving the security of data transmission.
[0054] In some examples, the original data format of the values corresponding to multiple original keys in the original data can include integer, floating-point, string, boolean, etc.
[0055] In the example above, the binary sequence data contained in the target data is composed of multiple data items corresponding to multiple values. Understandably, these multiple data items need to have the same preset length to achieve data format alignment between the data sender and receiver. However, the following possibility exists: the lengths of the values in the original data are not all the same. When the length of the value in the original data is less than the preset length of the data item, it will cause redundancy in the size of the target data, affecting data transmission efficiency. Furthermore, the security of target data composed of multiple fixed-length data items is insufficient.
[0056] Based on this, according to some embodiments, when the lengths of the values corresponding to each of the plurality of original keys are not all the same, the step of converting the value corresponding to each of the plurality of original keys into a data item with a preset data format includes: for each of the plurality of original keys, determining a first sub-element based on the length of the value corresponding to the original key; determining a second sub-element based on the value corresponding to the original key; and determining the data item corresponding to the original key based on the first sub-element and the second sub-element. Thus, even when the original lengths of the original data values are not all the same, the first sub-element can be used to indicate the length of each value, and second sub-elements with different lengths can be used to represent the data content of each value. This forces the data receiving device to read the second sub-element based on the length information indicated by the first sub-element, improving the efficiency and security of data transmission.
[0057] In some examples, the first sub-element can be determined based on bit identifiers to indicate the byte length of the data item corresponding to each value.
[0058] According to some embodiments, the encoded information further includes an identifier corresponding to each of the plurality of original keys. The value in the original data is modified using the following process: in response to receiving a data modification request for a target identifier, a target original key corresponding to the target identifier is determined based on the encoded information; and the value corresponding to the target original key is modified based on the data modification request. Therefore, a data modification entry point containing only the identifier corresponding to the original key can be set up at the data sender. By modifying the value of the original data through the identifier, the plaintext information of the original key can be avoided, thus improving data security.
[0059] According to some embodiments, the encoded information further includes at least one virtual key, and the order information includes the permutation number of each of the plurality of original keys in a random sequence composed of the plurality of original keys and at least one virtual key. The method further includes: randomly generating a value corresponding to each of the at least one virtual key, and wherein determining the sequence composed of the values corresponding to each of the plurality of original keys to obtain target data based on the order information includes: determining the sequence composed of the values corresponding to each of the plurality of original keys and the values corresponding to each of the at least one virtual key to obtain the target data based on the order information. Therefore, by inserting virtual invalid data into the original data, the complexity of the target data can be increased, original data leakage can be avoided, and security can be further improved.
[0060] In some examples, for multiple original keys, a random algorithm is first used to generate a random ordinal number corresponding to each original key. When the multiple random ordinal numbers corresponding to multiple original keys cannot form a continuous natural number sequence, a dummy key can be used to fill the blank ordinal numbers in the natural number sequence to obtain a sequence consisting of multiple original keys and at least one dummy key.
[0061] For example, when the original data contains four real original keys A, B, C, and D, a random algorithm can be used to generate a random ordinal number corresponding to each original key. When the random ordinal numbers corresponding to the four original keys A, B, C, and D are 5, 3, 7, and 2 respectively, virtual keys e, f, and g can be filled into the blank ordinal numbers 1, 4, and 6 in the natural number sequence 1-7 respectively, so as to obtain a sequence composed of e, D, B, f, A, g, and C. Based on this, encoding and decoding information is generated, and virtual value data corresponding to the virtual keys is inserted into the target data, which increases the complexity of the encoding and decoding information and the target data, and improves the security of data transmission.
[0062] According to some embodiments, the encoded information and the decoded information are updated synchronously according to a preset time period. This allows for the synchronous updating of encoded and decoded information according to a preset period, ensuring consistency between the encoded and decoded information on both sides and improving the security of data transmission.
[0063] According to one aspect of this disclosure, a data receiving method is also provided. Figure 3 A flowchart of a data receiving method 300 according to an exemplary embodiment of the present disclosure is shown. Figure 3 As shown, method 300 includes:
[0064] Step S301: Receive target data, wherein the target data includes multiple values arranged in sequence;
[0065] Step S302: Obtain decoding information for the target data, wherein the decoding information includes multiple raw keys and order information for the multiple raw keys;
[0066] Step S303: Based on the ordinal numbers of the multiple values in the sequence composed of the multiple values and the order information, determine the one-to-one mapping relationship between the multiple values and the multiple original keys; and
[0067] Step S304: Based on the one-to-one mapping relationship between the plurality of values and the plurality of original keys, determine the original data corresponding to the target data. The original data includes the plurality of original keys and the value corresponding to each of the plurality of original keys.
[0068] After receiving multiple values arranged in sequence, the data receiving device must reconstruct the original data containing multiple key-value pairs based on the decoded information containing the original key and key order information. It cannot directly reconstruct the complete original data from the transmitted target data, which can reduce the risk of leakage of the original data and improve the security of data transmission.
[0069] According to some embodiments, each of the plurality of values is represented using a data item with a preset data format. The decoding information further includes data format information, which indicates the original data format of the value corresponding to each of the plurality of original keys. Furthermore, determining the original data corresponding to the target data based on the one-to-one mapping relationship between the plurality of values and the plurality of original keys includes: for each of the plurality of original keys, converting the data item corresponding to the preset data format of that original key into the original data format to obtain the original data. Therefore, when the value in the target data is represented in the form of data items, the data receiving device needs to further restore the data items in the target data to the values in the original data based on the data format information, further improving the security of data transmission.
[0070] According to some embodiments, the data item includes a first sub-element representing the length of the value corresponding to the data item and a second sub-element representing the value corresponding to the data item. The step of converting a data item with a preset data format corresponding to each of the plurality of original keys into an original data format includes: determining a first length of the value corresponding to the data item based on the first sub-element; determining a second length of the second sub-element based on the first length; reading the second sub-element based on the second length; and converting the second sub-element into the original data format. Therefore, when the original lengths of the values in the original data are not all the same, multiple values can be represented using data items of different lengths. The data receiving device must read the second sub-element from the concatenated target data based on the length information indicated by the first sub-element, and parse the corresponding value of each data item accordingly, further improving the security of data transmission.
[0071] In one example, the raw data could be JSON data like this: {"name":"xiaoming","age":21,"weight":60}. Based on this, the corresponding raw data format description information can be determined as: {"name":"string","age":"int","weight":"int"}. Understandably, the raw data format can use a more readable string as an identifier, or it can use an integer as an identifier, as long as it can be used to distinguish the data type.
[0072] Based on this, the identifiers corresponding to the multiple original keys shown in Table 1 and the order information of the multiple original keys shown in Table 2 can be randomly generated.
[0073] Table 1:
[0074] name 3 age 1 weight 2
[0075] Table 2:
[0076] name 2 age 3 weight 1
[0077] Based on the above identifier and order information, the encoding table shown in Table 3 and the decoding table shown in Table 4 can be generated.
[0078] Table 3:
[0079] 3 2 1 3 2 1
[0080] Table 4:
[0081] 1 weight int 2 name string 3 age int
[0082] In some examples, the encoding table can use data structures such as multi-level linked lists, multi-level HashMaps, and trees to store data. The decoding table can use a multi-level linked list data structure to store data.
[0083] In some examples, the data receiver can store the mapping relationship between the above multiple identifiers and the original keys of the plaintext at the same time. When the original data is input or modified, the mapping relationship can be removed to avoid exposing the original key information of the plaintext during data transmission.
[0084] According to one aspect of this disclosure, a data transmission apparatus is also provided. Figure 4 A structural block diagram of a data transmission apparatus 400 according to an exemplary embodiment of the present disclosure is shown. Figure 4 As shown, the device 400 includes:
[0085] The first acquisition unit 401 is configured to acquire raw data to be sent, the raw data including a plurality of raw keys and a value corresponding to each of the plurality of raw keys;
[0086] The second acquisition unit 402 is configured to acquire encoding information for the original data, the encoding information including order information for the plurality of original keys, wherein the order information includes the permutation number of each of the plurality of original keys in a random sequence composed of the plurality of original keys;
[0087] The first determining unit 403 is configured to determine, based on the order information, a sequence consisting of the values corresponding to each of the plurality of original keys, to obtain target data; and
[0088] The sending unit 404 is configured to send the target data to the data receiving device so that the data receiving device can determine the original data based on the decoding information and the target data, wherein the decoding information includes the plurality of original keys and the order information.
[0089] According to some embodiments, the original data formats of the values corresponding to each of the plurality of original keys are not all the same. The first determining unit 403 includes: a conversion subunit configured to convert the value corresponding to each of the plurality of original keys into a data item with a preset data format; and a splicing subunit configured to splice the data items corresponding to each of the plurality of original keys based on the order information to obtain the target data. The decoding information further includes data format information, which indicates the original data format of the value corresponding to each of the plurality of original keys, so that the data receiving device can determine the corresponding value of each data item based on the data format information.
[0090] According to some embodiments, the length of the value corresponding to each of the plurality of original keys is not all the same, and the transformation subunit is configured to: for each of the plurality of original keys, determine a first sub-element based on the length of the value corresponding to the original key; determine a second sub-element based on the value corresponding to the original key; and determine the data item corresponding to the original key based on the first sub-element and the second sub-element.
[0091] According to some embodiments, the encoded information further includes an identifier corresponding to each of the plurality of original keys, and the value in the original data is modified using the following process: in response to receiving a data modification request for a target identifier, determining a target original key corresponding to the target identifier based on the encoded information; and modifying the value corresponding to the target original key based on the data modification request.
[0092] According to some embodiments, the encoded information further includes at least one virtual key, and the order information includes the permutation number of each of the plurality of original keys in a random sequence composed of the plurality of original keys and at least one virtual key. The apparatus further includes: a generation unit configured to randomly generate a value corresponding to each of the at least one virtual key, and wherein the first determining unit 403 is configured to: determine the value corresponding to each of the plurality of original keys and the value corresponding to each of the at least one virtual key based on the order information to obtain the target data.
[0093] According to some embodiments, the encoded information and the decoded information are updated synchronously according to a preset time period.
[0094] According to one aspect of this disclosure, a data receiving device is also provided. Figure 5 A structural block diagram of a data receiving apparatus 500 according to an exemplary embodiment of the present disclosure is shown. Figure 5 As shown, the device 500 includes:
[0095] The receiving unit 501 is configured to receive target data, the target data including a plurality of values arranged in sequence;
[0096] The third acquisition unit 502 is configured to acquire decoding information for the target data, wherein the decoding information includes multiple original keys and order information for the multiple original keys;
[0097] The second determining unit 503 is configured to determine a one-to-one mapping relationship between the plurality of values and the plurality of original keys based on the permutation ordinal number of the plurality of values in the sequence composed of the plurality of values and the order information; and
[0098] The third determining unit 504 is configured to determine the original data corresponding to the target data based on the one-to-one mapping relationship between the plurality of values and the plurality of original keys, wherein the original data includes the plurality of original keys and the value corresponding to each of the plurality of original keys.
[0099] According to some embodiments, each of the plurality of values is represented by a data item using a preset data format, and the decoding information further includes data format information indicating the original data format of the value corresponding to each of the plurality of original keys, and wherein the third determining unit is configured to: for each of the plurality of original keys, convert the data item of the preset data format corresponding to the original key into the original data format to obtain the original data.
[0100] According to some embodiments, the data item includes a first sub-element representing the length of the value corresponding to the data item and a second sub-element representing the value corresponding to the data item, and wherein, for each of the plurality of original keys, converting the data item corresponding to the original key in a preset data format into an original data format includes: determining a first length of the value corresponding to the data item based on the first sub-element in the data item; determining a second length of the second sub-element based on the first length; reading the second sub-element based on the second length; and converting the second sub-element into the original data format.
[0101] According to one aspect of this disclosure, a data transmission system is also provided, including the data transmitting device 400 as described above and the data receiving device 500 as described above.
[0102] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0103] According to another aspect of this disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform at least one of the above-described data transmission method and data reception method.
[0104] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to cause the computer to perform at least one of the above-described data transmission method and data reception method.
[0105] According to another aspect of this disclosure, a computer program product is also provided, comprising a computer program, wherein the computer program, when executed by a processor, implements at least one of the above-described data transmission method and data reception method.
[0106] refer to Figure 6 The present invention describes a structural block diagram of an electronic device 600 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0107] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0108] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, output unit 607, storage unit 608, and communication unit 609. Input unit 606 can be any type of device capable of inputting information to device 600. Input unit 606 can receive input numerical or character information and generate key signal inputs related to user settings and / or function control of the electronic device, and may include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 607 can be any type of device capable of presenting information, and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 608 may include, but is not limited to, a hard disk and an optical disk. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0109] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as at least one of the data transmission method and the data reception method. For example, in some embodiments, at least one of the data transmission method and the data reception method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of at least one of the data transmission method and the data reception method described above can be performed. Alternatively, in other embodiments, the computing unit 601 may be configured by any other suitable means (e.g., by means of firmware) to perform at least one of the data sending method and the data receiving method.
[0110] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0111] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0112] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0113] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0114] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0115] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0116] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0117] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited to these embodiments or examples. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. A data transmission method, comprising: Obtain the raw data to be sent, the raw data including multiple raw keys and the value corresponding to each of the multiple raw keys; Obtain encoding information for the original data, the encoding information including order information for the plurality of original keys, wherein the order information includes the permutation number of each of the plurality of original keys in a random sequence composed of the plurality of original keys, and wherein the data transmission method is implemented by a data transmission device, and the encoding information is obtained by applying a random mapping rule to the plurality of original keys using a tool deployed on the data transmission device; Based on the order information, a sequence consisting of the values corresponding to each of the plurality of original keys is determined to obtain the target data; and The target data is sent to a data receiving device so that the data receiving device can determine the original data based on the decoded information and the target data, wherein the decoded information includes the plurality of original keys and the order information, and the decoded information is obtained by applying the random mapping rules in the data sending device to the plurality of original keys using a tool deployed in the data receiving device.
2. The method of claim 1, wherein, The original data formats of the values corresponding to each of the plurality of original keys are not all the same. The step of determining the sequence of values corresponding to each of the plurality of original keys based on the order information to obtain the target data includes: For each of the plurality of original keys, the value corresponding to that original key is converted into a data item in a preset data format; and Based on the order information, the data items corresponding to each of the multiple original keys are concatenated to obtain the target data. Furthermore, the decoding information also includes data format information, which indicates the original data format of the value corresponding to each of the plurality of original keys, so that the data receiving device can determine the corresponding value of each data item based on the data format information.
3. The method as described in claim 2, wherein, The length of the value corresponding to each of the plurality of original keys is not all the same, and the step of converting the value corresponding to each of the plurality of original keys into a data item of a preset data format includes: For each of the plurality of primitive bonds, The first child element is determined based on the length of the value corresponding to the original key; Based on the value corresponding to the original key, determine the second child element; and Based on the first sub-element and the second sub-element, determine the data item corresponding to the original key.
4. The method according to any one of claims 1-3, wherein, The encoded information also includes an identifier corresponding to each of the plurality of original keys, and the values in the original data are modified using the following process: In response to receiving a data modification request for a target identifier, the target original key corresponding to the target identifier is determined based on the encoding information; as well as Based on the data modification request, modify the value corresponding to the target original key.
5. The method according to any one of claims 1-3, wherein, The encoded information further includes at least one virtual key, and the order information includes the permutation number of each of the plurality of original keys in a random sequence composed of the plurality of original keys and at least one virtual key. The method further includes: Randomly generate a value corresponding to each of the at least one virtual keys. Furthermore, the step of determining a sequence of values corresponding to each of the plurality of original keys based on the order information to obtain the target data includes: Based on the order information, a sequence consisting of the value corresponding to each of the plurality of original keys and the value corresponding to each of the at least one virtual key is determined to obtain the target data.
6. The method according to any one of claims 1-3, wherein, The encoded information and the decoded information are updated synchronously according to a preset time period.
7. A data receiving method, comprising: Receive target data from a data transmitting device, the target data comprising a plurality of values arranged in sequence; Obtain decoding information for the target data, wherein the decoding information includes multiple original keys and order information for the multiple original keys, and the decoding information is obtained by applying the random mapping rules in the data sending device to the multiple original keys using a tool deployed in the data receiving device; Based on the ordinal numbers of the multiple values in the sequence composed of the multiple values and the order information, a one-to-one mapping relationship between the multiple values and the multiple original keys is determined; and Based on the one-to-one mapping relationship between the plurality of values and the plurality of original keys, the original data corresponding to the target data is determined, wherein the original data includes the plurality of original keys and the value corresponding to each of the plurality of original keys.
8. The method of claim 7, wherein, Each of the plurality of values is represented using a data item with a preset data format. The decoding information also includes data format information, which indicates the original data format of the value corresponding to each of the plurality of original keys. Furthermore, determining the original data corresponding to the target data based on the one-to-one mapping relationship between the plurality of values and the plurality of original keys includes: For each of the plurality of original keys, the data item corresponding to the original key in the preset data format is converted into the original data format to obtain the original data.
9. The method of claim 8, wherein, The data item includes a first sub-element representing the length of the value corresponding to the data item and a second sub-element representing the value corresponding to the data item, wherein, for each of the plurality of original keys, converting the data item corresponding to the original key in the preset data format into the original data format includes: Based on the first child element in the data item, determine the first length of the value corresponding to the data item; Based on the first length, determine the second length of the second sub-element; Based on the second length, read the second sub-element; and Convert the second sub-element to the original data format.
10. A data transmission device, comprising: The first acquisition unit is configured to acquire raw data to be sent, the raw data including multiple raw keys and a value corresponding to each of the multiple raw keys; The second acquisition unit is configured to acquire encoding information for the original data, the encoding information including order information for the plurality of original keys, wherein the order information includes the permutation number of each of the plurality of original keys in a random sequence composed of the plurality of original keys, and the encoding information is obtained by applying a random mapping rule to the plurality of original keys using a tool deployed on the data transmission device. The first determining unit is configured to determine, based on the order information, a sequence consisting of the values corresponding to each of the plurality of original keys, to obtain target data; and The sending unit is configured to send the target data to the data receiving device so that the data receiving device can determine the original data based on the decoded information and the target data, wherein the decoded information includes the plurality of original keys and the order information, and the decoded information is obtained by applying a random mapping rule in the data sending device to the plurality of original keys using a tool deployed in the data receiving device.
11. The apparatus of claim 10, wherein, The original data format of the value corresponding to each of the plurality of original keys is not entirely the same, and the first determining unit includes: A conversion subunit is configured to convert the value corresponding to each of the plurality of original keys into a data item of a preset data format; and The splicing subunit is configured to splice the data items corresponding to each of the plurality of original keys based on the order information to obtain the target data. Furthermore, the decoding information also includes data format information, which indicates the original data format of the value corresponding to each of the plurality of original keys, so that the data receiving device can determine the corresponding value of each data item based on the data format information.
12. The apparatus of claim 11, wherein, The length of the value corresponding to each of the plurality of original keys is not all the same, and the transformation subunit is configured as follows: For each of the plurality of primitive bonds, The first child element is determined based on the length of the value corresponding to the original key; The second child element is determined based on the value corresponding to the original key; as well as Based on the first sub-element and the second sub-element, determine the data item corresponding to the original key.
13. The apparatus according to any one of claims 10-12, wherein, The encoded information also includes an identifier corresponding to each of the plurality of original keys, and the values in the original data are modified using the following process: In response to receiving a data modification request for a target identifier, the target original key corresponding to the target identifier is determined based on the encoding information; as well as Based on the data modification request, modify the value corresponding to the target original key.
14. The apparatus according to any one of claims 10-12, wherein, The encoded information further includes at least one virtual key, and the order information includes the permutation number of each of the plurality of original keys in a random sequence composed of the plurality of original keys and at least one virtual key. The device further includes: The generation unit is configured to randomly generate a value corresponding to each of the at least one virtual key. Furthermore, the first determining unit is configured as follows: Based on the order information, the value corresponding to each of the plurality of original keys and the value corresponding to each of the at least one virtual key are determined to obtain the target data.
15. The apparatus according to any one of claims 10-12, wherein, The encoded information and the decoded information are updated synchronously according to a preset time period.
16. A data receiving device, comprising: A receiving unit is configured to receive target data from a data transmitting device, the target data comprising a plurality of values arranged in sequence; The third acquisition unit is configured to acquire decoding information for the target data, wherein the decoding information includes multiple original keys and order information for the multiple original keys, and the decoding information is obtained by applying the random mapping rules in the data sending device to the multiple original keys using a tool deployed in the data receiving device; The second determining unit is configured to determine a one-to-one mapping relationship between the plurality of values and the plurality of original keys based on the ordinal numbers of the plurality of values in the sequence composed of the plurality of values and the order information; and The third determining unit is configured to determine the original data corresponding to the target data based on the one-to-one mapping relationship between the plurality of values and the plurality of original keys, wherein the original data includes the plurality of original keys and the value corresponding to each of the plurality of original keys.
17. The apparatus of claim 16, wherein, Each of the plurality of values is represented using a data item with a preset data format. The decoding information further includes data format information indicating the original data format of the value corresponding to each of the plurality of original keys. The third determining unit is configured to: For each of the plurality of original keys, the data item corresponding to the original key in the preset data format is converted into the original data format to obtain the original data.
18. The apparatus of claim 17, wherein, The data item includes a first sub-element representing the length of the value corresponding to the data item and a second sub-element representing the value corresponding to the data item, wherein, for each of the plurality of original keys, converting the data item corresponding to the original key in the preset data format into the original data format includes: Based on the first child element in the data item, determine the first length of the value corresponding to the data item; Based on the first length, determine the second length of the second sub-element; Based on the second length, read the second sub-element; and Convert the second sub-element to the original data format.
19. A data transmission system, comprising: The data transmission apparatus as described in any one of claims 10-15; as well as The data receiving apparatus as described in any one of claims 16-18.
20. An electronic device comprising: At least one processor; as well as A memory that is communicatively connected to the at least one processor; in The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
21. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-9.
22. A computer program product comprising a computer program, wherein, The computer program, when executed by a processor, implements the method according to any one of claims 1-9.
Citation Information
Patent Citations
Network data encoding and encrypting algorithm thereof
CN111490984A
Secure transmission method and device of network data, equipment and storage medium
CN115529192A