CN116996251A - Cluster information transmission method and device - Google Patents

Cluster information transmission method and device Download PDF

Info

Publication number
CN116996251A
CN116996251A CN202310717967.0A CN202310717967A CN116996251A CN 116996251 A CN116996251 A CN 116996251A CN 202310717967 A CN202310717967 A CN 202310717967A CN 116996251 A CN116996251 A CN 116996251A
Authority
CN
China
Prior art keywords
information
cluster
address
packet
data
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
CN202310717967.0A
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.)
Qianxin Technology Group Co Ltd
Original Assignee
Qianxin Technology Group 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 Qianxin Technology Group Co Ltd filed Critical Qianxin Technology Group Co Ltd
Priority to CN202310717967.0A priority Critical patent/CN116996251A/en
Publication of CN116996251A publication Critical patent/CN116996251A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1416Event detection, e.g. attack signature detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0281Proxies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1425Traffic logging, e.g. anomaly detection

Abstract

The application discloses a method and a device for transmitting cluster information, and relates to the technical field of network security. The method of the application comprises the following steps: acquiring cluster information corresponding to the clusters, wherein the cluster information comprises cluster address information; determining the gatepost address information corresponding to the cluster address information based on a preset mapping relation, wherein the preset mapping relation comprises gatepost address information corresponding to each cluster address information; in the cluster information, replacing the cluster address information by adopting the gatekeeper address information; and transmitting the replaced cluster information to the client.

Description

Cluster information transmission method and device
Technical Field
The present application relates to the field of network security technologies, and in particular, to a method and an apparatus for transmitting cluster information.
Background
With the continuous development of technology, the use of clusters (or called computer clusters, server clusters or node clusters) is gradually increased, for example, a kafka cluster is a cluster built based on a distributed stream processing system, and comprises a plurality of different nodes (or called servers), each node can deploy different functions and services, for example, in the process of using the kafka cluster, a client can send a request to the cluster through own requirements, and the cluster feeds back corresponding information so as to realize data transmission between the client and the cluster. In the process of transmitting cluster information, for safety, a gatekeeper is generally arranged between the client and the cluster, and blocking between an external network and an internal network is realized through the gatekeeper, so that safety is improved.
At present, the existing transmission mode of the cluster information is mainly based on that the gatekeeper directly configures the cluster node corresponding to the function required by the client, that is, when the client sends a request and the node corresponding to the function or service required by the request is just the node pre-configured in the gatekeeper, then the cluster directly feeds back the cluster information to the client, and the gatekeeper also releases the feedback information, and in the process, the corresponding address information of the node contained in the cluster information is fed back to the client. However, in practical applications, once a hacker uses a client, the existing transmission manner of the cluster information will expose the relevant information, especially the address information, of the cluster node to the client, so that the address information of the cluster is revealed, thereby affecting the security of the cluster device.
Disclosure of Invention
The embodiment of the application provides a method and a device for transmitting cluster information, which mainly aim to realize the method for transmitting the cluster information so as to solve the problem of safety risk caused by address information leakage in the existing process of transmitting the cluster information.
In order to solve the technical problems, the embodiment of the application provides the following technical scheme:
In a first aspect, the present application provides a method for transmitting cluster information, where the method is used in a data transmission system, and the data transmission system includes: the method comprises the steps that a client, a cluster and a gatekeeper positioned between the client and the cluster are provided, a preset mapping relation between gatekeeper address information of the gatekeeper and cluster address information of the cluster is pre-configured in the data transmission system, and the method comprises the following steps:
acquiring cluster information corresponding to the clusters, wherein the cluster information comprises cluster address information;
determining gatepost address information corresponding to the cluster address information based on the preset mapping relation;
in the cluster information, replacing the cluster address information by adopting the gatekeeper address information;
and transmitting the replaced cluster information to the client.
Optionally, the cluster address information includes a first network address and a first port; the gateway address information comprises a second network address and a second port; the preset mapping relation comprises a first relation and a second relation, and the first relation is used for representing the corresponding relation of each first network address and each second network address; the second relationship is used for representing the corresponding relationship between each first port and each second port;
The determining the gatepost address information corresponding to the cluster address information based on the preset mapping relation comprises the following steps:
determining the second network address corresponding to the first network address based on the first relationship, and determining the second port corresponding to the first port based on the second relationship;
and determining the second network address and the second port as the gatekeeper address information.
Optionally, the first network address includes a node IP address of the cluster; the first port comprises a node port of a cluster; the second network address comprises a gatekeeper IP address, and the second port comprises a gatekeeper port; the cluster comprises at least one node, and each node corresponds to one node IP address and one node port;
before determining the gatepost address information corresponding to the cluster address information based on the preset mapping relation, the method further comprises:
setting a corresponding gateway IP address for the node IP address of each node in the cluster, and setting a corresponding gateway port for the node port of each node in the cluster;
determining the first relationship based on the node IP address and the gatekeeper IP address, and determining the second relationship based on the node port and the gatekeeper port;
The determining, based on the first relationship, the second network address corresponding to the first network address and determining, based on the second relationship, the second port corresponding to the first port includes:
and determining the gateway IP address corresponding to the node IP address based on the first relation, and determining the gateway port corresponding to the node port based on the second relation.
Optionally, in the cluster information, replacing the cluster address information with the gatekeeper address information includes:
when the byte length of the gatekeeper address information is consistent with the byte length of the cluster address information, replacing the cluster address information with the gatekeeper address information in the cluster information;
when the byte length of the gatekeeper address information is not consistent with the byte length of the cluster address information, modifying the gatekeeper address information based on the communication specification of the cluster information to obtain modified gatekeeper address information, and replacing the cluster address information in the cluster information based on the modified gatekeeper address information, wherein the byte length of the modified gatekeeper address information is consistent with the byte length of the cluster address information.
Optionally, the cluster information includes at least one information packet;
the obtaining cluster information corresponding to the clusters includes:
receiving the information packet, and determining whether all information contents of the cluster information are received based on header information of the information packet;
if all the information contents of the cluster information are received, combining a plurality of information packets corresponding to the cluster information to obtain the cluster information;
and if the fact that all the information of the cluster information is not received is determined, caching the information packet corresponding to the cluster information, so that the cluster information is obtained after all the information contents of the cluster information are determined to be received.
Optionally, the determining whether all information contents of the cluster information have been received based on the header information of the information packet includes:
determining the data quantity of the cluster information through the header information of the information packet, and determining whether the data quantity of the information packet is consistent with the data quantity of the cluster information, wherein when the data quantity of the information packet is consistent with the data quantity of the cluster information, determining that all information contents of the cluster information are received, or else, not receiving all information contents;
And if it is determined that all the information contents of the cluster information are received, combining a plurality of information packets corresponding to the cluster information to obtain the cluster information, including:
and if the data quantity of the cluster information is inconsistent with the data quantity of the information packet, caching the information packet, and combining a newly added information packet with the cached data packet to obtain the cluster information.
Optionally, after the determining whether the data amount of the information packet is consistent with the data amount of the cluster information, the method further includes:
and if the data quantity of the cluster information is consistent with the data quantity of the information packet, determining the information packet as the cluster information.
Optionally, the caching the information packet, and merging the newly added information packet with the cached data packet to obtain the cluster information includes:
sequentially storing a plurality of data contents in the information packet in each address unit of a preset address interval according to the arrangement sequence, and recording the data contents as a cached information packet;
after receiving the newly added information packet, determining the data volume of the newly added information packet;
when it is determined that the sum of the data amount of the newly added packet and the data amount of the buffered packet is equal to the data amount of the cluster information, starting to store the data content of the newly added packet in a next address unit of a last address unit stored in the buffered packet, and determining a plurality of data contents from a first address unit stored in the preset address section of the buffered packet to a last address unit stored in the preset address section of the newly added packet as the cluster information;
When it is determined that the sum of the data amount of the newly added packet and the data amount of the buffered packet is greater than the data amount of the cluster information, the data content of the newly added packet is stored starting at the next address unit of the last address unit stored in the buffered packet, and a plurality of data contents from the first address unit of the buffered packet stored in the preset address section to a target address unit determined from the first address unit of the newly added packet stored in the preset address section and an address offset determined by a storage specification of a remaining data amount and an address unit, the remaining data amount being determined by a difference calculation between the data amount of the cluster information and the buffered packet, are determined as the cluster information.
Optionally, before determining the data amount of the new packet, the method further includes:
acquiring a target field in header information of the newly-added information packet, and determining whether the data content exists in the newly-added information packet according to the target field, wherein the target field is a field extracted from the information packet and used for representing whether the data content exists in the information packet;
And if the data content exists in the newly added information packet according to the target field, executing the step of determining the data quantity of the newly added information packet.
Optionally, before determining whether all information contents of the cluster information have been received based on the header information of the information packet, the method further includes:
performing header information integrity verification according to the data volume of the header information of the information packet; the header information integrity check is used for determining that the header information is complete when the data volume of the header information reaches a preset threshold value;
if the header information is determined to be complete, the step of determining whether all information contents of the cluster information are received based on the header information of the information packet is carried out;
and if the header information is determined to be incomplete, caching the information packet, and after receiving a new information packet, executing the header information integrity check based on the sum of the data amounts of the cached information packet and the new information packet.
In a second aspect, the present application further provides a device for transmitting cluster information, where the device is used in a data transmission system, and the data transmission system includes: the device comprises a client, a cluster and a gatekeeper positioned between the client and the cluster, wherein a preset mapping relation between gatekeeper address information of the gatekeeper and cluster address information of the cluster is preconfigured in the data transmission system, and the device comprises:
The acquisition unit is used for acquiring cluster information corresponding to the clusters, wherein the cluster information comprises cluster address information;
the determining unit is used for determining the gatepost address information corresponding to the cluster address information based on the preset mapping relation;
a replacing unit, configured to replace, in the cluster information, the cluster address information with the gatekeeper address information;
and the transmission unit is used for transmitting the replaced cluster information to the client.
Optionally, the cluster address information includes a first network address and a first port; the gateway address information comprises a second network address and a second port; the preset mapping relation comprises a first relation and a second relation, and the first relation is used for representing the corresponding relation of each first network address and each second network address; the second relationship is used for representing the corresponding relationship between each first port and each second port;
the determination unit includes:
a first determining module configured to determine, based on the first relationship, the second network address corresponding to the first network address, and determine, based on the second relationship, the second port corresponding to the first port;
And the second determining module is used for determining the second network address and the second port as the gatepost address information.
Optionally, the first network address includes a node IP address of the cluster; the first port comprises a node port of a cluster; the second network address comprises a gatekeeper IP address, and the second port comprises a gatekeeper port; the cluster comprises at least one node, and each node corresponds to one node IP address and one node port;
the apparatus further comprises:
the setting unit is used for setting a corresponding gateway IP address for the node IP address of each node in the cluster and setting a corresponding gateway port for the node port of each node in the cluster;
a relationship determining unit, configured to determine the first relationship based on the node IP address and the gatekeeper IP address, and determine the second relationship based on the node port and the gatekeeper port;
the first determining module is specifically configured to determine, based on the first relationship, the gatepost IP address corresponding to the node IP address, and determine, based on the second relationship, the gatepost port corresponding to the node port.
Optionally, the replacing unit includes:
a first replacing module, configured to replace, in the cluster information, the cluster address information with the gatekeeper address information when it is determined that the byte length of the gatekeeper address information is consistent with the byte length of the cluster address information;
and the second replacing module is used for modifying the gatekeeper address information based on the communication specification of the cluster information to obtain modified gatekeeper address information when the byte length of the gatekeeper address information is not consistent with the byte length of the cluster address information, and replacing the cluster address information in the cluster information based on the modified gatekeeper address information, wherein the byte length of the modified gatekeeper address information is consistent with the byte length of the cluster address information.
Optionally, the cluster information includes at least one information packet;
the acquisition unit includes:
a determining module, configured to receive the information packet, and determine whether all information contents of the cluster information are received based on header information of the information packet;
the merging module is used for merging a plurality of information packets corresponding to the cluster information to obtain the cluster information if the fact that all information contents of the cluster information are received is determined;
And the caching module is used for caching the information packet corresponding to the cluster information if the fact that all the information of the cluster information is not received is determined, so that the cluster information is obtained after all the information content of the cluster information is determined to be received.
Optionally, the determining module is further configured to determine, according to header information of the information packet, a data amount of the cluster information, and determine whether the data amount of the information packet is consistent with the data amount of the cluster information, where when the data amount of the information packet is consistent with the data amount of the cluster information, it is determined that all information contents of the cluster information are received, or not all information contents are received;
and the merging module is further used for caching the information packet and merging the newly added information packet with the cached data packet to obtain the cluster information if the data quantity of the cluster information is not consistent with the data quantity of the information packet.
Optionally, the acquiring unit further includes:
and the cluster information determining module is used for determining the information packet as the cluster information if the data quantity of the cluster information is determined to be consistent with the data quantity of the information packet.
Optionally, the merging module includes:
the sequencing sub-module is used for sequentially storing a plurality of data contents in the information packet into each address unit of a preset address interval according to the sequence of the sequencing, and recording the data contents as a cached information packet;
the determining submodule is used for determining the data quantity of the newly added information packet after receiving the newly added information packet;
a first operation module, configured to, when it is determined that the sum of the data amount of the new packet and the data amount of the buffered packet is equal to the data amount of the cluster information, start storing the data content of the new packet at a next address unit of a last address unit stored in the buffered packet, and determine, as the cluster information, a plurality of data contents from a first address unit stored in the preset address section of the buffered packet to a last address unit stored in the preset address section of the new packet;
and a second operation module configured to, when it is determined that the sum of the data amount of the new packet and the data amount of the buffered packet is greater than the data amount of the cluster information, start storing the data content of the new packet at a next address unit of a last address unit stored in the buffered packet, and determine a plurality of data contents from a first address unit to a target address unit of the buffered packet stored in the preset address section as the cluster information, wherein the target address unit is determined according to the first address unit and an address offset of the new packet stored in the preset address section, the address offset is determined by a storage specification of a remaining data amount and an address unit, and the remaining data amount is determined by a difference calculation between the data amount of the cluster information and the buffered packet.
Optionally, the merging module further includes:
the acquisition sub-module is used for acquiring a target field in the header information of the newly-added information packet, determining whether the data content exists in the newly-added information packet according to the target field, wherein the target field is a field extracted from the information packet and used for representing whether the data content exists in the information packet;
and the execution sub-module is used for executing the step of determining the data volume of the newly added information packet if the data content exists in the newly added information packet according to the target field.
Optionally, the acquiring unit further includes:
the verification module is used for executing the integrity verification of the header information according to the data quantity of the header information of the information packet; the header information integrity check is used for determining that the header information is complete when the data volume of the header information reaches a preset threshold value;
the first execution module is used for executing the step of determining whether all information contents of the cluster information are received or not based on the head information of the information packet if the head information is determined to be complete;
and the second execution module is used for caching the information packet if the head information is determined to be incomplete, and executing the head information integrity check based on the sum of the data volumes of the cached information packet and the newly added information packet after receiving the newly added information packet.
In a third aspect, an embodiment of the present application provides a storage medium, where the storage medium includes a stored program, and when the program runs, controls a device where the storage medium is located to execute the method for transmitting cluster information of the terminal device in the first aspect.
In a fourth aspect, an embodiment of the present application provides a cluster information transmission apparatus, where the apparatus includes a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; and executing the transmission method of the cluster information of the terminal equipment in the first aspect when the program instructions run.
By means of the technical scheme, the technical scheme provided by the application has at least the following advantages:
the application provides a method and a device for transmitting cluster information, wherein the method and the device are used for a data transmission system, and the data transmission system comprises the following steps: the data transmission system comprises a client, a cluster and a gatekeeper positioned between the client and the cluster, wherein a preset mapping relation between gatekeeper address information of the gatekeeper and cluster address information of the cluster is pre-configured in the data transmission system. The method and the device can firstly acquire the cluster information corresponding to the clusters, wherein the cluster information comprises cluster address information; then, based on the preset mapping relation, determining the gateway address information corresponding to the cluster address information; and then, in the cluster information, replacing the cluster address information by adopting the gateway address information, and finally transmitting the replaced cluster information to a client, thereby realizing the transmission function of the cluster information. Compared with the prior art, the method and the device have the advantages that the address information in the cluster information can be replaced with the corresponding gatekeeper address information according to the preset mapping relation in the process of transmitting the cluster information, so that the client can only acquire the gatekeeper address information instead of the address information of the original cluster equipment in the process of transmitting the cluster information to the client, the situation that the address of the cluster is revealed to the client in the process of interaction between the cluster and the client is avoided, and even if the client is attacked by an attacker such as a hacker, the address information of the cluster cannot be acquired, and the problem that the hacker attacks the cluster equipment based on the address information is avoided, so that the security of the cluster equipment is guaranteed.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. In the drawings, wherein like or corresponding reference numerals indicate like or corresponding parts, there are shown by way of illustration, and not limitation, several embodiments of the application, in which:
fig. 1 shows a flowchart of a method for transmitting cluster information according to an embodiment of the present application;
fig. 1-a is a schematic diagram illustrating an implementation process of a method for transmitting cluster information according to an embodiment of the present application;
fig. 2 is a flowchart of another method for transmitting cluster information according to an embodiment of the present application;
fig. 3 is a block diagram of a cluster information transmission device according to an embodiment of the present application;
fig. 4 is a block diagram illustrating another cluster information transmission apparatus according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
It is noted that unless otherwise indicated, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs.
The embodiment of the application provides a method for transmitting cluster information, which is used for a data transmission system, wherein the data transmission system comprises the following steps: the data transmission system comprises a client, a cluster and a gatekeeper positioned between the client and the cluster, wherein a preset mapping relation between gatekeeper address information of the gatekeeper and cluster address information of the cluster is pre-configured in the data transmission system. As shown in fig. 1, the method includes:
101. and obtaining cluster information corresponding to the clusters.
Wherein, the cluster address information is obtained from the cluster information.
In this embodiment, the cluster information may be understood as information sent by a cluster in the interaction process of the cluster device and the client, and based on a requirement of a communication protocol, the cluster information necessarily includes related attribute information of the cluster device, which includes cluster address information, where the cluster address information may be understood as information that may represent an address of a cluster, for example, various information such as an IP address, port information, and the like. The IP address (Internet Protocol Address) refers to an internet protocol address, which is translated into an internet protocol address, and is information used to determine a network location of a device in a network, and the port information may be understood as "a port" which may be considered as an outlet for communication between the device and the outside. Ports can be divided into virtual ports and physical ports, where virtual ports refer to ports within a computer or within a switch router, typically used by individual functions or services. Therefore, in this embodiment, in order to ensure the security of the cluster device, it is necessary to acquire cluster address information in the cluster information. Specifically, the process of obtaining the cluster address information includes, but is not limited to, obtaining the address information from Metadata in the cluster information, where Metadata (english: metadata), also called intermediate data and relay data, is a data for describing data, mainly describing data attributes. Metadata is primarily used to support functions such as indicating storage locations, history data, resource lookups, file records, and the like. Metadata is an electronic catalog, and in order to achieve the purpose of cataloging, the contents or characteristics of data must be described and collected, so as to achieve the purpose of assisting in data retrieval. Accordingly, cluster address information describing information such as an IP address and a port can be acquired from metadata of the cluster information.
102. And determining the gateway address information corresponding to the cluster address information based on a preset mapping relation.
The preset mapping relation comprises network gate address information corresponding to each cluster address information.
In the method described in this embodiment, since the cluster device is implemented based on the gatekeeper in the process of client interaction, where the gatekeeper may be understood as an information exchange device for blocking between the client and the cluster, or proxy device, which is mainly used to divide the network between the client and the cluster by two devices at two ends, that is, the client and the cluster, where the main manner of division may be as shown in fig. 1-a, the gatekeeper may be divided into inner and outer sides, and interact with the corresponding client and cluster respectively, and the inner and outer sides perform data transmission through exchange cards, that is, in this process, actually, the client establishes a connection with one end outside the gatekeeper in the diagram, then the cluster establishes a connection with one end inside the gatekeeper, and then the gatekeeper between the inner side and the gatekeeper outer side is connected through the exchange card built in the gatekeeper, so that in the communication transmission process actually does not establish a connection relationship between the client and the cluster, but forms a network with two sides different based on the gatekeeper. Therefore, in this embodiment, in order to ensure that the subsequent cluster information is prevented from leaking when sent to the client, the gatepost address information corresponding to the cluster address information may be determined in this step based on the preset mapping relationship. The preset mapping relationship may be understood as preset address information of each cluster and address information of a corresponding node or port of the gatekeeper when the gatekeeper forwards the cluster message.
103. In the cluster information, the gatekeeper address information is used for replacing the cluster address information.
After the gateway address information corresponding to the cluster address information is determined, the cluster address information in the cluster information can be replaced based on the gateway address information, so that the client can only acquire the gateway address information corresponding to the cluster address information instead of the original cluster address information when the cluster information is transmitted later.
104. And transmitting the replaced cluster information to the client.
After the cluster address information is replaced by the gateway address information, the obtained replaced cluster information does not actually contain the original cluster address information, so that even if a subsequent client side has malicious intent or even attack intent, the attack on the cluster cannot be directly realized based on the gateway address information, and the safety of cluster equipment is ensured.
The application provides a method for transmitting cluster information, which can firstly acquire cluster information corresponding to a cluster, wherein the cluster information comprises cluster address information; then, based on a preset mapping relation, determining the gatepost address information corresponding to the cluster address information; and then, in the cluster information, replacing the cluster address information by adopting the gateway address information, and finally transmitting the replaced cluster information to a client, thereby realizing the transmission function of the cluster information. Compared with the prior art, the method and the device have the advantages that the address information in the cluster information can be replaced with the corresponding gatekeeper address information according to the preset mapping relation in the process of transmitting the cluster information, so that the client can only acquire the gatekeeper address information instead of the address information of the original cluster equipment in the process of transmitting the cluster information to the client, the situation that the address of the cluster is revealed to the client in the process of interaction between the cluster and the client is avoided, and even if the client is attacked by an attacker such as a hacker, the address information of the cluster cannot be acquired, and the problem that the hacker attacks the cluster equipment based on the address information is avoided, so that the security of the cluster equipment is guaranteed.
For more detailed description below, another method for transmitting cluster information is provided in the embodiments of the present application, specifically as shown in fig. 2, where the method includes:
201. and obtaining cluster information corresponding to the clusters.
Wherein the cluster information comprises cluster address information.
In particular, since in practical applications, the cluster information may consist of a plurality of information packets, in this case, the cluster information includes at least one information packet;
based on this, the process of obtaining the cluster information corresponding to the cluster in this step may include:
receiving the information packet, and determining whether all information contents of the cluster information are received based on header information of the information packet;
based on the judgment result, the following two aspects can be classified:
on the one hand, if all the information contents of the cluster information are received, combining a plurality of information packets corresponding to the cluster information to obtain the cluster information.
On the other hand, if it is determined that all the information of the cluster information is not received, the information packet corresponding to the cluster information is cached, so that when it is determined that all the information contents of the cluster information are received, the cluster information is obtained by combining.
When it is determined that all the packets in the cluster information have been received, it is indicated that the cluster information has completed all transmission from the cluster device to the gatekeeper, and then the complete cluster information can be obtained based on the combination of the packets. Therefore, when the cluster information corresponding to the clusters is acquired, the received information packet can be checked, so that the integrity of the cluster information is ensured, and the problem of data loss caused by packet loss during transmission through a gateway is avoided.
When it is determined that all the packets are not received in the cluster information, it is indicated that the cluster side does not send all the packets, which may be caused by problems such as network, and in this case, the received packets need to be cached in the local area of the gatekeeper, so as to ensure that the packets are merged when the remaining packets are subsequently received, so that the packet loss in the process of forwarding the cluster information is avoided, and meanwhile, it is ensured that after the packets are cached, the remaining packets do not need to be waited for all the time, and other packets can be continuously received, thereby avoiding the problem of communication blocking.
Further, in the above-described process of determining whether the entire content of the cluster information is received, the determination may be actually made based on the data amount determined by the header information of the packet and the data amount of the received packet. Based on this, the determining in this step whether all information contents of the cluster information have been received based on the header information of the packet includes:
and determining the data quantity of the cluster information through the header information of the information packet, and determining whether the data quantity of the information packet is consistent with the data quantity of the cluster information, wherein when the data quantity of the information packet is consistent with the data quantity of the cluster information, determining that all information contents of the cluster information are received, or else, not receiving all information contents.
For example, when it is determined that the data amount of the cluster information is 40 kilobytes based on the header information of the packet, if the total data amount of the packet that has been received is also 40 kilobytes, which are the same, it is indicated that the entire information content of the current cluster information has been received.
Based on this, when it is determined that the entire information content of the cluster information is not received based on the data amount of the packet, it is indicated that the current cluster information may be divided into a plurality of packets to be sent, and if it is determined that the entire information content of the cluster information is received in this step, the plurality of packets corresponding to the cluster information are combined to obtain the cluster information, which may specifically be executed: if the data quantity of the cluster information is not consistent with the data quantity of the information packet, caching the information packet, merging the newly added information packet with the cached data packet to obtain the cluster information,
When the packet-based data size is not equal to the packet-based data size of the cluster information, it is indicated that the cluster information is transmitted in a plurality of packets, and then it is necessary to buffer already received packets and to combine the buffered packets with newly added packets when newly received packets are subsequently detected.
Further, in determining whether the entire information content of the cluster information is received based on the data amount, there may be a case in fact that, in case that the data amount of the current packet is the same as the data amount of the cluster information, it is indicated that the cluster information is actually transmitted in a packet manner, and after said determining whether the data amount of the packet is consistent with the data amount of the cluster information, the method further includes: and if the data quantity of the cluster information is consistent with the data quantity of the information packet, determining the information packet as the cluster information. Therefore, after the information packet is received, the information packet is directly used as cluster information for transmission without waiting for other subsequent information packets, and the transmission efficiency can be improved.
As can be seen from the foregoing description in this step, since the cluster information may be sent in a manner of a plurality of packets, the method in this embodiment needs to consider that the received packet is combined with a subsequently received packet in the process of transmitting the cluster information, and in this process, buffering the packet and combining a new packet with the buffered packet to obtain the cluster information includes:
firstly, sequentially storing a plurality of data contents in the information packet into each address unit of a preset address interval according to an arrangement sequence, and recording the data contents as a cached information packet;
then, after receiving the newly added information packet, determining the data volume of the newly added information packet;
and then, based on the data quantity of the newly added information packet and the data quantity of the cached information packet, the sum calculation is carried out between the newly added information packet and the cached information packet, and the data quantity of the newly added information packet and the cached information packet are compared, so that whether the cluster information is received or not can be determined, and the following two ways can be carried out in the process:
in one aspect, when it is determined that the sum of the data amount of the new packet and the data amount of the buffered packet is equal to the data amount of the cluster information, the data content of the new packet is stored starting at a next address unit of a last address unit stored in the buffered packet, and a plurality of data contents from a first address unit stored in the preset address section of the buffered packet to a last address unit stored in the preset address section of the new packet are determined as the cluster information.
On the other hand, when it is determined that the sum of the data amount of the newly added packet and the data amount of the buffered packet is larger than the data amount of the cluster information, the data content of the newly added packet is stored starting at the next address unit of the last address unit stored in the buffered packet, and a plurality of data contents from the first address unit of the buffered packet stored in the preset address section to a target address unit determined from the first address unit of the newly added packet stored in the preset address section and an address offset determined by a storage specification of a remaining data amount and an address unit determined by a difference calculation between the data amount of the cluster information and the buffered packet are determined as the cluster information.
In the above two aspects, in the case of the previous aspect, it may be understood that the data amount of the current newly added packet plus the data amount of the cached packet is just equal to the data amount of the cluster information, which indicates that the newly added packet and the cached packet just form the complete cluster information. In the process of caching, the middle character information of the information packet is actually stored in the address unit with the same byte in the form of bytes, and after the new information packet is received, the character content of the new information packet is continuously stored in the next address unit after the last address unit stored in the cached information packet, so that the character content of the cached information packet and the character content of the new information packet in the storage area are sequentially stored in the byte unit, and based on the property of the communication protocol of the cluster equipment, a plurality of information packets related to the cluster information are sequentially transmitted in the process of cluster information transmission, so that the data stored in the first address unit of the cached information packet to the last address unit stored in the new information packet is just complete cluster information, and the data content of the address interval can be directly determined as the cluster information. Therefore, in the process of caching data, orderly storage of data content is realized by means of continuous address units, realization of a merging function is ensured, a process of independently merging data is simplified, and the transmission efficiency of cluster information is improved.
Similarly, in the above two aspects, when it is determined that the total data size of the new packet and the buffered packet is larger than the data size of the cluster information, it may be actually understood that the "next part" of the previous cluster information and the "previous part" of the next cluster information are stored in the new packet, and then it is necessary to continue storing the new packet after continuing to store the address unit stored in the buffered packet according to the method described above, and then it is necessary to determine that the information "cut" is performed from that address to obtain the complete previous cluster information, and the position of the "cut" is actually the target address unit described in this embodiment. In this embodiment, the target address unit is actually determined by the data amount. Specifically, the execution process may be that the position where the last data content of the cached packet is stored is first determined, and may be recorded as an address 1, then the number of the cached packets is subtracted from the data amount of the cluster information to obtain a remaining data amount, where the remaining data amount is the remaining part of the cluster information in the newly added packet, and then the offset is determined based on the remaining data amount and the storage rule of the address unit, where when the remaining data amount is the same as the unit of the storage rule of the address unit, the remaining data amount is equal to the offset, for example, both are kilobytes, or both are bytes, and then both are equal to each other. The determined offset is actually the address unit of the offset found starting at address 1, resulting in the target address unit. If the false offset is 10, address 11 is searched from address 1, and the data content stored from address 1 to address 11 is the cluster information.
Further, because based on the characteristics of the communication transmission protocol, not all packets contain the content of the cluster information in the process of transmitting the cluster information in a plurality of packets, and the existence of the packets such as the connection state may be confirmed, then the next received packet needs to be checked in the process of buffering in the foregoing steps, so as to avoid buffering the data content of the non-cluster information. Based on this, before determining the data amount of the newly added packet, the method further includes:
acquiring a target field in header information of the newly-added information packet, and determining whether the data content exists in the newly-added information packet according to the target field, wherein the target field is a field extracted from the information packet and used for representing whether the data content exists in the information packet;
and if the data content exists in the newly added information packet according to the target field, executing the step of determining the data quantity of the newly added information packet.
In this embodiment, the target field of the specific header information may be an api_key field in the header file of the packet pdu, for example, in some cases, when a specific parameter of the api_key of the target field appears in a plurality of packets corresponding to a certain cluster information is 3, it is indicated that the packet includes the data content of the cluster information, and then the step of determining the data amount of the newly added packet in the foregoing steps may be continued. When the data content of the packet is determined based on the destination field, which does not involve the cluster information, then there is no need to perform other steps including determining the data amount of the newly added packet and subsequent steps, and to continue waiting for subsequent packets.
Further, before determining whether all information contents of the cluster information have been received, there may be some cases, for example, the information packet itself involves less information contents, and the condition of parsing the header information cannot be satisfied, for example, the data amount of the header information is too small. In this embodiment, before determining whether all information contents of the cluster information have been received based on the header information of the packet, the method further includes:
performing header information integrity verification according to the data volume of the header information of the information packet; the header information integrity check is used for determining that the header information is complete when the data volume of the header information reaches a preset threshold value;
if the header information is determined to be complete, the step of determining whether all information contents of the cluster information are received based on the header information of the information packet is carried out;
and if the header information is determined to be incomplete, caching the information packet, and after receiving a new information packet, executing the header information integrity check based on the sum of the data amounts of the cached information packet and the new information packet.
Therefore, whether the header information is complete or not is checked by utilizing the data quantity of the header information, and the problem of analysis failure caused by incomplete analysis of the header information can be effectively avoided, so that the follow-up steps can be smoothly carried out, and the whole cluster information transmission operation can be smoothly executed.
202. Setting a corresponding gateway IP address for the node IP address of each node in the cluster, and setting a corresponding gateway port for the node port of each node in the cluster.
Since in practical application, each cluster belongs to a device group formed by a plurality of nodes, each node corresponds to one physical device or virtual device, the virtual device can be a virtual machine in the form of a container arranged in the physical device, and one physical device can be provided with a plurality of virtual devices. In such a cluster, each of the different functions and services are deployed at different nodes, and when a client needs to use a certain function or call a certain service, a request is initiated to a corresponding node of the cluster, so that the feedback implementation is based on the corresponding node of the cluster.
Based on the above, in the process of guaranteeing the security of the cluster, the security of each node in the cluster is guaranteed. Thus, in this embodiment, the foregoing cluster information may be actually understood as information sent by a certain node in the cluster, and then the cluster address information is actually, that is, the address information of the node in the cluster, and, in addition, since the cluster address information may be actually divided into two parts of an IP address and a port, then the two parts are respectively included in the cluster address information and the gatepost address information.
Based on this, the first network address comprises a node IP address of the cluster; the first port comprises a node port of a cluster; the second network address comprises a gatekeeper IP address, and the second port comprises a gatekeeper port; the cluster comprises at least one node, and each node corresponds to one node IP address and one node port.
In this way, in this step, by setting a corresponding gatekeeper IP address for the node IP address of each node of the cluster, a corresponding gatekeeper port is set for the node port of each node of the cluster, so as to lay a foundation for determining a preset mapping relationship based on the corresponding relationship between the two.
203. A first relationship is determined based on the node IP address and the gatekeeper IP address, and a second relationship is determined based on the node port and the gatekeeper port.
If the corresponding gateway IP address is set for the node IP address in the foregoing step, the first relationship may be determined based on the relationship between the two, and similarly, if the corresponding gateway port is set for the node port in the foregoing step, the second relationship may be determined based on the relationship between the two. Therefore, a foundation can be laid for determining corresponding information about the node IP address and the node port in the cluster address information in the cluster information based on the first relation and the second relation.
204. And determining the gateway address information corresponding to the cluster address information based on a preset mapping relation.
The preset mapping relation comprises network gate address information corresponding to each cluster address information.
Specifically, the cluster address information includes a first network address and a first port; the gateway address information comprises a second network address and a second port; the preset mapping relation comprises a first relation and a second relation, and the first relation is used for representing the corresponding relation of each first network address and each second network address; the second relationship is used for representing the corresponding relationship between each first port and each second port;
based on this, this step, when executed, may include:
determining the second network address corresponding to the first network address based on the first relationship, and determining the second port corresponding to the first port based on the second relationship;
and determining the second network address and the second port as the gatekeeper address information.
In this step, since the cluster address information can be divided into two parts, namely, a network address and a port, the process of determining the gatepost address information corresponding to the cluster address information based on the preset mapping relationship is actually divided into two parts, namely, determining the network address and confirming the port. For the former, it may be determined based on a first relationship among preset mappings, and for the latter, it may be determined based on a second relationship among preset mappings. In this way, in determining the cluster address information, it is ensured that the second network address corresponding to the first network address of the cluster, that is, the network address provided by the gatekeeper, is determined based on the first relationship, and meanwhile, the second port corresponding to the first port of the cluster, that is, the port provided by the gatekeeper, is determined based on the second relationship, so that a function of determining specific contents in the cluster address information according to the corresponding relationship is realized.
Further, based on the foregoing step, it may be known that, in a case where the preset mapping relationship includes a first relationship and a second relationship, and the first network address is specifically a node IP address, and the second network address is specifically a gatekeeper IP address, the first port is a node port, and the second port is a gatekeeper port, in this step, the second network address corresponding to the first network address is determined based on the first relationship, and the second port corresponding to the first port is determined based on the second relationship, where the performing may specifically be:
and determining the gateway IP address corresponding to the node IP address based on the first relation, and determining the gateway port corresponding to the node port based on the second relation.
The first relation is used for determining the gateway IP address corresponding to the node IP address, and the second relation is used for determining the gateway port corresponding to the node port, so that the effect of determining the node IP address and the node port from the gateway side is achieved, and a data foundation is laid for subsequent replacement. Meanwhile, the two angles based on the first relation and the second relation are respectively determined, so that the possibility of confusion of the IP address and the port is avoided, and the accuracy of a determination result is ensured.
205. In the cluster information, the gatekeeper address information is used for replacing the cluster address information.
Specifically, the step may include:
and when the byte length of the gatekeeper address information is consistent with the byte length of the cluster address information, replacing the cluster address information with the gatekeeper address information in the cluster information.
Since in practical applications the byte length of the metadata at the time of interaction between the cluster and the client is specified, in this case, if the byte length of the gatekeeper address information and the cluster address information at the time of replacement are different, the parsing of the subsequent client will be affected. Therefore, in the present embodiment, it is necessary to determine whether the byte lengths therebetween agree. Wherein if consistent, it can be directly replaced. Otherwise, if the two are inconsistent, the gatekeeper address information needs to be modified to ensure that the modified gatekeeper address information is the same as the original cluster address information in byte length. For example, when it is determined that the byte length of the gatekeeper address information is less than the cluster address information, a placeholder may be added to the gatekeeper address information, thereby ensuring that the modified gatekeeper address information is consistent with the byte length of the original cluster address information of the cluster information.
Further, in some cases, since the cluster address information is actually set in compliance with the communication specification set by the communication protocol, in practical application, the actually allowed byte length of the cluster address information may be within a length interval, and in this case, it is not necessary to strictly modify the gatepost address information to be consistent with the byte length of the cluster address information, but only to ensure compliance with the requirement of the communication specification.
Based on this, the replacing the cluster address information with the gatekeeper address information in the cluster information includes:
when the byte length of the gatekeeper address information is inconsistent with the byte length of the cluster address information, modifying the gatekeeper address information based on the communication specification of the cluster information to obtain corrected gatekeeper address information, and replacing the cluster address information in the cluster information based on the corrected gatekeeper address information, wherein the byte length of the corrected gatekeeper address information accords with the communication specification.
Thus, when it is determined that the byte length of the gatekeeper address information is inconsistent with the byte length of the cluster address information, the gatekeeper address information can be modified based on the communication specification of the cluster information to ensure that the byte length of the corrected gatekeeper address information conforms to the communication specification. Of course, no modification may be required if it is determined in this process that the byte length of the current gatekeeper address information itself already complies with the communication specification.
206. And transmitting the replaced cluster information to the client.
When the cluster address information of the cluster information is replaced, the obtained replaced cluster information can be forwarded to the client, and the client can only acquire the port and the IP address provided by the gateway instead of the node port or the node IP of the cluster based on any information such as the gateway address information, the corrected gateway address information and the like after acquiring the cluster information, so that the problem of address leakage of the nodes of the cluster can be ensured, and the safety of the cluster equipment is improved.
Further, as an implementation of the methods shown in fig. 1 and fig. 2, another embodiment of the present application further provides a device for transmitting cluster information. The embodiment of the transmission device of the cluster information corresponds to the embodiment of the method, so that the embodiment of the transmission device of the cluster information does not need to describe details in the embodiment of the method one by one, but it should be clear that the device in the embodiment can correspondingly realize all the contents in the embodiment of the method. As shown in fig. 3, the apparatus is used in a data transmission system, and the data transmission system includes: the device comprises a client, a cluster and a gatekeeper positioned between the client and the cluster, wherein a preset mapping relation between gatekeeper address information of the gatekeeper and cluster address information of the cluster is preconfigured in the data transmission system, and the device comprises:
The obtaining unit 31 may be configured to obtain cluster information corresponding to the cluster, where the cluster information includes cluster address information;
a determining unit 32, configured to determine, based on the preset mapping relationship, gatepost address information corresponding to the cluster address information;
a replacing unit 33, configured to replace the cluster address information with the gatekeeper address information in the cluster information;
the transmission unit 34 may be configured to transmit the replaced cluster information to the client.
Further, as shown in fig. 4, the cluster address information includes a first network address and a first port; the gateway address information comprises a second network address and a second port; the preset mapping relationship comprises a first relationship and a second relationship, and the first relationship can be used for representing the corresponding relationship between each first network address and each second network address; the second relationship may be used to characterize a correspondence of each of the first ports and the second ports;
the determination unit 32 includes:
a first determining module 321, configured to determine, based on the first relationship, the second network address corresponding to the first network address, and determine, based on the second relationship, the second port corresponding to the first port;
A second determining module 322 may be configured to determine the second network address and the second port as the gatekeeper address information.
Further, as shown in fig. 4, the first network address includes a node IP address of the cluster; the first port comprises a node port of a cluster; the second network address comprises a gatekeeper IP address, and the second port comprises a gatekeeper port; the cluster comprises at least one node, and each node corresponds to one node IP address and one node port;
the apparatus further comprises:
a setting unit 35, configured to set a corresponding gatepost IP address for a node IP address of each of the nodes in the cluster, and set a corresponding gatepost port for a node port of each of the nodes in the cluster;
a relationship determination unit 36 operable to determine the first relationship based on the node IP address and the gatekeeper IP address, and to determine the second relationship based on the node port and the gatekeeper port;
the first determining module 321 may be specifically configured to determine, based on the first relationship, the gatekeeper IP address corresponding to the node IP address, and determine, based on the second relationship, the gatekeeper port corresponding to the node port.
Further, as shown in fig. 4, the replacing unit 33 includes:
the first replacing module 331 may be configured to replace, in the cluster information, the cluster address information with the gatepost address information when it is determined that the byte length of the gatepost address information is consistent with the byte length of the cluster address information;
the second replacing module 332 may be configured to modify the gatekeeper address information based on the communication specification of the cluster information when it is determined that the byte length of the gatekeeper address information is inconsistent with the byte length of the cluster address information, to obtain modified gatekeeper address information, and replace the cluster address information in the cluster information based on the modified gatekeeper address information, where the byte length of the modified gatekeeper address information is consistent with the byte length of the cluster address information.
Further, as shown in fig. 4, the cluster information includes at least one packet;
the acquisition unit 31 includes:
a determining module 311, configured to receive the packet, and determine whether all information contents of the cluster information are received based on header information of the packet;
A merging module 312, configured to, if it is determined that all the information contents of the cluster information are received, merge a plurality of information packets corresponding to the cluster information to obtain the cluster information;
the buffer module 313 may be configured to buffer the information packet corresponding to the cluster information if it is determined that all the information of the cluster information is not received, so as to combine after it is determined that all the information content of the cluster information is received, thereby obtaining the cluster information.
Further, as shown in fig. 4, the determining module 311 may be further configured to determine, by using header information of the packet, a data amount of the cluster information, and determine whether the data amount of the packet is consistent with the data amount of the cluster information, where when the data amount of the packet is consistent with the data amount of the cluster information, it is determined that all information contents of the cluster information are received, or not all information contents are received;
the merging module 312 may be further configured to buffer the packet if it is determined that the data amount of the cluster information is inconsistent with the data amount of the packet, and merge a new packet with the buffered packet to obtain the cluster information.
Further, as shown in fig. 4, the obtaining unit 31 further includes:
the cluster information determining module 314 may be configured to determine the packet as the cluster information if it is determined that the data amount of the cluster information matches the data amount of the packet.
Further, as shown in fig. 4, the merging module 312 includes:
the ordering sub-module 3121 may be configured to store a plurality of data contents in the information packet in each address unit of a preset address interval in sequence according to an ordering order, and record the data contents as a cached information packet;
a determining submodule 3122, configured to determine a data amount of the newly added packet after receiving the newly added packet;
the first operation module 3123 may be configured to, when determining that the sum of the data amount of the new packet and the data amount of the buffered packet is equal to the data amount of the cluster information, start storing the data content of the new packet at a next address unit of a last address unit stored in the buffered packet, and determine a plurality of data contents from a first address unit stored in the preset address section of the buffered packet to a last address unit stored in the preset address section of the new packet as the cluster information;
The second operation module 3124 may be configured to, when determining that the sum of the data amount of the new packet and the data amount of the buffered packet is greater than the data amount of the cluster information, start storing the data content of the new packet at a next address unit of a last address unit stored in the buffered packet, and determine a plurality of data contents from a first address unit of the buffered packet stored in the preset address section to a target address unit as the cluster information, wherein the target address unit is determined according to the first address unit of the new packet stored in the preset address section and an address offset determined by a storage specification of a remaining data amount and an address unit, and the remaining data amount is determined according to a difference calculation between the data amount of the cluster information and the buffered packet.
Further, as shown in fig. 4, the merging module 312 further includes:
the obtaining submodule 3125 may be configured to obtain a target field from header information of the new packet, and determine whether the data content exists in the new packet according to the target field, where the target field is a field extracted from the packet and may be used to characterize whether the data content exists in the packet;
The execution submodule 3126 may be configured to, if it is determined that the data content exists in the new packet according to the target field, switch to the step of executing the determination of the data amount of the new packet.
Further, as shown in fig. 4, the obtaining unit 31 further includes:
a verification module 315, configured to perform header information integrity verification according to the data size of the header information of the packet; the header information integrity check may be used to determine that the header information is complete when the data size of the header information reaches a preset threshold;
the first execution module 316 may be configured to, if it is determined that the header information is complete, go to execute the step of determining whether all information contents of the cluster information are received based on the header information of the packet;
the second execution module 317 may be configured to buffer the packet if it is determined that the header information is incomplete, and execute the header information integrity check based on a sum of data amounts of the buffered packet and the newly added packet after receiving the newly added packet.
The embodiment of the application provides a method and a device for transmitting cluster information, wherein the method and the device are used for a data transmission system, and the data transmission system comprises the following steps: the data transmission system comprises a client, a cluster and a gatekeeper positioned between the client and the cluster, wherein a preset mapping relation between gatekeeper address information of the gatekeeper and cluster address information of the cluster is pre-configured in the data transmission system. In the embodiment of the application, the cluster information corresponding to the cluster can be acquired first, wherein the cluster information comprises cluster address information; then, based on a preset mapping relation, determining the gatepost address information corresponding to the cluster address information; and then, in the cluster information, replacing the cluster address information by adopting the gateway address information, and finally transmitting the replaced cluster information to a client, thereby realizing the transmission function of the cluster information. Compared with the prior art, the method and the device have the advantages that the address information in the cluster information can be replaced with the corresponding gateway address information according to the preset mapping relation in the process of transmitting the cluster information, so that the client can only acquire the gateway address information instead of the address information of the original cluster equipment in the process of transmitting the cluster information to the client, the situation that the address of the cluster is revealed to the client in the process of interaction between the cluster and the client is avoided, even if the client is attacked by an attacker such as a hacker, the address information of the cluster cannot be acquired, the problem that the hacker attacks the cluster equipment based on the address information is avoided, and the safety of the cluster equipment is guaranteed.
The embodiment of the application provides a storage medium, which comprises a stored program, wherein when the program runs, equipment where the storage medium is controlled to execute the method for transmitting the cluster information.
The storage medium may include volatile memory, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the application also provides a cluster information transmission device, which comprises a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; and executing the cluster information transmission method when the program instruction runs.
The embodiment of the application provides equipment, which is used for a data transmission system, wherein the data transmission system comprises: the data transmission system is provided with a preset mapping relation between the gatekeeper address information of the gatekeeper and the cluster address information of the cluster in advance, wherein the device comprises a processor, a memory and a program which is stored in the memory and can run on the processor, and the processor realizes the following steps when executing the program: acquiring cluster information corresponding to the clusters, wherein the cluster information comprises cluster address information; determining gatepost address information corresponding to the cluster address information based on the preset mapping relation; in the cluster information, replacing the cluster address information by adopting the gatekeeper address information; and transmitting the replaced cluster information to the client.
Further, the cluster address information includes a first network address and a first port; the gateway address information comprises a second network address and a second port; the preset mapping relation comprises a first relation and a second relation, and the first relation is used for representing the corresponding relation of each first network address and each second network address; the second relationship is used for representing the corresponding relationship between each first port and each second port;
the determining the gatepost address information corresponding to the cluster address information based on the preset mapping relation comprises the following steps:
determining the second network address corresponding to the first network address based on the first relationship, and determining the second port corresponding to the first port based on the second relationship;
and determining the second network address and the second port as the gatekeeper address information.
Further, the first network address includes a node IP address of the cluster; the first port comprises a node port of a cluster; the second network address comprises a gatekeeper IP address, and the second port comprises a gatekeeper port; the cluster comprises at least one node, and each node corresponds to one node IP address and one node port;
Before determining the gatepost address information corresponding to the cluster address information based on the preset mapping relation, the method further comprises:
setting a corresponding gateway IP address for the node IP address of each node in the cluster, and setting a corresponding gateway port for the node port of each node in the cluster;
determining the first relationship based on the node IP address and the gatekeeper IP address, and determining the second relationship based on the node port and the gatekeeper port;
the determining, based on the first relationship, the second network address corresponding to the first network address and determining, based on the second relationship, the second port corresponding to the first port includes:
and determining the gateway IP address corresponding to the node IP address based on the first relation, and determining the gateway port corresponding to the node port based on the second relation.
Further, in the cluster information, replacing the cluster address information with the gatekeeper address information includes:
when the byte length of the gatekeeper address information is consistent with the byte length of the cluster address information, replacing the cluster address information with the gatekeeper address information in the cluster information;
When the byte length of the gatekeeper address information is not consistent with the byte length of the cluster address information, modifying the gatekeeper address information based on the communication specification of the cluster information to obtain modified gatekeeper address information, and replacing the cluster address information in the cluster information based on the modified gatekeeper address information, wherein the byte length of the modified gatekeeper address information is consistent with the byte length of the cluster address information.
Further, the cluster information comprises at least one information packet;
the obtaining cluster information corresponding to the clusters includes:
receiving the information packet, and determining whether all information contents of the cluster information are received based on header information of the information packet;
if all the information contents of the cluster information are received, combining a plurality of information packets corresponding to the cluster information to obtain the cluster information;
and if the fact that all the information of the cluster information is not received is determined, caching the information packet corresponding to the cluster information, so that the cluster information is obtained after all the information contents of the cluster information are determined to be received.
Further, the determining whether all information contents of the cluster information have been received based on the header information of the information packet includes:
determining the data quantity of the cluster information through the header information of the information packet, and determining whether the data quantity of the information packet is consistent with the data quantity of the cluster information, wherein when the data quantity of the information packet is consistent with the data quantity of the cluster information, determining that all information contents of the cluster information are received, or else, not receiving all information contents;
and if it is determined that all the information contents of the cluster information are received, combining a plurality of information packets corresponding to the cluster information to obtain the cluster information, including:
and if the data quantity of the cluster information is inconsistent with the data quantity of the information packet, caching the information packet, and combining a newly added information packet with the cached data packet to obtain the cluster information.
Further, after the determining whether the data amount of the information packet is consistent with the data amount of the cluster information, the method further includes:
and if the data quantity of the cluster information is consistent with the data quantity of the information packet, determining the information packet as the cluster information.
Further, the caching the information packet, and merging the newly added information packet with the cached data packet to obtain the cluster information includes:
sequentially storing a plurality of data contents in the information packet in each address unit of a preset address interval according to the arrangement sequence, and recording the data contents as a cached information packet;
after receiving the newly added information packet, determining the data volume of the newly added information packet;
when it is determined that the sum of the data amount of the newly added packet and the data amount of the buffered packet is equal to the data amount of the cluster information, starting to store the data content of the newly added packet in a next address unit of a last address unit stored in the buffered packet, and determining a plurality of data contents from a first address unit stored in the preset address section of the buffered packet to a last address unit stored in the preset address section of the newly added packet as the cluster information;
when it is determined that the sum of the data amount of the newly added packet and the data amount of the buffered packet is greater than the data amount of the cluster information, the data content of the newly added packet is stored starting at the next address unit of the last address unit stored in the buffered packet, and a plurality of data contents from the first address unit of the buffered packet stored in the preset address section to a target address unit determined from the first address unit of the newly added packet stored in the preset address section and an address offset determined by a storage specification of a remaining data amount and an address unit, the remaining data amount being determined by a difference calculation between the data amount of the cluster information and the buffered packet, are determined as the cluster information.
Further, before determining the data amount of the newly added information packet, the method further includes:
acquiring a target field in header information of the newly-added information packet, and determining whether the data content exists in the newly-added information packet according to the target field, wherein the target field is a field extracted from the information packet and used for representing whether the data content exists in the information packet;
and if the data content exists in the newly added information packet according to the target field, executing the step of determining the data quantity of the newly added information packet.
Further, before determining whether all information contents of the cluster information have been received based on the header information of the information packet, the method further includes:
performing header information integrity verification according to the data volume of the header information of the information packet; the header information integrity check is used for determining that the header information is complete when the data volume of the header information reaches a preset threshold value;
if the header information is determined to be complete, the step of determining whether all information contents of the cluster information are received based on the header information of the information packet is carried out;
And if the header information is determined to be incomplete, caching the information packet, and after receiving a new information packet, executing the header information integrity check based on the sum of the data amounts of the cached information packet and the new information packet.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program code initialized with the method steps of: acquiring cluster information corresponding to the clusters, wherein the cluster information comprises cluster address information; determining gatepost address information corresponding to the cluster address information based on the preset mapping relation; in the cluster information, replacing the cluster address information by adopting the gatekeeper address information; and transmitting the replaced cluster information to the client.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. 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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, 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.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. 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 apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (13)

1. A method for transmitting cluster information, the method being used in a data transmission system, the data transmission system comprising: the method comprises the steps that a client, a cluster and a gatekeeper positioned between the client and the cluster are provided, a preset mapping relation between gatekeeper address information of the gatekeeper and cluster address information of the cluster is pre-configured in the data transmission system, and the method comprises the following steps:
acquiring cluster information corresponding to the clusters, wherein the cluster information comprises cluster address information;
determining gatepost address information corresponding to the cluster address information based on the preset mapping relation;
in the cluster information, replacing the cluster address information by adopting the gatekeeper address information;
and transmitting the replaced cluster information to the client.
2. The method of claim 1, wherein the cluster address information includes a first network address and a first port; the gateway address information comprises a second network address and a second port; the preset mapping relation comprises a first relation and a second relation, and the first relation is used for representing the corresponding relation of each first network address and each second network address; the second relationship is used for representing the corresponding relationship between each first port and each second port;
The determining the gatepost address information corresponding to the cluster address information based on the preset mapping relation comprises the following steps:
determining the second network address corresponding to the first network address based on the first relationship, and determining the second port corresponding to the first port based on the second relationship;
and determining the second network address and the second port as the gatekeeper address information.
3. The method of claim 2, wherein the first network address comprises a node IP address of a cluster; the first port comprises a node port of a cluster; the second network address comprises a gatekeeper IP address, and the second port comprises a gatekeeper port; the cluster comprises at least one node, and each node corresponds to one node IP address and one node port;
before determining the gatepost address information corresponding to the cluster address information based on the preset mapping relation, the method further comprises:
setting a corresponding gateway IP address for the node IP address of each node in the cluster, and setting a corresponding gateway port for the node port of each node in the cluster;
Determining the first relationship based on the node IP address and the gatekeeper IP address, and determining the second relationship based on the node port and the gatekeeper port;
the determining, based on the first relationship, the second network address corresponding to the first network address and determining, based on the second relationship, the second port corresponding to the first port includes:
and determining the gateway IP address corresponding to the node IP address based on the first relation, and determining the gateway port corresponding to the node port based on the second relation.
4. The method of claim 1, wherein replacing the cluster address information with the gatekeeper address information in the cluster information comprises:
when the byte length of the gatekeeper address information is consistent with the byte length of the cluster address information, replacing the cluster address information with the gatekeeper address information in the cluster information;
when the byte length of the gatekeeper address information is not consistent with the byte length of the cluster address information, modifying the gatekeeper address information based on the communication specification of the cluster information to obtain modified gatekeeper address information, and replacing the cluster address information in the cluster information based on the modified gatekeeper address information, wherein the byte length of the modified gatekeeper address information is consistent with the byte length of the cluster address information.
5. The method of claim 1, wherein the cluster information comprises at least one packet;
the obtaining cluster information corresponding to the clusters includes:
receiving the information packet, and determining whether all information contents of the cluster information are received based on header information of the information packet;
if all the information contents of the cluster information are received, combining a plurality of information packets corresponding to the cluster information to obtain the cluster information;
and if the fact that all the information of the cluster information is not received is determined, caching the information packet corresponding to the cluster information, so that the cluster information is obtained after all the information contents of the cluster information are determined to be received.
6. The method of claim 5, wherein determining whether the entire information content of the cluster information has been received based on the header information of the packet comprises:
determining the data quantity of the cluster information through the header information of the information packet, and determining whether the data quantity of the information packet is consistent with the data quantity of the cluster information, wherein when the data quantity of the information packet is consistent with the data quantity of the cluster information, determining that all information contents of the cluster information are received, or else, not receiving all information contents;
And if it is determined that all the information contents of the cluster information are received, combining a plurality of information packets corresponding to the cluster information to obtain the cluster information, including:
and if the data quantity of the cluster information is inconsistent with the data quantity of the information packet, caching the information packet, and combining a newly added information packet with the cached data packet to obtain the cluster information.
7. The method of claim 6, wherein after said determining whether the data amount of the packet is consistent with the data amount of the cluster information, the method further comprises:
and if the data quantity of the cluster information is consistent with the data quantity of the information packet, determining the information packet as the cluster information.
8. The method of claim 6, wherein the caching the packet and merging the newly added packet with the cached packet to obtain the cluster information includes:
sequentially storing a plurality of data contents in the information packet in each address unit of a preset address interval according to the arrangement sequence, and recording the data contents as a cached information packet;
after receiving the newly added information packet, determining the data volume of the newly added information packet;
When it is determined that the sum of the data amount of the newly added packet and the data amount of the buffered packet is equal to the data amount of the cluster information, starting to store the data content of the newly added packet in a next address unit of a last address unit stored in the buffered packet, and determining a plurality of data contents from a first address unit stored in the preset address section of the buffered packet to a last address unit stored in the preset address section of the newly added packet as the cluster information;
when it is determined that the sum of the data amount of the newly added packet and the data amount of the buffered packet is greater than the data amount of the cluster information, the data content of the newly added packet is stored starting at the next address unit of the last address unit stored in the buffered packet, and a plurality of data contents from the first address unit of the buffered packet stored in the preset address section to a target address unit determined from the first address unit of the newly added packet stored in the preset address section and an address offset determined by a storage specification of a remaining data amount and an address unit, the remaining data amount being determined by a difference calculation between the data amount of the cluster information and the buffered packet, are determined as the cluster information.
9. The method of claim 8, wherein prior to determining the amount of data for the additional information packet, the method further comprises:
acquiring a target field in header information of the newly-added information packet, and determining whether the data content exists in the newly-added information packet according to the target field, wherein the target field is a field extracted from the information packet and used for representing whether the data content exists in the information packet;
and if the data content exists in the newly added information packet according to the target field, executing the step of determining the data quantity of the newly added information packet.
10. The method of claim 5, wherein prior to determining whether the entire information content of the cluster information has been received based on the header information of the packet, the method further comprises:
performing header information integrity verification according to the data volume of the header information of the information packet; the header information integrity check is used for determining that the header information is complete when the data volume of the header information reaches a preset threshold value;
if the header information is determined to be complete, the step of determining whether all information contents of the cluster information are received based on the header information of the information packet is carried out;
And if the header information is determined to be incomplete, caching the information packet, and after receiving a new information packet, executing the header information integrity check based on the sum of the data amounts of the cached information packet and the new information packet.
11. A transmission apparatus for cluster information, wherein the apparatus is used in a data transmission system, the data transmission system comprising: the device comprises a client, a cluster and a gatekeeper positioned between the client and the cluster, wherein a preset mapping relation between gatekeeper address information of the gatekeeper and cluster address information of the cluster is preconfigured in the data transmission system, and the device comprises:
the acquisition unit is used for acquiring cluster information corresponding to the clusters, wherein the cluster information comprises cluster address information;
the determining unit is used for determining the gatepost address information corresponding to the cluster address information based on the preset mapping relation;
a replacing unit, configured to replace, in the cluster information, the cluster address information with the gatekeeper address information;
and the transmission unit is used for transmitting the replaced cluster information to the client.
12. A storage medium comprising a stored program, wherein the program, when run, controls a device in which the storage medium is located to perform the method of transmitting cluster information according to any one of claims 1 to 10.
13. A cluster information transmission apparatus, wherein the apparatus comprises a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; the program instructions, when executed, perform the method of transmitting cluster information of any one of claims 1 to 10.
CN202310717967.0A 2023-06-16 2023-06-16 Cluster information transmission method and device Pending CN116996251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310717967.0A CN116996251A (en) 2023-06-16 2023-06-16 Cluster information transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310717967.0A CN116996251A (en) 2023-06-16 2023-06-16 Cluster information transmission method and device

Publications (1)

Publication Number Publication Date
CN116996251A true CN116996251A (en) 2023-11-03

Family

ID=88532886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310717967.0A Pending CN116996251A (en) 2023-06-16 2023-06-16 Cluster information transmission method and device

Country Status (1)

Country Link
CN (1) CN116996251A (en)

Similar Documents

Publication Publication Date Title
JP4354294B2 (en) Gateway device connected to a plurality of networks having different network segments, and program and method for transferring IP packet
CN112887229B (en) Session information synchronization method and device
JP2016502370A (en) Method and apparatus for matching flow tables and switch
CN112839076A (en) Data storage method, data reading method, gateway, electronic equipment and storage medium
CN107733765B (en) Mapping method, system and related equipment
CN114422160B (en) Virtual firewall setting method and device, electronic equipment and storage medium
CN113542421A (en) Data forwarding method and device based on 5G user plane functional entity
CN116684468B (en) Data processing method, device, equipment and storage medium
CN106506400B (en) data stream identification method and outlet device
CN116996251A (en) Cluster information transmission method and device
CN113014680A (en) Broadband access method, device, equipment and storage medium
CN114244555B (en) Security policy adjusting method
CN115834472A (en) Message processing method, forwarding strategy obtaining method and device
CN111970250B (en) Method for identifying account sharing, electronic device and storage medium
CN114710560A (en) Data processing method and system, proxy equipment and terminal equipment
CN110311868B (en) Service processing method, device, member equipment and machine-readable storage medium
CN113904871A (en) Network slice access method, PCF entity, terminal and communication system
CN113691608A (en) Traffic distribution method, traffic distribution device, electronic equipment and media
US20200007665A1 (en) Method for using metadata in internet protocol packets
US20240137315A1 (en) Metadata enhancement for packet capture using vxlan encapsulation
CN115150314B (en) Method and device for transmitting data packets across network domains, storage medium and electronic equipment
CN113419878B (en) Data operation method and device
US11627061B1 (en) Packet capture using VXLAN encapsulation
CN115102805B (en) Virtual tunnel processing method, device, computer equipment and storage medium
CN111106982B (en) Information filtering 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