Data transmission method and system
By using the identification information of the receiving device and the request transmission timestamp to generate a key matrix, the data in the industrial communication system is encrypted and decrypted, which solves the problem of insufficient security of encryption methods in the existing technology and improves the reliability of the communication system. and security.
Patent Information
- Application Number
- CN202111115301.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-23
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-09-23
AI Technical Summary
Encryption methods in existing industrial communication systems are less secure, less targeted, prone to brute force decryption, and have poor communication reliability, making data easily tampered with or stolen during transmission, causing security accidents and economic losses.
By obtaining the identification information of the receiving device and the request sending timestamp, a key matrix is generated to encrypt and decrypt the data to be sent, thereby achieving the security and versatility of data transmission and improving communication reliability.
It achieves the security of data transmission and the unity and versatility of the encryption and decryption process, enhances the reliability of the communication system, prevents data leakage and tampering, and improves the security of communication with industrial equipment.
Smart Images

Figure CN113890730B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a data transmission method and system. Background Art
[0002] With the development of science and technology, the application of Internet technology and communication technology in industrial equipment is becoming more and more common. Industrial equipment also needs to transmit data to each other during normal operation. The security of data in the process of data transmission between the host computer and the slave computer has also attracted much attention. In the current industrial communication system, there are many types of equipment, large amount of communication data, low data security and other problems. However, the reliability of communication data determines the operation of the entire communication system. If the communication data is maliciously tampered with or deliberately stolen during the transmission process, it will cause serious harm to the entire industrial system, may cause safety accidents, and cause economic losses. Therefore, it is necessary to process the communication process between the host computer and the slave computer.
[0003] In current industrial equipment, there are many types of communication methods between the host and slave computers, which makes it difficult to encrypt them in a unified way. In addition, the existing encryption methods have low security, poor pertinence, are easily subject to brute force decryption, and have poor reliability. Summary of the invention
[0004] The present invention provides a data transmission method and system to solve the defects of the encryption method in the prior art, such as low security, weak pertinence, susceptibility to violent decryption, and poor reliability, so as to achieve the security of data transmission, realize the uniformity and universality of the encryption and decryption process, and improve the communication reliability.
[0005] The present invention provides a data transmission method, which comprises:
[0006] Obtain identification information of the receiving device and a request sending timestamp of the data to be sent;
[0007] Determining key information based on the identification information and the request sending timestamp;
[0008] Based on the key information, encrypt the data to be sent to obtain ciphertext data;
[0009] The ciphertext data is sent to a receiving device.
[0010] According to the data transmission method provided by the present invention, determining the key information based on the identification information and the request sending timestamp includes:
[0011] A key matrix is generated based on the identification information and the request sending timestamp, and the key matrix is used as the key information.
[0012] According to the data transmission method provided by the present invention, encrypting the data to be sent based on the key information to obtain ciphertext data includes:
[0013] Converting the data to be sent into a plaintext matrix;
[0014] Multiplying the key matrix by the plaintext matrix to obtain the ciphertext matrix;
[0015] The ciphertext data is generated according to the ciphertext matrix.
[0016] According to the data transmission method provided by the present invention, the key matrix is an N-order matrix, and the number of columns of the key matrix is the same as the number of rows of the plaintext matrix; the identification information is at least one of the device number, unit identifier or communication frame ID of the receiving device;
[0017] Before converting the data to be sent into a plaintext matrix, the method further includes performing a base conversion on the data to be sent.
[0018] The present invention also provides a data transmission method, which comprises:
[0019] Receive ciphertext data;
[0020] Determining key information based on identification information of the receiving device and a timestamp of the request transmission;
[0021] Based on the key information, the ciphertext data is decrypted to obtain plaintext data.
[0022] According to the data transmission method provided by the present invention, determining the key information based on the identification information and the request sending timestamp includes:
[0023] Generate a key matrix based on the identification information and the request sending timestamp, and use the key matrix as the key information;
[0024] The decrypting the ciphertext data based on the key information includes:
[0025] Converting the ciphertext data into a ciphertext matrix; multiplying the inverse matrix of the key matrix by the ciphertext matrix to generate a plaintext matrix; generating the plaintext data according to the plaintext matrix;
[0026] The identification information is at least one of a device number, a unit identifier or a communication frame ID of the receiving device.
[0027] The present invention also provides a data transmission system, the data transmission system comprising:
[0028] An acquisition module, used to acquire identification information of a receiving device and a request sending timestamp of data to be sent;
[0029] A first determining module, configured to determine key information based on the identification information and the request sending timestamp;
[0030] An encryption module, used to encrypt the data to be sent based on the key information to obtain ciphertext data;
[0031] The sending module is used to send the ciphertext data to a receiving device.
[0032] The present invention also provides a data transmission system, the data transmission system comprising:
[0033] A receiving module, used for receiving ciphertext data;
[0034] A second determination module, configured to determine key information based on identification information of a receiving device and a request sending timestamp;
[0035] The decryption module is used to decrypt the ciphertext data based on the key information to obtain plaintext data.
[0036] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the data transmission method between the host computer and the slave computer as described in any one of the above are implemented.
[0037] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the data transmission method between the upper computer and the lower computer as described in any one of the above are implemented.
[0038] The data transmission method and system provided by the present invention, during the data transmission process, the sending device uses the identification information of the receiving device and the request sending timestamp to obtain key information, and uses the key information to encrypt the data to be sent, which is convenient for the receiving device to decrypt, can achieve the security of data transmission, realize the uniformity and universality of the encryption and decryption process, and improve the communication reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1It is one of the flowcharts of the data transmission method provided by the present invention;
[0041] Figure 2 It is a schematic diagram of the interaction process between a sending device and a receiving device in the data transmission method provided by the present invention;
[0042] Figure 3 It is one of the structural schematic diagrams of the data transmission system provided by the present invention;
[0043] Figure 4 This is the second flow chart of the data transmission method provided by the present invention;
[0044] Figure 5 This is the second structural diagram of the data transmission system provided by the present invention;
[0045] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] Combine the following Figures 1 to 6 The data transmission method and system of the present invention are described.
[0048] like Figure 1 As shown, the present invention provides a data transmission method, which can be applied to a sending device.
[0049] It should be noted that if Figure 2 As shown, the sending device and the receiving device are communicatively connected, and the sending device can send data to the receiving device, wherein the sending device can be one of the upper computer or the lower computer, and the receiving device can be the other of the upper computer or the lower computer.
[0050] Generally speaking, the controller and the service provider are the upper computer, and the controlled and the serviced are the lower computer. It can also be understood as the relationship between the host and the slave. However, the upper computer and the lower computer can be converted. The upper computer can send data to the lower computer, and the lower computer can also send data to the upper computer.
[0051] like Figure 1 As shown, the data transmission method includes the following steps 110 to 140.
[0052] Step 110: Obtain identification information of the receiving device and a request sending timestamp of the data to be sent.
[0053] It can be understood that the identification information of the receiving device is used to distinguish the receiving device. It can be pre-assigned to the receiving device by the system and stored in the storage module of the receiving device, or it can be allocated to the receiving device in real time based on the communication process between the sending device and the receiving device.
[0054] In some embodiments, the identification information includes at least one of a device number, a unit identifier, or a communication frame ID.
[0055] The specific type of identification information may depend on the communication protocol between the upper computer and the lower computer. For example, if a ModbusRTU-type protocol is used, the device number is used as the identification information of the receiving device; if a ModbusTCP / IP-type protocol is used, the unit identifier is used as the identification information of the receiving device; if a CAN protocol is used, the communication frame ID is used as the identification information of the receiving device.
[0056] The specific type of identification information is not limited here, and it only needs to be able to distinguish the receiving device.
[0057] The data to be sent is the information that the sending device wants to send to the receiving device. For example, when the upper computer is the sending device and the lower computer is the receiving device, the data to be sent may be the control instructions sent by the upper computer to the lower computer; for example, when the lower computer is the sending device and the upper computer is the receiving device, the data to be sent may be the feedback information sent by the lower computer to the upper computer.
[0058] When the receiving device gives a sending request to the sending device, the sending device will prepare to send the data to be sent, and the time when the sending request is given to the sending device can be recorded as the request sending timestamp.
[0059] In some embodiments, the above-mentioned request to send timestamp can use seconds as the smallest time unit. The request to send timestamp will be recorded in both the receiving device and the sending device. When the receiving device gives a sending request to the sending device, the sending device also receives the identification information of the receiving device. That is to say, the identification information and the request to send timestamp are recorded in both the receiving device and the sending device.
[0060] Step 120: Determine key information based on the identification information and the request sending timestamp.
[0061] It can be understood that the identification information and the request sending timestamp can be combined according to the first preset rule to obtain the key information. The key information is the integration of the identification information and the request sending timestamp. The key information can be used to encrypt and decrypt specific data. Since the identification information and the request sending timestamp are recorded in both the receiving device and the sending device, the key information can be generated in both the receiving device and the sending device.
[0062] As for the first preset rule for obtaining the key information according to the identification information and the request sending timestamp, it is not specifically limited here, and those skilled in the art can customize it according to feasible rules. Preferably, according to the first preset rule, an N-order matrix can be generated based on the identification information and the request sending timestamp as the key information.
[0063] Step 130: Encrypt the data to be sent based on the key information to obtain ciphertext data.
[0064] It is understandable that the key information can be used to encrypt the data to be sent. For example, according to the idea of Hill encryption, ciphertext data can be obtained. Other encryption algorithms such as DES (Data Encryption Standard, symmetric algorithm) or IDEA (International Data Encryption Algorithm, international data encryption algorithm) can also be used to encrypt the data to be sent through key information to obtain ciphertext data. The specific encryption algorithm is not limited here, and technical personnel in this field can choose a feasible algorithm to implement it.
[0065] Step 140: Send the encrypted data to the receiving device;
[0066] It is understandable that the sending device can send the ciphertext data to the receiving device, and the sending device and the receiving device can communicate using ModbusRTU type protocol, ModbusTCP / IP type protocol or CAN protocol.
[0067] In addition, as for the receiving device, after it receives the ciphertext data, it can obtain the key information based on the identification information recorded in the receiving device and the request sending timestamp, and use the key information to decrypt the ciphertext data, perform data verification, and obtain the data to be sent.
[0068] In this way, the encrypted transmission of the data to be sent is realized, and the encrypted transmission of the data volume is realized during the communication process between the upper computer and the lower computer, which can avoid the risk of data leakage.
[0069] Since the identification information and request sending timestamp exist in various models of host and slave computers and are easy to be recorded, they can be easily obtained in various scenarios. Using the combination of identification information and request sending timestamp as key information can expand the scope of applicable scenarios of the encryption and decryption process and achieve the uniformity and universality of the encryption and decryption process.
[0070] It is worth noting that after receiving the ciphertext data, if the receiving device is not the receiving device corresponding to the identification information, the key information generated by the receiving device cannot correctly decrypt the ciphertext data, and the data verification process will fail. There may be two situations for this verification failure: the first situation is that the receiving device is not the correct target receiving device, and the ciphertext data can be directly discarded; the second situation is that the ciphertext data has been tampered with during the communication transmission process, and the correct ciphertext data cannot be obtained at this time, and then the receiving device cannot decrypt and obtain the correct data to be sent. Both the first and second situations are normal situations and do not hinder the feasibility of the encryption and decryption process of the data transmission method. After the verification fails, the sending device should resend the ciphertext data to the correct receiving device.
[0071] The data transmission method provided by the present invention, during the data transmission process, the sending device uses the identification information of the receiving device and the request sending timestamp to obtain key information, and uses the key information to encrypt the data to be sent, which is convenient for the receiving device to decrypt, can achieve the security of data transmission, realize the uniformity and universality of the encryption and decryption process, and improve the communication reliability.
[0072] In some embodiments, the above step 120, determining the key information based on the identification information and the request sending timestamp, includes: generating an N-order matrix as a key matrix based on the identification information and the request sending timestamp, and using the key matrix as the key information.
[0073] For example, the identification information of the receiving device is device number 01, and the request sending timestamp is "11:22:33". According to the first preset rule, the above identification information and the request sending timestamp are configured into the following 2-order key matrix:
[0074]
[0075] The key matrix K is used as key information to encrypt the data to be sent; wherein the first preset rule can be customized as long as it is ensured that the key matrix can be configured into an N-order matrix.
[0076] In some embodiments, the above step 130, based on the key information, encrypts the data to be sent to obtain ciphertext data, including: converting the data to be sent into a plaintext matrix, wherein the number of columns of the key matrix is the same as the number of rows of the plaintext matrix; multiplying the key matrix by the plaintext matrix to obtain a ciphertext matrix.
[0077] It can be understood that if the data to be sent is in decimal format, the data to be sent can be directly converted into a plaintext matrix.
[0078] If the data to be sent is in other format, such as hexadecimal format, the data to be sent may be first converted into decimal format and then converted into a plaintext matrix.
[0079] For example, if the data to be sent is hexadecimal data "01 03 00 00 00 0A C5 CD", the data to be sent can be first converted into decimal data "1 3 0 0 0 10 197 205", and then the decimal data is converted into a plaintext matrix according to the second preset rule:
[0080]
[0081] Among them, the above-mentioned second preset rule can be customized, as long as the number of rows of the generated plaintext matrix is ensured to be the same as the number of columns of the key matrix; then the key matrix is multiplied by the plaintext matrix to obtain the ciphertext matrix, and then the ciphertext matrix is converted into hexadecimal format data, that is, the ciphertext data.
[0082] For example: The ciphertext matrix can be
[0083]
[0084] The ciphertext matrix Y is then restored to the hexadecimal ciphertext data "4D 24 00 00DC 0A 1A-15 1A-32" according to the second preset rule and the base conversion algorithm, and the sending device can send the ciphertext data to the receiving device.
[0085] As for the receiving device, after receiving the ciphertext data, the ciphertext data can be restored to the ciphertext matrix Y, and then the key matrix K is obtained according to the request sending timestamp and the identification information of the receiving device, and then according to the formula K -1 ×Y=K -1 ×K×X=X, a plaintext matrix X is obtained, which is then converted into hexadecimal data to be sent. The data transmission system provided by the present invention is described below, and the data transmission system described below and the data transmission method described above can be referred to each other.
[0086] like Figure 3As shown, the present invention provides a data transmission system, which can be applied to a sending device.
[0087] The data transmission system includes: an acquisition module 310 , a first determination module 320 , an encryption module 330 and a sending module 340 .
[0088] The acquisition module 310 is used to acquire the identification information of the receiving device and the request sending timestamp of the data to be sent.
[0089] The first determination module 320 is configured to determine key information based on the identification information and the request sending timestamp.
[0090] The encryption module 330 is used to encrypt the data to be sent based on the key information to obtain ciphertext data.
[0091] The sending module 340 is used to send the encrypted data to the receiving device.
[0092] like Figure 4 As shown, the present invention also provides a data transmission method, which can be applied to a receiving device.
[0093] It should be noted that the sending device and the receiving device are communicatively connected, and the sending device can send data to the receiving device, wherein the sending device can be one of the upper computer or the lower computer, and the receiving device can be the other of the upper computer or the lower computer.
[0094] like Figure 4 As shown, the data transmission method includes the following steps 410 to 430.
[0095] Step 410: Receive ciphertext data.
[0096] Step 420: Determine key information based on the identification information of the receiving device and the request sending timestamp.
[0097] It is understandable that after receiving the ciphertext data, the receiving device can obtain the key information according to the identification information recorded in the receiving device and the request sending timestamp. The identification information of the receiving device is used to distinguish the receiving device, and can be pre-assigned to the receiving device by the system and stored in the storage module of the receiving device, or can be allocated to the receiving device in real time based on the communication process between the sending device and the receiving device.
[0098] In some embodiments, the identification information includes at least one of a device number, a unit identifier, or a communication frame ID.
[0099] The specific type of identification information may depend on the communication protocol between the upper computer and the lower computer. For example, if a ModbusRTU-type protocol is used, the device number is used as the identification information of the receiving device; if a ModbusTCP / IP-type protocol is used, the unit identifier is used as the identification information of the receiving device; if a CAN protocol is used, the communication frame ID is used as the identification information of the receiving device.
[0100] The specific type of identification information is not limited here, and it only needs to be able to distinguish the receiving device.
[0101] When the receiving device gives a sending request to the sending device, the sending device will prepare to send the data to be sent, and the time when the sending request is given to the sending device can be recorded as the request sending timestamp.
[0102] In some embodiments, the above-mentioned request to send timestamp can use seconds as the smallest time unit. The request to send timestamp will be recorded in both the receiving device and the sending device. When the receiving device gives a sending request to the sending device, the sending device also receives the identification information of the receiving device. That is to say, the identification information and the request to send timestamp are recorded in both the receiving device and the sending device.
[0103] In this way, both the sending device and the receiving device can generate key information according to the first preset rule based on the above identification information and the request sending timestamp, so as to encrypt or decrypt the data. Among them, the above first preset rule can be customized by a person skilled in the art according to a feasible rule. Preferably, according to the preset rule, an N-order matrix is generated based on the above identification information and the above request sending timestamp as the above key information.
[0104] Step 430: Decrypt the ciphertext data based on the key information to obtain the plaintext data.
[0105] It is understandable that the receiving device can use the key information to decrypt the ciphertext data to obtain the data to be sent.
[0106] In some embodiments, after receiving the ciphertext data, the receiving device generates a ciphertext matrix Y from the ciphertext data according to the second preset rule, and then obtains a plaintext matrix X according to the key matrix K and the ciphertext matrix Y, and then restores the plaintext matrix to plaintext data according to the second preset rule; the plaintext data is actually the encryption object of the sending device, that is, the data to be sent. The second preset rule can be customized.
[0107] Preferably, according to the second preset rule, the ciphertext matrix can be configured as a matrix with the same number of rows as the number of columns of the key matrix. The inverse matrix of the key matrix K is multiplied by the ciphertext matrix to obtain the plaintext matrix X. The specific calculation formula is K-1 ×Y=K -1 ×K×X=X.
[0108] It is worth noting that after receiving the ciphertext data, if the receiving device is not the receiving device corresponding to the identification information, the key information generated by the receiving device cannot correctly decrypt the ciphertext data, and the data verification process will fail. There may be two situations for this verification failure: the first situation is that the receiving device is not the correct target receiving device, and the ciphertext data can be directly discarded; the second situation is that the ciphertext data has been tampered with during the communication transmission process, and the correct ciphertext data cannot be obtained at this time, and then the receiving device cannot decrypt and obtain the correct data to be sent. Both the first and second situations are normal situations and do not hinder the feasibility of the encryption and decryption process of the data transmission method. After the verification fails, the sending device should resend the ciphertext data to the correct receiving device.
[0109] The data transmission method provided by the present invention, during the data transmission process, the sending device uses the identification information of the receiving device and the request sending timestamp to obtain key information, and uses the key information to encrypt the data to be sent, which is convenient for the receiving device to decrypt, can achieve the security of data transmission, realize the uniformity and universality of the encryption and decryption process, and improve the communication reliability.
[0110] In some embodiments, the ciphertext data is decimal data, which can be directly converted into a ciphertext matrix according to a second preset rule.
[0111] If the ciphertext data is in other base formats, such as hexadecimal format, the ciphertext data may be first converted into decimal format data and then converted into a ciphertext matrix.
[0112] For example, the identification information of the receiving device is device number 01, and the request sending timestamp is "11:22:33". According to the first preset rule, the above identification information and the request sending timestamp are configured into the following 2-order key matrix:
[0113]
[0114] The received ciphertext data is hexadecimal data "4D 24 00 00DC 0A 1A-15 1A-32", which is converted into a ciphertext matrix according to the second preset rule and the hexadecimal conversion algorithm:
[0115]
[0116] Then multiply the inverse matrix of the key matrix by the ciphertext matrix to obtain the plaintext matrix X;
[0117]
[0118] Then, according to the second preset rule and the base conversion algorithm, the plaintext matrix X is restored into plaintext data, namely, the hexadecimal data "01 03 00 00 00 0A C5 CD"; the plaintext data is the original data to be sent.
[0119] The data transmission system provided by the present invention is described below. The data transmission system described below and the data transmission method described above can be referenced to each other.
[0120] like Figure 5 As shown, the present invention further provides a data transmission system, which includes: a receiving module 510, a second determining module 520 and a decryption module 530.
[0121] The receiving module 510 is used to receive ciphertext data.
[0122] The second determination module 520 is configured to determine key information based on the identification information of the receiving device and the request sending timestamp.
[0123] The decryption module 530 is used to decrypt the ciphertext data based on the key information to obtain the plaintext data.
[0124] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the data transmission method, which includes: obtaining the identification information of the receiving device and the request sending timestamp of the data to be sent; determining the key information based on the identification information and the request sending timestamp; encrypting the data to be sent based on the key information to obtain the ciphertext data; and sending the ciphertext data to the receiving device.
[0125] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0126] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the data transmission method provided by the above methods, which method includes: obtaining identification information of a receiving device and a request to send timestamp of data to be sent; determining key information based on the identification information and the request to send timestamp; encrypting the data to be sent based on the key information to obtain ciphertext data; and sending the ciphertext data to the receiving device.
[0127] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the data transmission method provided by the above-mentioned methods, the method comprising: obtaining identification information of a receiving device and a request sending timestamp of data to be sent; determining key information based on the identification information and the request sending timestamp; encrypting the data to be sent based on the key information to obtain ciphertext data; and sending the ciphertext data to the receiving device.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data transmission method, characterized in that: include: Acquire identification information of a receiving device and a request sending timestamp of data to be sent, wherein the identification information is allocated to the receiving device in real time during the communication between the sending device and the receiving device, and the specific type of the identification information depends on the communication protocol between the sending device and the receiving device, and the identification information is at least one of a device number, a unit identifier, or a communication frame ID of the receiving device; the sending device and the receiving device both record the identification information and the request sending timestamp; According to a first preset rule, the identification information and the request sending timestamp are configured into an N-order key matrix, where the key matrix is used to represent the key information; Converting the data to be sent into a plaintext matrix; The key matrix is multiplied by the plaintext matrix to obtain a ciphertext matrix, and the calculation formula of the ciphertext matrix is: Y=K×X, where Y represents the ciphertext matrix; K represents the key matrix; and X represents the plaintext matrix; Generate ciphertext data according to the ciphertext matrix; The ciphertext data is sent to the receiving device.
2. The data transmission method according to claim 1, characterized in that: The number of columns of the key matrix is the same as the number of rows of the plaintext matrix; Before converting the data to be sent into a plaintext matrix, the method further includes performing a base conversion on the data to be sent.
3. A data transmission method, characterized in that: include: Receive ciphertext data; According to a first preset rule, the identification information of the receiving device and the request sending timestamp of the data to be sent are configured into an N-order key matrix, where the key matrix is used to represent the key information; Converting the ciphertext data into a ciphertext matrix; Multiplying the inverse matrix of the key matrix by the ciphertext matrix to generate a plaintext matrix; Generate plaintext data according to the plaintext matrix; In which, the identification information is allocated to the receiving device in real time during the communication between the sending device and the receiving device. The specific type of the identification information depends on the communication protocol between the sending device and the receiving device. The identification information is at least one of the device number, unit identifier or communication frame ID of the receiving device; the identification information and the request sending timestamp are recorded in both the sending device and the receiving device.
4. A data transmission system, characterized in that: include: an acquisition module, configured to acquire identification information of a receiving device and a request sending timestamp of data to be sent, wherein the identification information is allocated to the receiving device in real time during the communication between the sending device and the receiving device, and the specific type of the identification information depends on the communication protocol between the sending device and the receiving device, and the identification information is at least one of a device number, a unit identifier or a communication frame ID of the receiving device; the identification information and the request sending timestamp are recorded in both the sending device and the receiving device; A first determining module, configured to configure the identification information and the request sending timestamp into an N-order key matrix according to a first preset rule, wherein the key matrix is used to represent the key information; An encryption module, used for converting the data to be sent into a plaintext matrix; multiplying the key matrix by the plaintext matrix to obtain a ciphertext matrix, wherein the calculation formula of the ciphertext matrix is: Y=K×X, wherein Y represents the ciphertext matrix; K represents the key matrix; X represents the plaintext matrix; and generating ciphertext data according to the ciphertext matrix; The sending module is used to send the ciphertext data to the receiving device.
5. A data transmission system, characterized in that: include: A receiving module, used for receiving ciphertext data; A second determination module is used to configure the identification information of the receiving device and the request sending timestamp of the data to be sent into an N-order key matrix according to the first preset rule, wherein the key matrix is used to represent the key information; A decryption module, used to convert the ciphertext data into a ciphertext matrix; Multiplying the inverse matrix of the key matrix by the ciphertext matrix to generate a plaintext matrix; Generate plaintext data according to the plaintext matrix; In which, the identification information is allocated to the receiving device in real time during the communication between the sending device and the receiving device. The specific type of the identification information depends on the communication protocol between the sending device and the receiving device. The identification information is at least one of the device number, unit identifier or communication frame ID of the receiving device; the identification information and the request sending timestamp are recorded in both the sending device and the receiving device.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the data transmission method according to any one of claims 1 to 3 are implemented.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data transmission method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Method and device for realizing safety communication between terminal devices
CN101005359A
Network identification card realizing method
CN101022337A
A method for secure 3G messaging based on trusted chain transmission
CN102271333A
Wireless security communication method and system
CN102325320A
Personal code managing tool and method under open cloud platform
CN103618705A
