CN117857021A - Data communication method and device, electronic equipment and storage medium - Google Patents

Data communication method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117857021A
CN117857021A CN202310621493.XA CN202310621493A CN117857021A CN 117857021 A CN117857021 A CN 117857021A CN 202310621493 A CN202310621493 A CN 202310621493A CN 117857021 A CN117857021 A CN 117857021A
Authority
CN
China
Prior art keywords
ciphertext data
sub
data
network transmission
transmission channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310621493.XA
Other languages
Chinese (zh)
Inventor
吴交
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo Youxun Zhichuan Technology Co ltd
Original Assignee
Ningbo Youxun Zhichuan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ningbo Youxun Zhichuan Technology Co ltd filed Critical Ningbo Youxun Zhichuan Technology Co ltd
Priority to CN202310621493.XA priority Critical patent/CN117857021A/en
Publication of CN117857021A publication Critical patent/CN117857021A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a data communication method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of obtaining plaintext data, and encrypting the plaintext data based on a preset symmetric key to obtain ciphertext data; dividing the ciphertext data based on the byte length corresponding to the ciphertext data to obtain a plurality of sub ciphertext data; based on each piece of sub-ciphertext data, determining a network transmission channel corresponding to the sub-ciphertext data; the corresponding sub-ciphertext data is sent to the receiving end through each network transmission channel, so that the technical problem of low safety of data transmission in the communication process between devices in the prior art is solved, and the safety of the data in the transmission process is improved.

Description

Data communication method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a data communication method, apparatus, electronic device, and storage medium.
Background
With the development of the internet of things technology, the financial industry also begins to widely apply the internet of things technology. The gold-controlled internet of things is a combination of financial science and technology and internet of things technology, and provides intelligent, data-based and efficient services for the financial industry, such as intelligent payment, intelligent investment, intelligent wind control and the like. Since the financial industry involves a large amount of data transmission, the security and reliability of data becomes a critical issue.
In the prior art, in the scene of the gold control internet of things, security transmission loopholes exist in the communication process between devices, and by way of example, encryption is generally adopted for password type data in data, the importance of other types of data is ignored, and potential safety hazards exist in data transmission. In addition, the fixed network transmission channel is generally adopted to transmit the data, and the fixed network transmission channel is adopted to transmit the data, so that an attacker can easily master the rule of the data in the transmission process and find out the existing loopholes, and the attacker can steal the complete data and tamper the data by utilizing the loopholes, so that the security of the data transmitted between devices is abnormal and fragile.
Disclosure of Invention
In view of the foregoing, it is an object of the present application to provide a data communication method, apparatus, electronic device and storage medium, so as to overcome all or part of the disadvantages in the prior art.
Based on the above objects, the present application provides a data communication method, applied to a transmitting end, including: acquiring plaintext data, and encrypting the plaintext data based on a preset symmetric key to obtain ciphertext data; dividing the ciphertext data based on the byte length corresponding to the ciphertext data to obtain a plurality of sub ciphertext data; based on each piece of sub-ciphertext data, determining a network transmission channel corresponding to the sub-ciphertext data; and transmitting the corresponding sub-ciphertext data to the receiving end through each network transmission channel.
Optionally, before determining the network transmission channel corresponding to each sub-ciphertext data based on the sub-ciphertext data, the method includes: each sub-ciphertext data is numbered and signature encrypted.
Optionally, the dividing the ciphertext data based on the byte length corresponding to the ciphertext data to obtain a plurality of sub ciphertext data includes: dividing the ciphertext data according to a preset byte length to obtain a plurality of sub ciphertext data; and in response to determining that the byte length corresponding to the sub-ciphertext data is smaller than the preset byte length, performing byte stuffing on the sub-ciphertext data smaller than the preset byte length, so that the byte length of the stuffed sub-ciphertext data is equal to the preset byte length.
Optionally, the determining, based on each piece of sub-ciphertext data, a network transmission channel corresponding to the sub-ciphertext data includes: acquiring the current weight score of each network transmission channel; determining a selection probability corresponding to the associated network transmission channel based on each current weight score, wherein the current weight score is positively correlated with the selection probability; and determining a network transmission channel corresponding to the sub-ciphertext data based on each selection probability.
Optionally, after the corresponding sub-ciphertext data is sent to the receiving end through each network transmission channel, the method includes: determining the current transmission rate of the sub-ciphertext data transmitted through the network transmission channel; and updating the current weight score of the network transmission channel based on the current transmission rate.
Optionally, the updating the current weight score of the network transmission channel based on the current transmission rate includes: updating the current weight by the following formula:wherein w is the updated current weight, v t V for the current transmission rate tz Is the sum of the current transmission rates of all network transmission channels; and calculating the updated current weight score based on the updated current weight.
Based on the same inventive concept, the application provides a data communication method, which is applied to a receiving end and comprises the following steps: carrying out data integrity verification on each received sub-ciphertext data by using a cryptographic algorithm; in response to determining that the sub-ciphertext data passes data integrity verification, performing signature verification on the sub-ciphertext data; in response to determining that the sub-ciphertext data passes signature verification, combining all the sub-ciphertext data based on the number corresponding to each sub-ciphertext data to obtain ciphertext data; and decrypting the ciphertext data based on a preset symmetric key to obtain plaintext data.
Based on the same inventive concept, the present application further provides a data communication device, applied to a transmitting end, including: the encryption module is configured to acquire plaintext data, encrypt the plaintext data based on a preset symmetric key and obtain ciphertext data; the dividing module is configured to divide the ciphertext data based on the byte length corresponding to the ciphertext data to obtain a plurality of sub ciphertext data; a determining module configured to determine a network transmission channel corresponding to each sub-ciphertext data based on the sub-ciphertext data; the sending module is configured to send the corresponding sub-ciphertext data to the receiving end through each network transmission channel.
Based on the same inventive concept, the application also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable by the processor, the processor implementing the method as described above when executing the computer program.
Based on the same inventive concept, the present application also provides a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method as described above.
From the above, it can be seen that the data communication method, device, electronic equipment and storage medium provided by the present application obtain plaintext data, and encrypt the plaintext data based on a preset symmetric key to obtain ciphertext data, so that the plaintext data has confidentiality and is not easy to be revealed. Based on the byte length corresponding to the ciphertext data, the ciphertext data is divided to obtain a plurality of sub ciphertext data, so that the transmission rate is improved, the risk that the ciphertext data is completely intercepted is reduced, and the transmission safety is further improved. Based on each piece of sub-ciphertext data, a network transmission channel corresponding to the sub-ciphertext data is determined, so that the sub-ciphertext data is not easy to hijack by an attacker in the transmission process, and the safety of the data is ensured. And transmitting the corresponding sub-ciphertext data to the receiving end through each network transmission channel so as to complete the process of transmitting the data to the receiving end.
Drawings
In order to more clearly illustrate the technical solutions of the present application or related art, the drawings that are required to be used in the description of the embodiments or related art will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort to those of ordinary skill in the art.
Fig. 1 is a flow chart of a method for communicating data according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for communicating data according to another embodiment of the present application;
fig. 3 is a schematic structural diagram of a data communication device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data communication device according to another embodiment of the present application;
fig. 5 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings.
It should be noted that unless otherwise defined, technical or scientific terms used in the embodiments of the present application should be given the ordinary meaning as understood by one of ordinary skill in the art to which the present application belongs. The terms "first," "second," and the like, as used in embodiments of the present application, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", etc. are used merely to indicate relative positional relationships, which may also be changed when the absolute position of the object to be described is changed.
As described in the background section, in the prior art, in the scene of the gold control internet of things, potential safety hazards exist in data transmission between devices, the potential safety hazards include encrypting only password data in data to be transmitted, importance of other data is ignored, illustratively, in intelligent payment, data transmission between a payment terminal and a receipt system of a payment processing mechanism generally adopts encryption only for user password information, other transaction information adopts a plaintext transmission mode without encryption processing, but for important or sensitive data in the transaction data, especially information such as card numbers, card tracks and the like of cardholders, such as direct transmission on the internet without encryption, great risks and potential safety hazards exist. The potential safety hazard also comprises the step of adopting a fixed network transmission channel to transmit the data, and an attacker can steal the complete data after grasping the loophole of the data in the transmission process.
In view of this, an embodiment of the present application proposes a data communication method, referring to fig. 1, applied to a transmitting end, including the following steps:
step 101, obtaining plaintext data, and encrypting the plaintext data based on a preset symmetric key to obtain ciphertext data.
In this step, before the transmitting end transmits data to the receiving end, communication connection between the transmitting end and the receiving end needs to be established in advance, and symmetric keys are stored in both the transmitting end and the receiving end in the process of establishing communication connection, wherein the symmetric keys of the transmitting end and the receiving end are the same. After obtaining the plaintext data, the algorithm is used to determine a data abstract corresponding to the plaintext data, and the data abstract is sent to the receiving end in advance, and the algorithm may be, for example, a cryptographic algorithm. The plaintext data is unencrypted data to be transmitted, and if the plaintext data is directly transmitted, the plaintext data is not encrypted, so that the data is easy to leak, and the data security is further threatened. In addition, if only the password type data in the plaintext data is encrypted, the importance of other types of data is ignored, so that potential safety hazards exist in the transmission process of the partially encrypted plaintext data. Therefore, the plaintext data needs to be encrypted by using a preset symmetric key, and an algorithm adopted in the encryption process can be an SM4 algorithm in a national encryption algorithm, wherein the national encryption algorithm is a domestic encryption algorithm identified by a national code office, and the SM4 algorithm is a symmetric encryption algorithm. And the plaintext data is encrypted, so that the plaintext data has confidentiality and is not easy to leak.
And 102, dividing the ciphertext data based on the byte length corresponding to the ciphertext data to obtain a plurality of sub ciphertext data.
In this step, the complete ciphertext data is directly transmitted, so that not only is the transmission rate slow, but also the situation that the complete ciphertext data is intercepted by an attacker may exist. In order to avoid the problems, the ciphertext data is divided according to byte lengths corresponding to the ciphertext data to obtain a plurality of sub-ciphertext data, wherein each sub-ciphertext data carries version information, ciphertext data byte length information, number information and sub-ciphertext data byte length information. The method not only improves the transmission rate, but also reduces the risk of complete interception of ciphertext data, so that the transmission safety is further improved.
And step 103, determining a network transmission channel corresponding to each piece of sub-ciphertext data.
In this step, the sub-ciphertext data needs to be sent to the receiving end through a network transmission channel, where the network transmission channel may be, for example, 4G, 5G, WIFI, and the like. According to the method, various network transmission channels are deployed, the network transmission channel of each piece of sub-ciphertext data is not fixed, an attacker cannot know the network transmission channel for transmitting the sub-ciphertext data, and therefore cannot grasp the rule for transmitting the sub-ciphertext data and cannot find the existing security holes, so that the sub-ciphertext data is not easy to hijack by the attacker in the transmission process, and the security of the data is ensured.
Step 104, transmitting the corresponding sub-ciphertext data to the receiving end through each network transmission channel.
In this step, the transmitting end transmits the sub-ciphertext data to the receiving end through the network transmission channel, so as to complete the process of transmitting the data to the receiving end.
Through the scheme, the plaintext data is obtained and encrypted based on the preset symmetric key, so that ciphertext data is obtained, and the plaintext data has confidentiality and is not easy to leak. Based on the byte length corresponding to the ciphertext data, the ciphertext data is divided to obtain a plurality of sub ciphertext data, so that the transmission rate is improved, the risk that the ciphertext data is completely intercepted is reduced, and the transmission safety is further improved. Based on each piece of sub-ciphertext data, a network transmission channel corresponding to the sub-ciphertext data is determined, so that the sub-ciphertext data is not easy to hijack by an attacker in the transmission process, and the safety of the data is ensured. And transmitting the corresponding sub-ciphertext data to the receiving end through each network transmission channel so as to complete the process of transmitting the data to the receiving end.
In some embodiments, before determining a network transmission channel corresponding thereto based on each sub-ciphertext data, the method comprises: each sub-ciphertext data is numbered and signature encrypted.
In this embodiment, the ciphertext data is divided into a plurality of sub-ciphertext data, and each sub-ciphertext data needs to be numbered in order to ensure that the subsequent plurality of sub-ciphertext data are accurately combined into ciphertext data. The numbering distinguishes different sub-ciphertext data, wherein the numbering can be a distinguishing identifier such as a number or a letter, and the number is exemplified by numbering a plurality of sub-ciphertext data according to a byte length division sequence corresponding to the ciphertext data, so as to obtain sub-ciphertext data No. 1 and sub-ciphertext data No. 2. According to the serial numbers of the sub ciphertext data, the subsequent accurate synthesis ciphertext data can be ensured. And carrying out signature encryption on each piece of sub-ciphertext data, wherein an algorithm used in the signature encryption process can be an SM3 algorithm in a national encryption algorithm, and the SM3 algorithm is a password hash algorithm, so that each piece of sub-ciphertext data has confidentiality in the transmission process.
In some embodiments, the dividing the ciphertext data based on the byte length corresponding to the ciphertext data to obtain a plurality of sub-ciphertext data includes: dividing the ciphertext data according to a preset byte length to obtain a plurality of sub ciphertext data; and in response to determining that the byte length corresponding to the sub-ciphertext data is smaller than the preset byte length, performing byte stuffing on the sub-ciphertext data smaller than the preset byte length, so that the byte length of the stuffed sub-ciphertext data is equal to the preset byte length.
In this embodiment, the preset byte length is a byte length corresponding to the sub-ciphertext data set by the user according to the actual requirement, and the preset byte length may be 128 or 256, for example. Dividing ciphertext data according to a preset byte length may not be performed, that is, there is a remainder when the byte length corresponding to ciphertext data is divided by the preset byte length, so that the byte length corresponding to the last numbered sub-ciphertext data is smaller than the preset byte length, at this time, byte stuffing needs to be performed on the last numbered sub-ciphertext data, and illustratively, zero can be used for byte stuffing, so that the byte length of the stuffed sub-ciphertext data is equal to the preset byte length, and the useful bytes corresponding to the last numbered sub-ciphertext data cannot be changed, thereby ensuring the consistency of data.
In some embodiments, the determining, based on each piece of sub-ciphertext data, a network transmission channel corresponding to the sub-ciphertext data includes: acquiring the current weight score of each network transmission channel; determining a selection probability corresponding to the associated network transmission channel based on each current weight score, wherein the current weight score is positively correlated with the selection probability; and determining a network transmission channel corresponding to the sub-ciphertext data based on each selection probability.
In this embodiment, the sub-ciphertext data is transmitted to the receiving end through network transmission channels, each network transmission channel has a weight score, and the weight score associated with the network transmission channel determines the selection probability of the network transmission channel. For example, in the case where there are three network transmission channels, the weight score of 4G may be 25 points, and the corresponding selection probability may be 1/3; the weight score of 5G can be 50 points, and the corresponding selection probability can be 1/2; the weight score of the WIFI may be 15 scores, and the corresponding selection probability may be 1/6. It should be noted that, the network transmission channel corresponds to a selection probability, and the larger the current weight score is, the larger the selection probability of the network transmission channel corresponding to the current weight score is, but this does not mean that the network transmission channel with the small selection probability does not transmit data, and the transmission channel with the small selection probability also has a certain probability to transmit data. Further, it is necessary to set the initial selection probability of the network transmission channel in advance, and in the case where three kinds of network transmission channels exist, the initial selection probability of each network transmission channel is 1/3, for example. The initial selection probability of the network transmission channel can be updated by the weight score redetermined by the network transmission channel after the next transmission of the sub-ciphertext data. The sub-ciphertext data can be transmitted through any network transmission channel, and the hijack cannot know the network transmission channel of the sub-ciphertext data before, so that the sub-ciphertext data cannot be hijacked in a targeted manner, and the safety of the sub-ciphertext data in the transmission process is ensured.
In some embodiments, after transmitting the corresponding sub-ciphertext data to the receiving end via each network transmission channel, the method comprises: determining the current transmission rate of the sub-ciphertext data transmitted through the network transmission channel; and updating the current weight score of the network transmission channel based on the current transmission rate.
In this embodiment, the sub-ciphertext data is transmitted to the receiving end through the network transmission channel at a certain transmission rate, and the transmission rate determines the transmission efficiency of the completed data. Therefore, the network transmission channel with high transmission efficiency is necessary to be selected, so that the communication time between the sending end and the receiving end can be saved, and the efficiency of completing data transmission is further improved. The high current transmission rate of the network transmission channel indicates that the network of the network transmission channel is excellent and has no data congestion phenomenon, so that the current weight fraction can be updated by utilizing the current transmission rate of the network transmission channel, and then the selection probability of the corresponding network transmission channel is updated according to the current weight fraction, so that the network transmission channel with high transmission rate can be selected with high probability, and further the communication efficiency is improved.
In some embodiments, the updating the current weight score of the network transmission channel based on the current transmission rate includes: updating the current weight by the following formula:wherein the method comprises the steps ofW is the updated current weight, v t V for the current transmission rate tz Is the sum of the current transmission rates of all network transmission channels; and calculating the updated current weight score based on the updated current weight.
In this embodiment, the current transmission rate may be used to calculate the current weight, and thus calculate the current weight score, which is exemplary, where there are three network transmission channels, for example, 4G, 5G and WIFI, where the current weight of 4G isWherein w is 1 Current weight of 4G, v t1 Current transmission rate of 4G, v t2 Current transmission rate of 5G, v t3 The current transmission rate of the WIFI; the current weight of 5G is +.>Wherein w is 2 Current weight of 5G; the current weight of WIFI is +.>Wherein w is 3 Is the current weight of WIFI. The initial transmission rate needs to be set, and may be set according to historical experience, for example. The calculation result of the current weight is more accurate through specific formula calculation, and further the calculation result of the current weight score is more accurate.
The embodiment of the application provides a data communication method, referring to fig. 2, applied to a receiving end, including the following steps:
and step 201, performing data integrity verification on each piece of received sub-ciphertext data by using a cryptographic algorithm.
In this step, the sub-ciphertext data received by the receiving end may have abnormal data conditions such as stolen partial data, replaced partial data, and the like in the transmission process. Therefore, the integrity verification of each piece of received sub-ciphertext data is required by using a cryptographic algorithm, and the method comprises the following detailed steps: encrypting each piece of received sub-ciphertext data by using a state encryption algorithm to obtain a data abstract corresponding to each piece of sub-ciphertext data, judging whether the data abstract corresponding to each piece of sub-ciphertext data is matched with the data abstract sent by the sending end in advance, if the data abstract corresponding to the sub-ciphertext data can be matched with the data abstract sent by the sending end in advance, indicating that the sub-ciphertext data has data integrity, otherwise, indicating that the sub-ciphertext data does not have integrity, and further informing the sending end to resend the sub-ciphertext data by the receiving end, wherein the specific notification form can be as follows: and retransmitting the sub-ciphertext data with the number of 1. The algorithm for determining the data abstract between the receiving end and the sending end is the same.
It should be noted that, if the data integrity verification of all the sub-ciphertext data is completed, there is a data summary sent in advance by the sender that is not matched, which indicates that there is a situation that the whole sub-ciphertext data is lost, the numbers corresponding to the received sub-ciphertext data may be checked in sequence, where the number of the data summaries sent in advance by the sender that is not matched determines the number of the lost sub-ciphertext data. Firstly, checking whether a missing number exists, and if the missing number exists, informing a sending end to resend corresponding sub-ciphertext data of the missing number by a receiving end. In addition, whether the number of missing numbers is equal to the number of data digests sent by the unmatched sending end in advance is also determined, if the number of missing numbers is not equal to the number of data digests sent by the unmatched sending end in advance, the fact that the sub-ciphertext data after the last number received by the receiving end is lost is indicated, a difference value between the number of data digests sent by the unmatched sending end in advance and the number of missing numbers is calculated, and the receiving end needs to inform the sending end to send the sub-ciphertext data corresponding to n serial numbers before the reciprocal, wherein n is the difference value. The received sub-ciphertext data is ensured to have the integrity, and further the integrity of the ciphertext data of the subsequent combination can be ensured.
And step 202, in response to determining that the sub-ciphertext data passes the data integrity verification, performing signature verification on the sub-ciphertext data.
In this step, the sub-ciphertext data includes data to be transmitted and a signature, and signature encryption is performed on the data to be transmitted in the sub-ciphertext data, where a signature encryption algorithm of the receiving end is the same as a signature encryption algorithm of the transmitting end, and the signature encryption algorithms are all SM3 algorithms in the national encryption algorithm. And carrying out signature encryption on the data to be transmitted in the sub-ciphertext data to obtain a signature, and carrying out consistency verification on the signature and the signature of the sub-ciphertext data corresponding to the signature. If the consistency verification is passed, the fact that the sub-ciphertext data received by the receiving end is the sub-ciphertext data sent by the sending end is indicated, and accuracy of the received data is ensured.
And step 203, in response to determining that the sub-ciphertext data passes the signature verification, combining all the sub-ciphertext data based on the number corresponding to each sub-ciphertext data to obtain ciphertext data.
In the step, the numbers of the sub ciphertext data have sequence, the sub ciphertext data are combined according to the sequence of the numbers, ciphertext data can be obtained, and the integrity of the combined ciphertext data is ensured.
And step 204, decrypting the ciphertext data based on a preset symmetric key to obtain plaintext data.
In the step, before the transmitting end transmits the plaintext data, the transmitting end encrypts the plaintext data by using a preset symmetric key to obtain ciphertext data, so that the security of the data to be transmitted is primarily ensured. Therefore, after the receiving end obtains the ciphertext data, the receiving end also needs to decrypt the ciphertext data by using a preset symmetric key to obtain plaintext data, so that the communication process between the transmitting end and the receiving end is successfully completed.
By the scheme, the data integrity verification is carried out on each piece of received sub-ciphertext data by using the cryptographic algorithm, so that the received sub-ciphertext data is ensured to have integrity, and further the integrity of the ciphertext data of subsequent combination can be ensured. And in response to determining that the sub-ciphertext data passes the data integrity verification, performing signature verification on the sub-ciphertext data, thereby ensuring the accuracy of the received data. And in response to determining that the sub-ciphertext data passes signature verification, combining all the sub-ciphertext data based on the number corresponding to each sub-ciphertext data to obtain ciphertext data, thereby ensuring the integrity of the combined ciphertext data. And decrypting the ciphertext data based on a preset symmetric key to obtain plaintext data, so that the communication process between the transmitting end and the receiving end is successfully completed.
It should be noted that, the method of the embodiments of the present application may be performed by a single device, for example, a computer or a server. The method of the embodiment can also be applied to a distributed scene, and is completed by mutually matching a plurality of devices. In the case of such a distributed scenario, one of the devices may perform only one or more steps of the methods of embodiments of the present application, and the devices may interact with each other to complete the methods.
It should be noted that some embodiments of the present application are described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Based on the same inventive concept, the application also provides a data communication device corresponding to the method of any embodiment.
Referring to fig. 3, the data communication device, applied to a transmitting end, includes:
the encryption module 10 is configured to obtain plaintext data, and encrypt the plaintext data based on a preset symmetric key to obtain ciphertext data.
The dividing module 20 is configured to divide the ciphertext data based on the byte length corresponding to the ciphertext data, so as to obtain a plurality of sub-ciphertext data.
The determining module 30 is configured to determine, based on each piece of sub-ciphertext data, a network transmission channel corresponding thereto.
The sending module 40 is configured to send the corresponding sub-ciphertext data to the receiving end through each network transmission channel.
By the device, the plaintext data is obtained and encrypted based on the preset symmetric key, so that ciphertext data is obtained, and the plaintext data has confidentiality and is not easy to leak. Based on the byte length corresponding to the ciphertext data, the ciphertext data is divided to obtain a plurality of sub ciphertext data, so that the transmission rate is improved, the risk that the ciphertext data is completely intercepted is reduced, and the transmission safety is further improved. Based on each piece of sub-ciphertext data, a network transmission channel corresponding to the sub-ciphertext data is determined, so that the sub-ciphertext data is not easy to hijack by an attacker in the transmission process, and the safety of the data is ensured. And transmitting the corresponding sub-ciphertext data to the receiving end through each network transmission channel so as to complete the process of transmitting the data to the receiving end.
In some embodiments, a signature encryption module is further included, the signature encryption module being further configured to number and sign encrypt each sub-ciphertext data prior to determining a network transmission channel corresponding thereto based on each sub-ciphertext data.
In some embodiments, the dividing module 20 is further configured to divide the ciphertext data according to a preset byte length, so as to obtain a plurality of sub-ciphertext data; and in response to determining that the byte length corresponding to the sub-ciphertext data is smaller than the preset byte length, performing byte stuffing on the sub-ciphertext data smaller than the preset byte length, so that the byte length of the stuffed sub-ciphertext data is equal to the preset byte length.
In some embodiments, the determining module 30 is further configured to obtain a current weight score for each network transmission channel; determining a selection probability corresponding to the associated network transmission channel based on each current weight score, wherein the current weight score is positively correlated with the selection probability; and determining a network transmission channel corresponding to the sub-ciphertext data based on each selection probability.
In some embodiments, the system further includes an updating module, where the updating module is further configured to determine, after sending, through each network transmission channel, the corresponding sub-ciphertext data to the receiving end, a current transmission rate at which the sub-ciphertext data is transmitted through the network transmission channel; and updating the current weight score of the network transmission channel based on the current transmission rate.
In some embodiments, the updating module is further configured to update the current weight by:wherein w is the updated current weight, v t V for the current transmission rate tz Is the sum of the current transmission rates of all network transmission channels; and calculating the updated current weight score based on the updated current weight.
Based on the same inventive concept, the application also provides a data communication device corresponding to the method of any embodiment.
Referring to fig. 4, the data communication device, applied to a receiving end, includes:
the first verification module 50 is configured to perform data integrity verification on each piece of received sub-ciphertext data using a cryptographic algorithm.
A second verification module 60 configured to verify the signature of the sub-ciphertext data in response to determining that the sub-ciphertext data passes the data integrity verification.
The combining module 70 is configured to combine all the sub-ciphertext data based on the number corresponding to each sub-ciphertext data to obtain ciphertext data in response to determining that the sub-ciphertext data passes signature verification.
The decryption module 80 is configured to decrypt the ciphertext data based on a preset symmetric key, to obtain plaintext data.
By the device, the received sub-ciphertext data is ensured to have integrity by utilizing the cryptographic algorithm to perform data integrity verification on each piece of received sub-ciphertext data, so that the integrity of the ciphertext data of subsequent combination can be ensured. And in response to determining that the sub-ciphertext data passes the data integrity verification, performing signature verification on the sub-ciphertext data, thereby ensuring the accuracy of the received data. And in response to determining that the sub-ciphertext data passes signature verification, combining all the sub-ciphertext data based on the number corresponding to each sub-ciphertext data to obtain ciphertext data, thereby ensuring the integrity of the combined ciphertext data. And decrypting the ciphertext data based on a preset symmetric key to obtain plaintext data, so that the communication process between the transmitting end and the receiving end is successfully completed.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, the functions of each module may be implemented in the same piece or pieces of software and/or hardware when implementing the present application.
The device of the foregoing embodiment is configured to implement the corresponding data communication method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Based on the same inventive concept, the application also provides an electronic device corresponding to the method of any embodiment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the data communication method of any embodiment when executing the program.
Fig. 5 shows a more specific hardware architecture of an electronic device according to this embodiment, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 implement communication connections therebetween within the device via a bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit ), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. Memory 1020 may store an operating system and other application programs, and when the embodiments of the present specification are implemented in software or firmware, the associated program code is stored in memory 1020 and executed by processor 1010.
The input/output interface 1030 is used to connect with an input/output module for inputting and outputting information. The input/output module may be configured as a component in a device (not shown in the figure) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
Communication interface 1040 is used to connect communication modules (not shown) to enable communication interactions of the present device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 1050 includes a path for transferring information between components of the device (e.g., processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
It should be noted that although the above-described device only shows processor 1010, memory 1020, input/output interface 1030, communication interface 1040, and bus 1050, in an implementation, the device may include other components necessary to achieve proper operation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present description, and not all the components shown in the drawings.
The electronic device of the foregoing embodiment is configured to implement the corresponding data communication method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Based on the same inventive concept, corresponding to any of the above embodiments of the method, the present application further provides a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method for communication of data as described in any of the above embodiments.
The computer readable media of the present embodiments, including both permanent and non-permanent, removable and non-removable media, may be used to implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device.
The storage medium of the foregoing embodiments stores computer instructions for causing the computer to perform the method for communicating data according to any of the foregoing embodiments, and has the advantages of the corresponding method embodiments, which are not described herein.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to suggest that the scope of the application (including the claims) is limited to these examples; the technical features of the above embodiments or in the different embodiments may also be combined within the idea of the present application, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of brevity.
Additionally, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures, in order to simplify the illustration and discussion, and so as not to obscure the embodiments of the present application. Furthermore, the devices may be shown in block diagram form in order to avoid obscuring the embodiments of the present application, and this also takes into account the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform on which the embodiments of the present application are to be implemented (i.e., such specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the application, it should be apparent to one skilled in the art that embodiments of the application can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative in nature and not as restrictive.
While the present application has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of those embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
The present embodiments are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Accordingly, any omissions, modifications, equivalents, improvements and/or the like which are within the spirit and principles of the embodiments are intended to be included within the scope of the present application.

Claims (10)

1. A method for communicating data, applied to a transmitting end, comprising:
acquiring plaintext data, and encrypting the plaintext data based on a preset symmetric key to obtain ciphertext data;
dividing the ciphertext data based on the byte length corresponding to the ciphertext data to obtain a plurality of sub ciphertext data;
based on each piece of sub-ciphertext data, determining a network transmission channel corresponding to the sub-ciphertext data;
and transmitting the corresponding sub-ciphertext data to the receiving end through each network transmission channel.
2. The method of claim 1, wherein prior to determining a network transmission channel corresponding thereto based on each sub-ciphertext data, the method comprises:
each sub-ciphertext data is numbered and signature encrypted.
3. The method of claim 1, wherein the dividing the ciphertext data based on the byte length corresponding to the ciphertext data to obtain the plurality of sub-ciphertext data comprises:
dividing the ciphertext data according to a preset byte length to obtain a plurality of sub ciphertext data;
and in response to determining that the byte length corresponding to the sub-ciphertext data is smaller than the preset byte length, performing byte stuffing on the sub-ciphertext data smaller than the preset byte length, so that the byte length of the stuffed sub-ciphertext data is equal to the preset byte length.
4. The method of claim 1, wherein the determining a network transmission channel corresponding to each piece of sub-ciphertext data based on the sub-ciphertext data comprises:
acquiring the current weight score of each network transmission channel;
determining a selection probability corresponding to the associated network transmission channel based on each current weight score, wherein the current weight score is positively correlated with the selection probability;
and determining a network transmission channel corresponding to the sub-ciphertext data based on each selection probability.
5. The method according to claim 1, wherein after transmitting the corresponding sub-ciphertext data to the receiving end via each network transmission channel, the method comprises:
determining the current transmission rate of the sub-ciphertext data transmitted through the network transmission channel;
and updating the current weight score of the network transmission channel based on the current transmission rate.
6. The method of claim 5, wherein updating the current weight score of the network transmission channel based on the current transmission rate comprises:
updating the current weight by the following formula:
wherein w is the updated current weight, v t V for the current transmission rate tz Is the sum of the current transmission rates of all network transmission channels;
and calculating the updated current weight score based on the updated current weight.
7. A method for communicating data, applied to a receiving end, comprising:
carrying out data integrity verification on each received sub-ciphertext data by using a cryptographic algorithm;
in response to determining that the sub-ciphertext data passes data integrity verification, performing signature verification on the sub-ciphertext data;
in response to determining that the sub-ciphertext data passes signature verification, combining all the sub-ciphertext data based on the number corresponding to each sub-ciphertext data to obtain ciphertext data;
and decrypting the ciphertext data based on a preset symmetric key to obtain plaintext data.
8. A data communication device, applied to a transmitting end, comprising:
the encryption module is configured to acquire plaintext data, encrypt the plaintext data based on a preset symmetric key and obtain ciphertext data;
the dividing module is configured to divide the ciphertext data based on the byte length corresponding to the ciphertext data to obtain a plurality of sub ciphertext data;
a determining module configured to determine a network transmission channel corresponding to each sub-ciphertext data based on the sub-ciphertext data;
the sending module is configured to send the corresponding sub-ciphertext data to the receiving end through each network transmission channel.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 7 when the program is executed by the processor.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 7.
CN202310621493.XA 2023-05-29 2023-05-29 Data communication method and device, electronic equipment and storage medium Pending CN117857021A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310621493.XA CN117857021A (en) 2023-05-29 2023-05-29 Data communication method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310621493.XA CN117857021A (en) 2023-05-29 2023-05-29 Data communication method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117857021A true CN117857021A (en) 2024-04-09

Family

ID=90529875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310621493.XA Pending CN117857021A (en) 2023-05-29 2023-05-29 Data communication method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117857021A (en)

Similar Documents

Publication Publication Date Title
AU2021203184B2 (en) Transaction messaging
CN112291190B (en) Identity authentication method, terminal and server
CN110460439A (en) Information transferring method, device, client, server-side and storage medium
CN108780548A (en) Using Elliptic Curve Cryptography for Personal Device Security to Share Secrets
CN109688098B (en) Method, device and equipment for secure communication of data and computer readable storage medium
CN109818741B (en) Decryption calculation method and device based on elliptic curve
CN111127015B (en) Transaction data processing method and device, trusted application and electronic device
CN113573304A (en) Signature realization method, signature verification method, signature terminal, signature verification terminal and storage medium
EP3133791B1 (en) Double authentication system for electronically signed documents
CN117220865A (en) Longitude and latitude encryption method, longitude and latitude verification device and readable storage medium
CN110048994A (en) A kind of communication means and device
CN113794706B (en) Data processing method and device, electronic equipment and readable storage medium
KR20120091618A (en) Digital signing system and method using chained hash
JP2012226711A (en) Information processing apparatus and information processing method
EP3785399B1 (en) Method for generating on-board a cryptographic key using a physically unclonable function
CN110287733B (en) File tamper-proofing method and device
CN116634424A (en) Information processing method and device, storage medium, electronic equipment and vehicle
CN116823257A (en) Information processing method, device, equipment and storage medium
CN114745207B (en) Data transmission method, device, equipment, computer readable storage medium and product
CN115909560A (en) Data encryption method, data decryption method and door lock system
CN117857021A (en) Data communication method and device, electronic equipment and storage medium
CN114584355A (en) Security authentication method, device and system for digital currency transaction
CN114117388A (en) Device registration method, device registration apparatus, electronic device, and storage medium
CN110995749A (en) Block chain encryption method and device, electronic equipment and storage medium
CN115516454B (en) Hardware security module and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination