CN116634033A - Data transmission method, data transmission device, equipment and storage medium - Google Patents
Data transmission method, data transmission device, equipment and storage medium Download PDFInfo
- Publication number
- CN116634033A CN116634033A CN202310485478.7A CN202310485478A CN116634033A CN 116634033 A CN116634033 A CN 116634033A CN 202310485478 A CN202310485478 A CN 202310485478A CN 116634033 A CN116634033 A CN 116634033A
- Authority
- CN
- China
- Prior art keywords
- service
- data
- preset
- protocol
- port
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 56
- 230000005540 biological transmission Effects 0.000 title claims abstract description 43
- 238000004806 packaging method and process Methods 0.000 claims abstract description 36
- 238000004891 communication Methods 0.000 claims abstract description 35
- 238000005538 encapsulation Methods 0.000 claims description 51
- 238000004458 analytical method Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 15
- 230000006855 networking Effects 0.000 claims description 13
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 238000012423 maintenance Methods 0.000 abstract description 15
- 230000008569 process Effects 0.000 abstract description 10
- 238000010586 diagram Methods 0.000 description 14
- 238000012545 processing Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003032 molecular docking Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 210000001503 joint Anatomy 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/90—Buffering arrangements
- H04L49/9057—Arrangements for supporting packet reassembly or resequencing
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Communication Control (AREA)
Abstract
The embodiment of the invention provides a data transmission method, a data transmission device, equipment and a storage medium, wherein the method is applied to a client, and the client is in communication connection with a server, and comprises the following steps: determining a corresponding target port from a plurality of first preset ports according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer; sending the service data to the middle layer through the target port, and packaging the service data through the middle layer to obtain a first packaging data packet of a first protocol; converting the first encapsulated data packet into a second encapsulated data packet of a second protocol; and transmitting the second encapsulated data packet to the server so that the server processes the second encapsulated data packet to obtain business data and provide corresponding business services. Therefore, when the service data in the first protocol environment is migrated to the second protocol environment, the data are abutted to the preset port, the difference of the service data of the first protocol is shielded, and the later maintenance cost is reduced.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data transmission method, a data transmission device, an electronic apparatus, and a computer readable storage medium.
Background
With the development of the video networking, more and more services are required to migrate into the third party application in the video networking, when service data of the third party application is migrated into the video networking, a V2V (virtual machine to virtual machine migration, virtual to Virtual) protocol is required to be docked with the bottom layer of the video networking, at this time, in the docking process, because of different development teams and technical options, if each service data is directly docked with the V2V protocol, docking schemes are different, and the subsequent maintenance cost is also high.
Disclosure of Invention
In view of the above problems, embodiments of the present invention have been made to provide a data transmission method, a data transmission apparatus, an electronic device, and a computer-readable storage medium that overcome or at least partially solve the above problems.
In order to solve the problems, an embodiment of the invention discloses a data transmission method, which is applied to a client, wherein the client is provided with an intermediate layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the client is in communication connection with the server, and the method comprises the following steps:
Determining a corresponding target port from the plurality of first preset ports according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
sending the service data to the middle layer through the target port, and packaging the service data through the middle layer to obtain a first packaging data packet of the first protocol;
converting the first encapsulated data packet into a second encapsulated data packet of a second protocol;
transmitting the second encapsulation data packet to the server, so that the server receives the second encapsulation data packet of the second protocol sent by the client, converts the second encapsulation data packet into a first encapsulation data packet of a first protocol, and decapsulates the first encapsulation data packet to obtain service data of the first protocol; determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
Optionally, the encapsulating the service data to obtain a first encapsulated data packet of the first protocol includes:
and according to the service types of the service data, packaging the service data with the same service type into the same data packet to obtain a plurality of first packaging data packets of the first protocol.
Optionally, before determining the corresponding target port from the plurality of first preset ports according to the service type of the service data to be transmitted and the first preset correspondence of the middle layer, the method further includes:
acquiring address information and an Internet of view number of the server;
and establishing communication connection with the corresponding server according to the address information and the video network number.
The invention also discloses a data transmission method, which is applied to the server, wherein the server comprises a plurality of second preset ports; the server is in communication connection with the client, and the method comprises the following steps:
receiving a second encapsulation data packet of a second protocol sent by the client; the second encapsulation data packet is obtained by determining a corresponding target port from a plurality of first preset ports by the client according to the service type of the service data to be transmitted and a first preset corresponding relation of an intermediate layer, sending the service data to the intermediate layer through the target port, encapsulating the service data through the intermediate layer to obtain a first encapsulation data packet of a first protocol, and converting the first encapsulation data packet by the client; the client is provided with the middle layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
Converting the second encapsulated data packet into a first encapsulated data packet of a first protocol;
decapsulating the first encapsulated data packet to obtain service data of the first protocol;
determining a corresponding service port from the second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
Optionally, the determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and a second preset corresponding relationship, and sending the service data to the service port, so that the service port provides a corresponding service for the service data, includes:
analyzing the service data to obtain analysis data and the corresponding service type;
determining a corresponding service port from a plurality of second preset ports according to the service type and the second preset corresponding relation;
And forwarding the analysis data to the service port so that the service port provides corresponding business service for the analysis data.
Optionally, before the receiving the encapsulated data packet of the second protocol sent by the client, the method further includes:
and establishing communication connection with the client according to the address information and the video networking number corresponding to the server.
The invention also discloses a data transmission device which is applied to the client, wherein the client is provided with an intermediate layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the client is in communication connection with the server, and the device comprises:
the determining module is used for determining a corresponding target port from the plurality of first preset ports according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
the encapsulation module is used for sending the service data to the middle layer through the target port, and encapsulating the service data through the middle layer to obtain a first encapsulation data packet of the first protocol;
The first conversion module is used for converting the first encapsulated data packet into a second encapsulated data packet of a second protocol;
the transmission module is used for transmitting the second encapsulation data packet to the server so that the server receives the second encapsulation data packet of the second protocol sent by the client, converts the second encapsulation data packet into a first encapsulation data packet of the first protocol, and de-encapsulates the first encapsulation data packet to obtain the service data; determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
Optionally, the packaging module includes:
and the packaging sub-module is used for packaging the service data with the same service type into the same data packet according to the service type of the service data to obtain a plurality of first packaging data packets of the first protocol.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the address information and the video networking number of the server;
and the first communication module is used for establishing communication connection with the corresponding server according to the address information and the video network number.
The invention also discloses a data transmission device, which is applied to the server, wherein the server comprises a plurality of second preset ports; the server is in communication connection with the client, and the device comprises:
the receiving module is used for receiving a second encapsulation data packet of a second protocol sent by the client; the second encapsulation data packet is obtained by determining a corresponding target port from a plurality of first preset ports by the client according to the service type of the service data to be transmitted and a first preset corresponding relation of an intermediate layer, sending the service data to the intermediate layer through the target port, encapsulating the service data through the intermediate layer to obtain a first encapsulation data packet of a first protocol, and converting the first encapsulation data packet by the client; the client is provided with the middle layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
The second conversion module is used for converting the second encapsulated data packet into a first encapsulated data packet of a first protocol;
the decapsulation module is used for decapsulating the first encapsulated data packet to obtain service data of the first protocol;
the service module is used for determining a corresponding service port from the second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
Optionally, the service module includes:
the analysis sub-module is used for analyzing the service data to obtain analysis data and the corresponding service type;
the determining submodule is used for determining a corresponding service port from a plurality of second preset ports according to the service type and the second preset corresponding relation;
and the forwarding sub-module is used for forwarding the analysis data to a corresponding service port so that the service port provides corresponding business service for the analysis data.
Optionally, the apparatus further comprises:
and the second communication module is used for establishing communication connection with the client according to the address information and the video networking number corresponding to the server.
The invention also discloses an electronic device, comprising: a processor, a memory and a computer program stored on the memory and capable of running on the processor, which computer program, when being executed by the processor, carries out the steps of the data transmission method as described above.
The invention also discloses a computer readable storage medium, on which a computer program is stored, which when being executed by a processor implements the steps of the data transmission method as described above.
The embodiment of the invention has the following advantages:
according to the embodiment of the invention, the corresponding target port is determined from a plurality of first preset ports according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port; sending the service data to the middle layer through the target port, and packaging the service data through the middle layer to obtain a first packaging data packet of a first protocol; converting the first encapsulated data packet into a second encapsulated data packet of a second protocol; transmitting the second encapsulated data packet to the server so that the server receives the second encapsulated data packet of the second protocol sent by the client, converting the second encapsulated data packet into a first encapsulated data packet of the first protocol, and decapsulating the first encapsulated data packet to obtain service data; determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and the second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is the corresponding relation between the service type and the second preset port. Therefore, when the service data in the first protocol environment is migrated to the second protocol environment, the data is not required to be directly connected with the second protocol, but is connected with the preset port, so that the difference of the service data of the first protocol is shielded, and the later maintenance cost is reduced.
Drawings
Fig. 1 is a flowchart of steps of a data transmission method according to an embodiment of the present invention;
FIG. 2 is a block diagram of a device connection structure according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating steps of another data transmission method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of data transmission according to an embodiment of the present invention;
fig. 5 is a block diagram of a data transmission device according to an embodiment of the present invention;
fig. 6 is a block diagram of another data transmission device according to an embodiment of the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
In the prior art, when service data of a third party application is migrated to an internet-of-view environment, a V2V protocol is required to be in butt joint with an internet-of-view bottom layer, so that later maintenance cost is high. In order to solve the technical problem, a corresponding target port is determined from a plurality of first preset ports according to the service type of service data to be transmitted and a first preset corresponding relation of an intermediate layer, the service data is sent to the intermediate layer through the target port, the service data is packaged to obtain a first package data packet of a first protocol, the first package data packet is converted into a second package data packet of a second protocol, and then the second package data packet is transmitted to a server. The service end processes the two encapsulated data packets to obtain business data and provide corresponding business services. Therefore, a second protocol directly connected with the bottom layer is not needed, the difference of service data of the first protocol is shielded, and the later maintenance cost is reduced.
Referring to fig. 1, a step flow chart of a data transmission method provided by an embodiment of the present invention is shown, where the method is applied to a client, and the client is provided with an intermediate layer including a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the client is in communication connection with the server, and the method specifically comprises the following steps:
step 101, determining a corresponding target port from the plurality of first preset ports according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer.
In the embodiment of the invention, the client can be a command line client, the server can be a command line server, the client can be installed and operated on a Linux PC, the video network is accessed by a virtual terminal mode, the server can be installed and operated in a Linux server, and the video network is accessed by a virtual terminal mode. As shown in fig. 2, a block diagram of a device connection structure provided by an embodiment of the present invention is shown, where a client of a conference room area, a client of an operation and maintenance area, and a server are respectively connected with a switch, and the switch is connected with an internet of vision. The clients of the meeting area are used for users, and the clients of the operation and maintenance area are used for maintenance of the system and the clients by operation and maintenance personnel.
In the embodiment of the present application, the service data may be service data of a first protocol, and before the client determines the corresponding target port according to the service type of the service data, the communication connection between the client and the server may be established, and the communication connection between the client and the server may be established by the following manner: acquiring address information and a video networking number of a server; and establishing communication connection with the corresponding server according to the address information and the video networking number. Specific: the user can send a request instruction to the server through the client, the request instruction can comprise address information and an internet-of-view number of the server which needs to generate communication connection, and the server generates communication connection with the client in response to the request instruction after receiving the request instruction. The client may send the request command to the switch, and the switch forwards the request command to the server.
After the communication connection between the client and the server is established, the client may start to acquire service data to be transmitted, where the service data may be ssh (remote connection service), telnet (remote login service), ftp (file transfer service), or may be third party service data. The content of the service data can be set according to actual requirements, and the application is not particularly limited herein.
In the embodiment of the invention, the client may be provided with an intermediate layer, the intermediate layer may be provided with a plurality of first preset ports, a first preset corresponding relationship is further provided in the intermediate layer, the first preset corresponding relationship may be a corresponding relationship between a service type of service data and the first preset ports, and the intermediate layer may be websocket. The invention can determine the target port corresponding to the service type from a plurality of first preset ports according to the service type of the service data to be transmitted and the first preset correspondence. For example: the service type of the service data to be transmitted is ssh, then a port corresponding to the service type of ssh may be determined from a plurality of first preset ports according to the first preset corresponding relationship, and the determined port is determined as the port for transmitting the service data with the service type of ssh.
And 102, sending the service data to the middle layer through the target port, and packaging the service data through the middle layer to obtain a first packaging data packet of the first protocol.
In the embodiment of the invention, after the corresponding target port is determined from the plurality of first preset ports, the service data can be sent to the middle layer through the target port. For example: and transmitting the service data with the service type of ssh to the middle layer by determining the port with the service type of ssh. The middle layer may then encapsulate the traffic data. In the middle layer of the invention, the business data can be encapsulated by adopting a first protocol, so as to obtain a first encapsulated data packet of the first protocol. The first protocol in the present invention may be a TCP/IP (Transmission Control Protocol/Internet Protocol ) protocol.
In an example, the service data of the present invention may include data of different service types, and when the service data is encapsulated, the service data of the same service type may be encapsulated into the same data packet according to the service type of the service data, so as to obtain first encapsulated data packets of a plurality of first protocols. For example: the service data is 5 groups of data, wherein the first group and the second group are data with the same service type, the third group and the fourth group are data with the same service type, and the fifth group is data with another service type, so that the data of the first group and the second group can be packaged into the same data packet, the data of the third group and the fourth group are packaged into the same data packet, and the data of the fifth group is packaged into one data packet, thereby obtaining first packaged data packets of three first protocols.
Step 103, converting the first encapsulated data packet into a second encapsulated data packet of a second protocol.
In the embodiment of the invention, after the client obtains the first encapsulated data packet of the first protocol, the client can convert the first encapsulated data packet into the second encapsulated data packet of the second protocol. The second protocol in the present invention may be a V2V protocol. The first encapsulated packet may be converted to a second encapsulated packet of a second protocol by a conversion layer in the client, which may be a lwip (Light Weight) TCP/IP protocol transceiver module. The lwip transceiver module may convert the first encapsulated packet of the TCP/IP protocol into a second encapsulated packet of the V2V protocol.
104, transmitting the second encapsulated data packet to the server, so that the server receives the second encapsulated data packet of the second protocol sent by the client, converts the second encapsulated data packet into a first encapsulated data packet of the first protocol, and decapsulates the first encapsulated data packet to obtain the service data; determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
In the embodiment of the present invention, after converting the first encapsulated packet into the second encapsulated packet of the second protocol, the client may transmit the second encapsulated packet to the server based on a preset interface, where the preset interface may be a transceiver interface of the V2V protocol. For example, after the lwip transceiver module converts the first encapsulated data packet of the TCP/IP protocol into the second encapsulated data packet of the V2V protocol, the transceiver interface of the V2V protocol may be mobilized to send the second encapsulated data packet to the server, and after receiving the second encapsulated data packet, the server may convert the second encapsulated data packet into the first encapsulated data packet, and decapsulate the first encapsulated data packet to obtain service data. For example: after receiving the second encapsulated data packet of the V2V protocol, the server may convert the second encapsulated data packet into a first encapsulated data packet of the TCP/IP protocol, and then decapsulate the first encapsulated data packet of the TCP/IP protocol, thereby obtaining service data. The service end can determine the corresponding service port from the second preset ports according to the service type of the service data and the second preset corresponding relation, and send the service data to the service port, so that the service port provides corresponding service for the service data. The second preset corresponding relation is a corresponding relation between the service type and the second preset port. Therefore, when the service or data of the third party application is migrated to the second protocol network environment, the second protocol of the bottom layer of the second protocol network is not required to be docked, only the middle layer of the client is required to be docked, and for later maintenance, only the unified preset interface in the middle layer is required, so that the maintenance cost is effectively reduced.
Referring to fig. 3, a step flowchart of another data transmission method provided by an embodiment of the present invention is shown, where the method is applied to a server, and the server includes a plurality of second preset ports; the service end is in communication connection with the client end, and the method specifically comprises the following steps:
step 301, receiving a second encapsulated packet of a second protocol sent by the client; the second encapsulation data packet is obtained by determining a corresponding target port from a plurality of first preset ports by the client according to the service type of the service data to be transmitted and a first preset corresponding relation of an intermediate layer, sending the service data to the intermediate layer through the target port, encapsulating the service data through the intermediate layer to obtain a first encapsulation data packet of a first protocol, and converting the first encapsulation data packet by the client; the client is provided with the middle layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port.
In the embodiment of the invention, before receiving the second encapsulated data packet of the second protocol sent by the client, the server can establish communication connection with the client according to the address information and the video networking number corresponding to the server. Specific: the user can send a request instruction to the server through the client, the request instruction can comprise address information and an internet-of-view number of the server which needs to generate communication connection, and the server generates communication connection with the client in response to the request instruction after receiving the request instruction. The client may send the request command to the switch, and the switch forwards the request command to the server.
After the communication connection between the server and the client is established, the server may receive a second encapsulated packet of a second protocol sent by the client.
In the invention, the second encapsulated data packet can be determined by the client from a plurality of first preset ports according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer, then the service data is sent to the middle layer through the target ports, then the service data is encapsulated through the middle layer to obtain the first encapsulated data packet of the first protocol, and the client converts the first encapsulated data packet to obtain the second encapsulated data packet. Wherein, the client may be provided with an intermediate layer comprising a plurality of first preset ports; the middle layer can adopt a first protocol to package service data; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port.
Step 302, converting the second encapsulated data packet into a first encapsulated data packet of a first protocol.
In the embodiment of the invention, after receiving the second encapsulated data, the server may convert the second encapsulated data packet into the first encapsulated data packet of the first protocol. In the invention, a V2V network card (vvnecard) can be arranged in the service end, and the received second encapsulated data packet of the two protocols can be converted into the first encapsulated data packet of the first protocol through the V2V network card. For example: after the V2V network card receives the second encapsulated packet of the V2V protocol, the second encapsulated packet of the V2V protocol may be converted into the first encapsulated packet of the TCP/IP protocol.
Step 303, decapsulating the first encapsulated data packet to obtain service data of the first protocol.
In the embodiment of the invention, the server side converts the second encapsulated data packet into the first encapsulated data packet of the first protocol, and can perform decapsulation processing on the first encapsulated data packet. In the invention, the websocket agent can be provided by a third party and is arranged in the server so as to generate a processing process, the websocket in the client and the websocket agent in the server have a corresponding relation, and the ports arranged in the websocket of the client can be arranged according to the ports arranged in the service ports by the websocket agent so as to form a corresponding relation.
Step 304, determining a corresponding service port from the second preset ports according to the service type and the second preset corresponding relation of the service data, and sending the service data to the service port, so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
In the embodiment of the invention, after the service end obtains the service data of the first protocol by decapsulating the first encapsulated data packet, the service data can be forwarded to the corresponding service port. In the invention, a plurality of second preset ports and a second preset corresponding relation can be arranged in the service end. The second preset corresponding relation may be a corresponding relation between the service type and the second preset port. The second preset port and the second preset corresponding relation may be set in a websocket. The service end can determine the corresponding service port from the second preset ports according to the service type of the service data and the second preset corresponding relation, and send the service data to the service port, so that the service port provides corresponding service for the service data. For example: and if the service type of the service data is ssh, determining a port corresponding to the service type of ssh from a plurality of second preset ports according to the second preset corresponding relation. Then, the service data with the service type of ssh can be sent to the service port corresponding to the service type of ssh, so that the port corresponding to the service type of ssh provides corresponding service for the service data with the service type of ssh.
In an example, after obtaining the service data of the first protocol, the server may parse the service data to obtain parsed data and a corresponding service type; determining a corresponding service port from a plurality of second preset ports according to the service type and the second preset corresponding relation; and forwarding the analysis data to a corresponding service port so that the service port provides corresponding business service for the analysis data. For example: after the service data of the first protocol is obtained, the service data is analyzed, and service types corresponding to the analyzed data are ssh, telnet, ftp respectively, so that the data with the service type of ssh analysis can be forwarded to the sshd port, the data with the service type of telnet analysis can be forwarded to the telnet port, and the data with the service type of ftp analysis can be forwarded to the vsftpd port, thereby enabling the service port to provide corresponding service for the service data. Therefore, when the service or data of the third party application is migrated to the second protocol network environment, the second protocol of the bottom layer is not required to be directly docked, only websocket of the client is required to be docked, and for later maintenance, only unified preset interfaces are required to be maintained, so that the maintenance cost is effectively reduced.
Referring to fig. 4, a schematic diagram of data transmission provided by an embodiment of the present invention is shown, where a client is provided with websocket and lwip transceiver modules, and a server is provided with a V2V network card (vvnetcard), a websocket, and a service port sshd, telnetd, vsftpd. The websocket of the client can receive the service data with the service type of ssh, telnet, ftp, then the service data is encapsulated into a first encapsulated data packet with a TCP/IP protocol, the first encapsulated data packet with the TCP/IP protocol is forwarded to the lwip transceiver module, after the lwip transceiver module receives the first encapsulated data packet with the TCP/IP protocol, the first encapsulated data packet with the TCP/IP protocol can be converted into a second encapsulated data packet with the V2V protocol, the second encapsulated data packet with the V2V protocol is transmitted to the server, the V2V network card of the server receives the second encapsulated data packet with the V2V protocol, the second encapsulated data packet with the V2V protocol can be converted into the first encapsulated data packet with the TCP/IP protocol, then the first encapsulated data packet with the TCP/IP protocol is forwarded to the lwip transceiver module, the websocket de-encapsulation processing is carried out to obtain the service data with the service type of ssh, telnet, ftp, and then the service data with the service type of 3 is sent to the corresponding 35 ssh, telnet, ftp 5 service ports, so that the V2V network card of the server can provide corresponding service for the service ports with the service data respectively.
In the embodiment of the invention, the corresponding target port is determined from a plurality of first preset ports according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port; sending the service data to the middle layer through the target port, and packaging the service data through the middle layer to obtain a first packaging data packet of a first protocol; converting the first encapsulated data packet into a second encapsulated data packet of a second protocol; transmitting the second encapsulated data packet to the server so that the server receives the second encapsulated data packet of the second protocol sent by the client, converting the second encapsulated data packet into a first encapsulated data packet of the first protocol, and decapsulating the first encapsulated data packet to obtain service data; determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and the second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is the corresponding relation between the service type and the second preset port. Therefore, when the service data in the first protocol environment is migrated to the second protocol environment, the data is not required to be directly connected with the second protocol, but is connected with the preset port, so that the difference of the service data of the first protocol is shielded, and the later maintenance cost is reduced.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the invention.
Referring to fig. 5, there is shown a block diagram of a data transmission apparatus according to an embodiment of the present invention, where the apparatus is applied to a client, and the client is provided with an intermediate layer including a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the client is in communication connection with the server, and specifically can comprise the following modules:
a determining module 501, configured to determine a corresponding target port from the plurality of first preset ports according to a service type of service data to be transmitted and a first preset correspondence of the middle layer; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
The encapsulation module 502 is configured to send the service data to the intermediate layer through the target port, and encapsulate the service data through the intermediate layer to obtain a first encapsulated data packet of the first protocol;
a first conversion module 503, configured to convert the first encapsulated packet into a second encapsulated packet of a second protocol;
a transmission module 504, configured to transmit the second encapsulated packet to the server, so that the server receives a second encapsulated packet of a second protocol sent by the client, converts the second encapsulated packet into a first encapsulated packet of a first protocol, and decapsulates the first encapsulated packet to obtain the service data; determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
Optionally, the packaging module 502 includes:
And the packaging sub-module is used for packaging the service data with the same service type into the same data packet according to the service type of the service data to obtain a plurality of first packaging data packets of the first protocol.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the address information and the video networking number of the server;
and the first communication module is used for establishing communication connection with the corresponding server according to the address information and the video network number.
Referring to fig. 6, a block diagram of another data transmission device according to an embodiment of the present invention is shown, where the device is applied to a server, and the server includes a plurality of second preset ports; the service end is in communication connection with the client end, and specifically can comprise the following modules:
a receiving module 601, configured to receive a second encapsulated packet of a second protocol sent by the client; the second encapsulation data packet is obtained by determining a corresponding target port from a plurality of first preset ports by the client according to the service type of the service data to be transmitted and a first preset corresponding relation of an intermediate layer, sending the service data to the intermediate layer through the target port, encapsulating the service data through the intermediate layer to obtain a first encapsulation data packet of a first protocol, and converting the first encapsulation data packet by the client; the client is provided with the middle layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
A second conversion module 602, configured to convert the second encapsulated packet into a first encapsulated packet of a first protocol;
a decapsulation module 603, configured to decapsulate the first encapsulated packet to obtain service data of the first protocol;
a service module 604, configured to determine a corresponding service port from the plurality of second preset ports according to the service type of the service data and a second preset correspondence, and send the service data to the service port, so that the service port provides a corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
Optionally, the service module 604 includes:
the analysis sub-module is used for analyzing the service data to obtain analysis data and the corresponding service type;
and the forwarding sub-module is used for forwarding the analysis data to a corresponding service port so that the service port provides corresponding business service for the analysis data.
Optionally, the apparatus further comprises:
and the second communication module is used for establishing communication connection with the client according to the address information and the video networking number corresponding to the server.
In the embodiment of the invention, a corresponding target port is determined from a plurality of first preset ports through a determining module according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port; the encapsulation module is used for sending the service data to the middle layer through the target port, and encapsulating the service data through the middle layer to obtain a first encapsulation data packet of a first protocol; the first conversion module is used for converting the first encapsulated data packet into a second encapsulated data packet of a second protocol; the transmission module is used for transmitting the second encapsulated data packet to the server so that the server receives the second encapsulated data packet of the second protocol sent by the client, converts the second encapsulated data packet into a first encapsulated data packet of the first protocol, and de-encapsulates the first encapsulated data packet to obtain service data; determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and the second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is the corresponding relation between the service type and the second preset port. Therefore, when the service data in the first protocol environment is migrated to the second protocol environment, the data is not required to be directly connected with the second protocol, but is connected with a preset port, so that the difference of the service data of the first protocol is shielded, and the later maintenance cost is reduced.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention also provides electronic equipment, which comprises:
the system comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program realizes the processes of the data transmission method embodiment when being executed by the processor, and can achieve the same technical effects, and the repetition is avoided, and the description is omitted here.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, realizes the processes of the above data transmission method embodiment, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing has described in detail a data transmission method, a data transmission device, an electronic apparatus and a computer readable storage medium according to the present invention, and specific examples have been applied to illustrate the principles and embodiments of the present invention, and the above examples are only used to help understand the method and core idea of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.
Claims (10)
1. A data transmission method, characterized in that the method is applied to a client provided with an intermediate layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the client is in communication connection with the server, and the method comprises the following steps:
determining a corresponding target port from the plurality of first preset ports according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
Sending the service data to the middle layer through the target port, and packaging the service data through the middle layer to obtain a first packaging data packet of the first protocol;
converting the first encapsulated data packet into a second encapsulated data packet of a second protocol;
transmitting the second encapsulation data packet to the server, so that the server receives the second encapsulation data packet of the second protocol sent by the client, converts the second encapsulation data packet into a first encapsulation data packet of the first protocol, and decapsulates the first encapsulation data packet to obtain the service data; determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
2. The method for data transmission according to claim 1, wherein said encapsulating the service data to obtain a first encapsulated packet of the first protocol includes:
And according to the service types of the service data, packaging the service data with the same service type into the same data packet to obtain a plurality of first packaging data packets of the first protocol.
3. The data transmission method according to claim 1, further comprising, before determining a corresponding target port from the plurality of first preset ports according to the service type of the service data to be transmitted and the first preset correspondence of the intermediate layer:
acquiring address information and an Internet of view number of the server;
and establishing communication connection with the corresponding server according to the address information and the video network number.
4. The data transmission method is characterized in that the method is applied to a server, and the server comprises a plurality of second preset ports; the server is in communication connection with the client, and the method comprises the following steps:
receiving a second encapsulation data packet of a second protocol sent by the client; the second encapsulation data packet is obtained by determining a corresponding target port from a plurality of first preset ports by the client according to the service type of the service data to be transmitted and a first preset corresponding relation of an intermediate layer, sending the service data to the intermediate layer through the target port, encapsulating the service data through the intermediate layer to obtain a first encapsulation data packet of a first protocol, and converting the first encapsulation data packet by the client; the client is provided with the middle layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
Converting the second encapsulated data packet into a first encapsulated data packet of a first protocol;
decapsulating the first encapsulated data packet to obtain service data of the first protocol;
determining a corresponding service port from the second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
5. The method of claim 4, wherein determining a corresponding service port from a plurality of second preset ports according to the service type and the second preset correspondence of the service data, and sending the service data to the service port, so that the service port provides a corresponding service for the service data, includes:
analyzing the service data to obtain analysis data and the corresponding service type;
determining a corresponding service port from a plurality of second preset ports according to the service type and the second preset corresponding relation;
And forwarding the analysis data to the service port so that the service port provides corresponding business service for the analysis data.
6. The method of claim 4, further comprising, prior to said receiving the encapsulated packet of the second protocol sent by the client:
and establishing communication connection with the client according to the address information and the video networking number corresponding to the server.
7. A data transmission device, characterized in that the device is applied to a client provided with an intermediate layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the client is in communication connection with the server, and the device comprises:
the determining module is used for determining a corresponding target port from the plurality of first preset ports according to the service type of the service data to be transmitted and the first preset corresponding relation of the middle layer; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
the encapsulation module is used for sending the service data to the middle layer through the target port, and encapsulating the service data through the middle layer to obtain a first encapsulation data packet of the first protocol;
The first conversion module is used for converting the first encapsulated data packet into a second encapsulated data packet of a second protocol;
the transmission module is used for transmitting the second encapsulation data packet to the server so that the server receives the second encapsulation data packet of the second protocol sent by the client, converts the second encapsulation data packet into a first encapsulation data packet of the first protocol, and de-encapsulates the first encapsulation data packet to obtain the service data; determining a corresponding service port from a plurality of second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
8. The data transmission device is characterized in that the device is applied to a server, and the server comprises a plurality of second preset ports; the server is in communication connection with the client, and the device comprises:
the receiving module is used for receiving a second encapsulation data packet of a second protocol sent by the client, the second encapsulation data packet is determined by the client from a plurality of first preset ports according to the service type of service data to be transmitted and a first preset corresponding relation of an intermediate layer, the service data is sent to the intermediate layer through the target ports, the service data is encapsulated through the intermediate layer, a first encapsulation data packet of a first protocol is obtained, and the client converts the first encapsulation data packet to obtain the second encapsulation data packet; the client is provided with the middle layer comprising a plurality of first preset ports; the middle layer is used for packaging the service data by adopting a first protocol; the first preset corresponding relation is the corresponding relation between the service type of the business data and the first preset port;
The second conversion module is used for converting the second encapsulated data packet into a first encapsulated data packet of a first protocol;
the decapsulation module is used for decapsulating the first encapsulated data packet to obtain service data of the first protocol;
the service module is used for determining a corresponding service port from the second preset ports according to the service type of the service data and a second preset corresponding relation, and sending the service data to the service port so that the service port provides corresponding service for the service data; the second preset corresponding relation is a corresponding relation between the service type and the second preset port.
9. An electronic device, comprising: a processor, a memory and a computer program stored on the memory and capable of running on the processor, which when executed by the processor carries out the steps of the data transmission method according to any one of claims 1-3 or 4-6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the data transmission method according to any one of claims 1-3 or 4-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310485478.7A CN116634033A (en) | 2023-04-28 | 2023-04-28 | Data transmission method, data transmission device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310485478.7A CN116634033A (en) | 2023-04-28 | 2023-04-28 | Data transmission method, data transmission device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116634033A true CN116634033A (en) | 2023-08-22 |
Family
ID=87601732
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310485478.7A Pending CN116634033A (en) | 2023-04-28 | 2023-04-28 | Data transmission method, data transmission device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116634033A (en) |
-
2023
- 2023-04-28 CN CN202310485478.7A patent/CN116634033A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107018147B (en) | Internet of things communication method and system and gateway module | |
CN102546800B (en) | Handshake and communication methods for gateway, gateway and Web communication system | |
CN111294399B (en) | Data transmission method and device | |
US7228337B1 (en) | Methods and apparatus for providing a network service to a virtual machine | |
CN111083161A (en) | Data transmission processing method and device and Internet of things equipment | |
CN108810124B (en) | Remote access control system for large number of multimedia terminals in public network environment | |
CN110365779B (en) | Communication control method and device, electronic equipment and storage medium | |
CN110351379B (en) | Communication control method and device, electronic equipment and storage medium | |
EP3809222B1 (en) | Vehicle remote diagnosis method and system | |
CN107124483A (en) | Domain name analytic method and server | |
CN111262715B (en) | Virtual intranet acceleration method and system and computer equipment | |
CN103581361A (en) | Domain name resolution proxy method, device and system | |
US10158587B2 (en) | Communication between a web application instance connected to a connection server and a calling entity other than said connection server | |
CN107786536B (en) | TCP reverse port penetration method and system thereof | |
JP3970857B2 (en) | Communication system, gateway device | |
CN104168302B (en) | Equipment manipulation implementation method, system and proxy gateway | |
CN109005250B (en) | Method and device for accessing server | |
CN116634033A (en) | Data transmission method, data transmission device, equipment and storage medium | |
CN113794715B (en) | Virtual point-to-point network data transmitting method and system | |
CN110365778B (en) | Communication control method and device, electronic equipment and storage medium | |
Cisco | Bisync-to-IP Conversion for Automated Teller Machines | |
EP3176986A1 (en) | Method, device and system for remote desktop protocol gateway to conduct routing and switching | |
CN105577433A (en) | ACS cluster management method, apparatus and system | |
CN112738032B (en) | Communication system for preventing IP deception | |
CN117176678A (en) | Data processing method and device, electronic equipment and storage medium |
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 |