CN117319516A - Multi-protocol conversion protocol processing method and device, electronic equipment and medium - Google Patents

Multi-protocol conversion protocol processing method and device, electronic equipment and medium Download PDF

Info

Publication number
CN117319516A
CN117319516A CN202311522891.2A CN202311522891A CN117319516A CN 117319516 A CN117319516 A CN 117319516A CN 202311522891 A CN202311522891 A CN 202311522891A CN 117319516 A CN117319516 A CN 117319516A
Authority
CN
China
Prior art keywords
data
protocol
field data
header field
field
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
CN202311522891.2A
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.)
Three Gorges Zhikong Technology Co ltd
China Three Gorges Construction Engineering Co Ltd
Original Assignee
Three Gorges Zhikong Technology Co ltd
China Three Gorges Construction Engineering 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 Three Gorges Zhikong Technology Co ltd, China Three Gorges Construction Engineering Co Ltd filed Critical Three Gorges Zhikong Technology Co ltd
Priority to CN202311522891.2A priority Critical patent/CN117319516A/en
Publication of CN117319516A publication Critical patent/CN117319516A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Communication Control (AREA)

Abstract

The invention relates to a protocol processing method, a device, an electronic device and a medium for multi-protocol conversion, which are characterized in that first header field data in first message data are converted into second header field data, then the converted second header field data are utilized to encrypt the first data field data in the first message data to obtain second data field data, and then the second data field data are spliced to obtain second message data sent to target equipment. After receiving the second message data, the target device can obtain the original first data field data by adopting the same decryption algorithm to decrypt the second data field data according to the second header field data, so that the conversion from the first protocol to the second protocol between the source device and the target device is realized, and the source device and the target device can normally communicate. Encryption is realized in the conversion process, and the aim of secret communication among devices with different protocols is fulfilled.

Description

Multi-protocol conversion protocol processing method and device, electronic equipment and medium
Technical Field
The present invention relates to the field of intelligent network devices, and in particular, to a method and apparatus for processing a protocol in multi-protocol conversion, an electronic device, and a medium.
Background
In intelligent hydropower stations, data information from a variety of data sources needs to be collected in order to achieve efficient operation and management. Such data sources include, but are not limited to, sensors of hydropower station equipment, metering equipment, monitoring systems, and the like. By collecting and analyzing the data, the state and the performance of the hydropower station can be known in real time, and prediction and optimization can be performed through an intelligent algorithm. Thus, data acquisition in intelligent hydropower stations becomes critical.
However, in practical applications, the communication protocols used by different devices are different, so that the architecture design of the intelligent hydropower station becomes very complex and difficult. These devices cover a wide variety of manufacturers, models, and specifications, with different data formats and communication protocols between them. To achieve data exchange and sharing between multiple devices, it is necessary to overcome the problem of inconsistent communication protocols. This protocol gap complicates system integration and data flow and requires significant engineering and resource consumption. Thus, ensuring that different devices can communicate and cooperate seamlessly is an important challenge in intelligent hydropower station design.
In addition, since hydropower stations are civil infrastructure, data security is also a concern. Therefore, a protocol processing method capable of implementing conversion between multiple protocols is urgently needed to implement secret communication between devices of different protocols, so as to reduce complexity of system setup in the intelligent hydropower station and ensure data security.
Disclosure of Invention
In view of the foregoing, there is a need for providing a method, an apparatus, an electronic device and a medium for processing a multi-protocol conversion, which are used for solving the problem of how to implement secure communication between devices with different protocols.
In order to achieve the technical purpose, the invention adopts the following technical scheme:
in a first aspect, the present invention provides a protocol processing method for multi-protocol conversion, including:
acquiring first message data based on a first protocol sent by source equipment, wherein the first message data comprises first header field data and first data field data;
converting the first header field data into second header field data based on a message format of the first protocol and the second protocol;
encrypting the first data field data according to the second header field data to obtain second data field data;
and splicing the second header field data and the second data field data to obtain second message data based on the second protocol and transmitting the second message data to target equipment.
Further, the converting the first header field data into the second header field data based on the message format of the first protocol and the second protocol includes:
obtaining a public field of the first protocol and the second protocol according to the message format of the first protocol and the message format of the second protocol;
storing data of a non-public field in the first header field data;
and generating the second header field data, wherein the public field in the second header field data is filled with the data of the public field in the first header field data, and the non-public field in the second header field data is filled with the first preset filling data.
Further, the encrypting the first data field data according to the second header field data to obtain second data field data includes:
acquiring at least one public field as a first encryption basis field;
generating a first symmetric key according to the first encryption in the second header field data and the content in the field, and encrypting the first data field data according to the first symmetric key based on a first symmetric encryption algorithm to obtain the second data field data.
Further, the method further comprises the following steps:
acquiring third message data based on the second protocol, wherein the third message data comprises third header field data and third data field data, and the third message data is sent by the target equipment;
converting the third header field data into fourth header field data based on a message format of the first protocol and the second protocol;
decrypting the third data field data according to the fourth header field data to obtain fourth data field data;
and splicing the fourth header field data and the fourth data field data to obtain fourth message data based on the first protocol and transmitting the fourth message data to the source equipment.
Further, the third message data is response data corresponding to the second message data; the converting the third header field data into fourth header field data based on the message format of the first protocol and the second protocol includes:
obtaining second preset filling data according to the stored data of the non-public field in the first header field data;
and generating the fourth header field data, wherein the public field in the fourth header field data is filled with the data of the public field in the third header field data, and the non-public field in the fourth header field data is filled with the second preset filling data.
Further, the decrypting the third data field data according to the fourth header field data to obtain fourth data field data includes:
acquiring at least one public field as a second encryption basis field;
generating a second symmetric key according to the second encryption in the third header field data and the content in the field, and decrypting the third data field data according to the second symmetric key based on a second symmetric encryption algorithm to obtain the fourth data field data.
In a second aspect, the present invention also provides a protocol apparatus for multiprotocol conversion, including:
the data receiving module is used for acquiring first message data based on a first protocol, which is sent by the source equipment, wherein the first message data comprises first header field data and first data field data;
a header transcoding module, configured to convert the first header field data into second header field data based on a message format of the first protocol and the second protocol;
the data encryption module is used for encrypting the first data field data according to the second header field data to obtain second data field data;
and the forwarding and transmitting module is used for splicing the second header field data and the second data field data to obtain second message data based on the second protocol and transmitting the second message data to the target equipment.
Further, the method further comprises the following steps:
a forwarding receiving module, configured to obtain third message data based on the second protocol, where the third message data includes third header field data and third data field data, where the third message data is sent by the target device;
a header decoding module, configured to convert the third header field data into fourth header field data based on a message format of the first protocol and the second protocol;
the data decryption module is used for decrypting the third data field data according to the fourth header field data to obtain fourth data field data;
and the data feedback module is used for splicing the fourth header field data and the fourth data field data to obtain fourth message data based on the first protocol and transmitting the fourth message data to the source equipment.
In a third aspect, the invention also provides an electronic device comprising a memory and a processor, wherein,
the memory is used for storing programs;
the processor is coupled to the memory and is configured to execute the program stored in the memory to implement the steps in the protocol processing method for multiprotocol conversion described in any one of the above.
In a fourth aspect, the present invention also provides a computer readable storage medium storing a computer readable program or instructions which, when executed by a processor, enable the steps in the protocol processing method for multiprotocol conversion according to any one of the above.
The invention provides a protocol processing method, a device, an electronic device and a medium for multi-protocol conversion, which are characterized in that first header field data in first message data are converted into second header field data, then the converted second header field data are utilized to encrypt the first data field data in the first message data to obtain second data field data, and then the second data field data are spliced to obtain second message data sent to target equipment. After receiving the second message data, the target device can obtain the original first data field data by adopting the same decryption algorithm to decrypt the second data field data according to the second header field data, so that the conversion from the first protocol to the second protocol between the source device and the target device is realized, and the source device and the target device can normally communicate. Encryption is realized in the conversion process, and the aim of secret communication among devices with different protocols is fulfilled. Compared with the prior art, the intelligent hydropower station has the advantages that in the system erection process, protocol conversion scripts are not required to be configured for each device under the condition of ensuring information safety, the complexity of system construction in the intelligent hydropower station is reduced, and because of the complexity, the flexibility and the expandability of the system are improved, so that the intelligent hydropower station can be put into use without great modification of the system when the devices are replaced or upgraded, and has good application prospect.
Drawings
FIG. 1 is a flow chart of a protocol processing method for multi-protocol conversion according to an embodiment of the present invention;
FIG. 2 is a system architecture diagram of an embodiment of a protocol processing apparatus for multi-protocol conversion according to the present invention;
fig. 3 is a schematic structural diagram of an embodiment of an electronic device according to the present invention.
Detailed Description
Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form a part hereof, and together with the description serve to explain the principles of the invention, and are not intended to limit the scope of the invention.
It is to be understood that technical terms, acronyms, and the like appearing hereinafter are prior art and those skilled in the art are able to understand their meanings based on context and are not described here too much for reasons of brevity.
In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the invention. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The invention provides a protocol processing method, a device, equipment and a storage medium for multi-protocol conversion, which are respectively described below.
Referring to fig. 1, in one embodiment of the present invention, a protocol processing method for multi-protocol conversion is disclosed, including:
s101, acquiring first message data based on a first protocol sent by source equipment, wherein the first message data comprises first header field data and first data field data;
s102, converting the first header field data into second header field data based on the message format of the first protocol and the second protocol;
s103, encrypting the first data field data according to the second header field data to obtain second data field data;
s104, splicing the second header field data and the second data field data to obtain second message data based on the second protocol and sending the second message data to the target equipment.
The invention provides a protocol processing method for multi-protocol conversion, which comprises the steps of firstly converting first header field data in first message data into second header field data, then encrypting the first data field data in the first message data by using the converted second header field data to obtain second data field data, and then splicing the second data field data and the second data field data to obtain second message data sent to target equipment. After receiving the second message data, the target device can obtain the original first data field data by adopting the same decryption algorithm to decrypt the second data field data according to the second header field data, so that the conversion from the first protocol to the second protocol between the source device and the target device is realized, and the source device and the target device can normally communicate. Encryption is realized in the conversion process, and the aim of secret communication among devices with different protocols is fulfilled. Compared with the prior art, the intelligent hydropower station has the advantages that in the system erection process, protocol conversion scripts are not required to be configured for each device under the condition of ensuring information safety, the complexity of system construction in the intelligent hydropower station is reduced, and because of the complexity, the flexibility and the expandability of the system are improved, so that the intelligent hydropower station can be put into use without great modification of the system when the devices are replaced or upgraded, and has good application prospect.
In practice, a device or module running the method may be considered a virtual device connected between a source device and a target device. For the source device, the module running the method corresponds to a virtual device running the first protocol in communication therewith, and for the target device, the module running the method corresponds to a virtual device running the second protocol in communication therewith.
In a computer network, a network message consists of two partial fields: a Header field (Header) and a data field (Payload).
The Header is a fixed length region containing important metadata, typically a Header, located at the very beginning of a network message that needs to be transmitted to ensure that the corresponding part of the packet is understood and processed by a device such as a router in the internet or telephone network. The information in the header may provide important information about the network message, such as source address, destination address, protocol type, port number, etc. The header may contain different fields depending on the different protocols or packet types. The length and structure of the header fields and the data contained depend on the network protocol used.
The data field is a variable length region containing the transmitted data. When a network message is sent from one computer to another, its header portion may be processed by routers and other devices, where the information in the header may need to be used to determine the next destination of the message. After header processing is complete, the data portion of the digital data packet may be processed and restored at the destination computer using the protocol.
It can be understood that, in this embodiment, the data in the header field and the data field in the first packet data are the first header field data and the first data field data, the data in the header field and the data field in the second packet data are the second header field data and the second data field data, and the third packet data and the fourth packet data are the same. In practice, according to a specific protocol type, those skilled in the art will understand that the words such as the first header field data, the third data field data, etc. herein specifically refer to which data, and thus will not be described in detail hereinafter.
Specifically, in a preferred embodiment, the step S102, the converting the first header field data into the second header field data based on the message format of the first protocol and the second protocol specifically includes:
obtaining a public field of the first protocol and the second protocol according to the message format of the first protocol and the message format of the second protocol;
storing data of a non-public field in the first header field data;
and generating the second header field data, wherein the public field in the second header field data is filled with the data of the public field in the first header field data, and the non-public field in the second header field data is filled with the first preset filling data.
The common field in the above process is a field common to the first protocol and the second protocol, which is generally a field indicating the identity of the target device, such as a target IP address, a target MAC address, etc., which are necessary fields in each protocol, so that the content of the common field in the first header field data only needs to be filled into the second header field data in the above process.
The above-mentioned non-public field refers to a field not shared in different protocols, which is generally used to represent a sequence number, a message length, a protocol type, and the like of a message, and when the protocol conversion is performed, the first preset filling data can be filled in the non-public field for the second message data based on the second protocol, and the second message data can operate based on the second protocol.
In practical implementation, the device or module running the method can locally maintain an interaction list for recording data of non-public fields such as a message sequence number and the like when the device or module communicates with the target device based on the second protocol last time. When the second message data is generated, appropriate first preset filling data can be obtained according to the interaction list for filling.
Further, in a preferred embodiment, the step S103, encrypting the first data field data according to the second header field data to obtain second data field data specifically includes:
acquiring at least one public field as a first encryption basis field;
generating a first symmetric key according to the first encryption in the second header field data and the content in the field, and encrypting the first data field data according to the first symmetric key based on a first symmetric encryption algorithm to obtain the second data field data.
Since the data in the header field is normally related to the normal transmission of the message in the network, only the first data field data is encrypted in the present invention. Symmetric encryption is a common encryption algorithm, also known as private key encryption or shared key encryption. In a symmetric encryption algorithm, the same key (i.e., the first symmetric key described above) is used for encryption and decryption operations. The principle of symmetric encryption is that the original data is encrypted by using a secret key to generate a ciphertext, and then the ciphertext is decrypted by using the same secret key to restore the original data. Since the same key is used for encryption and decryption, the symmetric encryption algorithm has the characteristics of high efficiency, rapidness and simplicity. Common symmetric encryption algorithms are: DES (Data Encryption Standard), 3DES (Triple Data Encryption Algorithm), AES (Advanced Encryption Standard), etc.
In the invention, the target equipment can also receive the second header field data, and the target equipment can finish the decryption of the data only by configuring and operating the equipment of the method to adopt the same key generation algorithm and the symmetric encryption algorithm (namely the first symmetric encryption algorithm) so as to acquire the first data field data, thereby completing the communication with the source equipment.
The present invention also provides a more detailed embodiment for more clearly describing the above step S103:
assume that a source address, a destination address and a port number field in a public field are selected and used together as a first encryption basis field, wherein:
source address: 192.168.0.1;
target address: 10.0.0.1;
port number: 8080;
the content of the first data field data is: the data content is as follows: "Hello, world-! ";
then, the source address, the target address and the port number are spliced together to obtain a first encryption basis field, for example:
192.168.0.1-10.0.0.1-8080;
the string is then processed using a secure key generation algorithm (e.g., a hash function) to generate a first symmetric key:
x1y2z3a4b5c6d7e8;
the first data field data is encrypted using the generated first symmetric key. For example, the data field "Hello, world-! "encryption gets the second data field data:
d7e8x1y2z3a4b5c6;
and finally obtaining second message data:
the second header field data includes: source address: 192.168.0.1, target address: 10.0.0.1, port number: 8080;
the second data field data includes: d7e8x1y2z3a4b5c6.
It will be appreciated that the above procedure is only a simple example for ease of understanding and use, and that more complex encryption algorithms and security measures may be employed in practical applications.
When the source device does not need feedback data (for example, the source device is a device for temperature acquisition, water level acquisition and the like, and only needs to provide data), protocol conversion communication between the source device and the target device can be completed through the process. In some cases where feedback data is required, when the target device receives the second message data, it generates third message data of the response, and at this time, it is required to convert the third message data to answer the source device.
Thus, referring to fig. 1 again, in a preferred embodiment, the protocol processing method of multiprotocol conversion further includes:
s105, acquiring third message data based on the second protocol, which is sent by the target equipment, wherein the third message data comprises third header field data and third data field data;
s106, converting the third header field data into fourth header field data based on the message format of the first protocol and the second protocol;
s107, decrypting the third data field data according to the fourth header field data to obtain fourth data field data;
s108, splicing the fourth header field data and the fourth data field data to obtain fourth message data based on the first protocol and sending the fourth message data to the source equipment.
The principle and advantageous effects of the above process can be analogically described with reference to the foregoing, and will not be described here too much.
Further, in a preferred embodiment, the step S105 of converting the third header field data into fourth header field data based on the message format of the first protocol and the second protocol specifically includes:
obtaining second preset filling data according to the stored data of the non-public field in the first header field data;
and generating the fourth header field data, wherein the public field in the fourth header field data is filled with the data of the public field in the third header field data, and the non-public field in the fourth header field data is filled with the second preset filling data.
In step S102 before the present invention, the non-public field in the first header field data is reserved, and when the target device responds to the first message data (actually, responds to the second message data), the device or module running the method can generate the non-public field data corresponding to the first header field data according to the reserved non-public field, and fill the non-public field data into the fourth header field data, so that the protocol conversion of the message is completed, and the normal communication of the fourth message data is ensured.
Further, in a preferred embodiment, the step S107 decrypts the third data field data according to the fourth header field data to obtain fourth data field data, which specifically includes:
acquiring at least one public field as a second encryption basis field;
generating a second symmetric key according to the second encryption in the third header field data and the content in the field, and decrypting the third data field data according to the second symmetric key based on a second symmetric encryption algorithm to obtain the fourth data field data.
The second symmetric encryption algorithm in the above process may be implemented by the same encryption algorithm as the first symmetric encryption algorithm, or may be implemented by a different encryption algorithm. When different encryption algorithms are adopted, the information security can be obviously improved, and only two correct key generation algorithms and symmetric encryption algorithms are respectively configured on the equipment running the method and the target equipment.
In order to better implement the protocol processing method of multi-protocol conversion in the embodiment of the present invention, referring to fig. 2, fig. 2 is a schematic structural diagram of an embodiment of a protocol processing apparatus of multi-protocol conversion provided by the present invention, based on the protocol processing method of multi-protocol conversion, a protocol processing apparatus 200 of multi-protocol conversion provided by the embodiment of the present invention includes:
a data receiving module 210, configured to obtain first message data based on a first protocol sent by a source device, where the first message data includes first header field data and first data field data;
a header transcoding module 220, configured to convert the first header field data into second header field data based on a message format of the first protocol and the second protocol;
a data encryption module 230, configured to encrypt the first data field data according to the second header field data to obtain second data field data;
and the forwarding and transmitting module 240 is configured to splice the second header field data and the second data field data, obtain second packet data based on the second protocol, and transmit the second packet data to the target device.
Further, in a preferred embodiment, the protocol processing apparatus for multiprotocol conversion further includes:
a forwarding receiving module 250, configured to obtain third message data based on the second protocol sent by the target device, where the third message data includes third header field data and third data field data;
a header decoding module 260, configured to convert the third header field data into fourth header field data based on a message format of the first protocol and the second protocol;
a data decryption module 270, configured to decrypt the third data field data according to the fourth header field data, to obtain fourth data field data;
and the data feedback module 280 is configured to splice the fourth header field data and the fourth data field data, obtain fourth packet data based on the first protocol, and send the fourth packet data to the source device.
What needs to be explained here is: the corresponding device 200 provided in the foregoing embodiments may implement the technical solutions described in the foregoing method embodiments, and the specific implementation principles of the foregoing modules or units may be referred to the corresponding content in the foregoing method embodiments, which is not repeated herein.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the invention. Based on the above-mentioned protocol processing method of multi-protocol conversion, the present invention also provides a multi-protocol conversion protocol processing device 300, that is, the above-mentioned electronic device, where the multi-protocol conversion protocol processing device 300 may be a computing device such as a mobile terminal, a desktop computer, a notebook computer, a palm computer, and a server. The multi-protocol converted protocol processing apparatus 300 comprises a processor 310, a memory 320 and a display 330. Fig. 3 shows only some of the components of the protocol processing apparatus for multiprotocol conversion, but it should be understood that not all of the illustrated components are required to be implemented, and more or fewer components may alternatively be implemented.
The memory 320 may be an internal storage unit of the multiprotocol converted protocol processing apparatus 300 in some embodiments, such as a hard disk or a memory of the multiprotocol converted protocol processing apparatus 300. The memory 320 may also be an external storage device of the multiprotocol converted protocol processing apparatus 300 in other embodiments, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like provided on the multiprotocol converted protocol processing apparatus 300. Further, the memory 320 may also include both internal storage units and external storage devices of the multi-protocol conversion protocol processing apparatus 300. The memory 320 is used for storing application software installed in the multi-protocol conversion protocol processing apparatus 300 and various types of data, such as program codes installed in the multi-protocol conversion protocol processing apparatus 300. The memory 320 may also be used to temporarily store data that has been output or is to be output. In an embodiment, the memory 320 stores a protocol processing program 340 for multi-protocol conversion, where the protocol processing program 340 for multi-protocol conversion may be executed by the processor 310, so as to implement the protocol processing method for multi-protocol conversion according to embodiments of the present application.
The processor 310 may in some embodiments be a central processing unit (Central Processing Unit, CPU), microprocessor or other data processing chip for executing program code or processing data stored in the memory 320, such as protocol processing methods for performing multi-protocol conversion, etc.
The display 330 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like in some embodiments. Display 330 is used to display information at the multi-protocol converted protocol processing apparatus 300 and to display a visual user interface. The components 310-330 of the multi-protocol converted protocol processing apparatus 300 communicate with each other via a system bus.
In one embodiment, the steps in the protocol processing method of multi-protocol conversion as described above are implemented when the processor 310 executes the protocol handler 340 of multi-protocol conversion in the memory 320.
The present embodiment also provides a computer-readable storage medium having stored thereon a protocol processing program of multiprotocol conversion, which when executed by a processor, can implement the steps in the above embodiments.
The invention provides a protocol processing method, a device, an electronic device and a medium for multi-protocol conversion, which are characterized in that first header field data in first message data are converted into second header field data, then the converted second header field data are utilized to encrypt the first data field data in the first message data to obtain second data field data, and then the second data field data are spliced to obtain second message data sent to target equipment. After receiving the second message data, the target device can obtain the original first data field data by adopting the same decryption algorithm to decrypt the second data field data according to the second header field data, so that the conversion from the first protocol to the second protocol between the source device and the target device is realized, and the source device and the target device can normally communicate. Encryption is realized in the conversion process, and the aim of secret communication among devices with different protocols is fulfilled. Compared with the prior art, the intelligent hydropower station has the advantages that in the system erection process, protocol conversion scripts are not required to be configured for each device under the condition of ensuring information safety, the complexity of system construction in the intelligent hydropower station is reduced, and because of the complexity, the flexibility and the expandability of the system are improved, so that the intelligent hydropower station can be put into use without great modification of the system when the devices are replaced or upgraded, and has good application prospect.
The present invention is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present invention are intended to be included in the scope of the present invention.

Claims (10)

1. A protocol processing method for multi-protocol conversion, comprising:
acquiring first message data based on a first protocol sent by source equipment, wherein the first message data comprises first header field data and first data field data;
converting the first header field data into second header field data based on a message format of the first protocol and the second protocol;
encrypting the first data field data according to the second header field data to obtain second data field data;
and splicing the second header field data and the second data field data to obtain second message data based on the second protocol and transmitting the second message data to target equipment.
2. The protocol processing method for multi-protocol conversion according to claim 1, wherein converting the first header field data into the second header field data based on the message format of the first protocol and the second protocol comprises:
obtaining a public field of the first protocol and the second protocol according to the message format of the first protocol and the message format of the second protocol;
storing data of a non-public field in the first header field data;
and generating the second header field data, wherein the public field in the second header field data is filled with the data of the public field in the first header field data, and the non-public field in the second header field data is filled with the first preset filling data.
3. The protocol processing method of multi-protocol conversion according to claim 2, wherein encrypting the first data field data according to the second header field data to obtain second data field data comprises:
acquiring at least one public field as a first encryption basis field;
generating a first symmetric key according to the first encryption in the second header field data and the content in the field, and encrypting the first data field data according to the first symmetric key based on a first symmetric encryption algorithm to obtain the second data field data.
4. A protocol processing method for multi-protocol conversion according to claim 3, further comprising:
acquiring third message data based on the second protocol, wherein the third message data comprises third header field data and third data field data, and the third message data is sent by the target equipment;
converting the third header field data into fourth header field data based on a message format of the first protocol and the second protocol;
decrypting the third data field data according to the fourth header field data to obtain fourth data field data;
and splicing the fourth header field data and the fourth data field data to obtain fourth message data based on the first protocol and transmitting the fourth message data to the source equipment.
5. The method for processing multiprotocol converted protocol as recited in claim 4, wherein said third message data is response data corresponding to said second message data; the converting the third header field data into fourth header field data based on the message format of the first protocol and the second protocol includes:
obtaining second preset filling data according to the stored data of the non-public field in the first header field data;
and generating the fourth header field data, wherein the public field in the fourth header field data is filled with the data of the public field in the third header field data, and the non-public field in the fourth header field data is filled with the second preset filling data.
6. The method according to claim 5, wherein decrypting the third data field data based on the fourth header field data to obtain fourth data field data comprises:
acquiring at least one public field as a second encryption basis field;
generating a second symmetric key according to the second encryption in the third header field data and the content in the field, and decrypting the third data field data according to the second symmetric key based on a second symmetric encryption algorithm to obtain the fourth data field data.
7. A protocol apparatus for multiprotocol conversion, comprising:
the data receiving module is used for acquiring first message data based on a first protocol, which is sent by the source equipment, wherein the first message data comprises first header field data and first data field data;
a header transcoding module, configured to convert the first header field data into second header field data based on a message format of the first protocol and the second protocol;
the data encryption module is used for encrypting the first data field data according to the second header field data to obtain second data field data;
and the forwarding and transmitting module is used for splicing the second header field data and the second data field data to obtain second message data based on the second protocol and transmitting the second message data to the target equipment.
8. The protocol processing apparatus for multiprotocol conversion as recited in claim 7, further comprising:
a forwarding receiving module, configured to obtain third message data based on the second protocol, where the third message data includes third header field data and third data field data, where the third message data is sent by the target device;
a header decoding module, configured to convert the third header field data into fourth header field data based on a message format of the first protocol and the second protocol;
the data decryption module is used for decrypting the third data field data according to the fourth header field data to obtain fourth data field data;
and the data feedback module is used for splicing the fourth header field data and the fourth data field data to obtain fourth message data based on the first protocol and transmitting the fourth message data to the source equipment.
9. An electronic device comprising a memory and a processor, wherein,
the memory is used for storing programs;
the processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps in the protocol processing method for multiprotocol conversion according to any one of the preceding claims 1 to 6.
10. A computer-readable storage medium storing a computer-readable program or instructions that, when executed by a processor, is capable of implementing the steps in the protocol processing method of multiprotocol conversion according to any one of claims 1 to 6.
CN202311522891.2A 2023-11-15 2023-11-15 Multi-protocol conversion protocol processing method and device, electronic equipment and medium Pending CN117319516A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311522891.2A CN117319516A (en) 2023-11-15 2023-11-15 Multi-protocol conversion protocol processing method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311522891.2A CN117319516A (en) 2023-11-15 2023-11-15 Multi-protocol conversion protocol processing method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN117319516A true CN117319516A (en) 2023-12-29

Family

ID=89250133

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311522891.2A Pending CN117319516A (en) 2023-11-15 2023-11-15 Multi-protocol conversion protocol processing method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN117319516A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107925652A (en) * 2016-07-29 2018-04-17 深圳市赛亿科技开发有限公司 A kind of transport protocol fixed conversion method and device based on message protocol identification
CN109450852A (en) * 2018-10-09 2019-03-08 中国科学院信息工程研究所 Network communication encrypting and decrypting method and electronic equipment
CN116762323A (en) * 2021-01-08 2023-09-15 华为技术有限公司 Switching system, switching network and switching node

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107925652A (en) * 2016-07-29 2018-04-17 深圳市赛亿科技开发有限公司 A kind of transport protocol fixed conversion method and device based on message protocol identification
CN109450852A (en) * 2018-10-09 2019-03-08 中国科学院信息工程研究所 Network communication encrypting and decrypting method and electronic equipment
CN116762323A (en) * 2021-01-08 2023-09-15 华为技术有限公司 Switching system, switching network and switching node

Similar Documents

Publication Publication Date Title
CN103763315B (en) A kind of trust data access control method being applied to mobile device cloud storage
CN110335043B (en) Transaction privacy protection method, device and system based on blockchain system
CN111628976B (en) Message processing method, device, equipment and medium
CN110289952B (en) Quantum data link security terminal and security communication network
US9306734B2 (en) Communication device, key generating device, and computer readable medium
CN109309650B (en) Data processing method, terminal equipment and network equipment
CN110061996A (en) A kind of data transmission method, device, equipment and readable storage medium storing program for executing
CN109818910B (en) Data transmission method, device and medium
CN115174267B (en) TLS protocol negotiation method, equipment and medium
CN112968778A (en) Block chain state encryption algorithm conversion method and system, computer equipment and application
US10999073B2 (en) Secure network communication method
CN111372056A (en) Video data encryption and decryption processing method and device
CN116647425B (en) IPSec-VPN implementation method and device of OVN architecture, electronic equipment and storage medium
WO2024001037A1 (en) Message transmission method and apparatus, electronic device and storage medium
CN117319516A (en) Multi-protocol conversion protocol processing method and device, electronic equipment and medium
CN113890759B (en) File transmission method, device, electronic equipment and storage medium
CN112787819B (en) Industrial control safety communication system and communication method
KR101812311B1 (en) User terminal and data sharing method of user terminal based on attributed re-encryption
Somaiya et al. Implementation and evaluation of EMAES–A hybrid encryption algorithm for sharing multimedia files with more security and speed
CN111431846B (en) Data transmission method, device and system
CN113922976A (en) Equipment log transmission method and device, electronic equipment and storage medium
CN114142998B (en) Data encryption processing method and device, electronic equipment and storage medium
US11936635B2 (en) Method, electronic device, and program product implemented at an edge switch for data encryption
CN108958771A (en) Update method, device, server and the storage medium of application program
CN117596421B (en) Video encryption transmission method, device and system based on fusion terminal

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