CN118631719A - Data transmission method and device, electronic device and computer-readable storage medium - Google Patents
Data transmission method and device, electronic device and computer-readable storage medium Download PDFInfo
- Publication number
- CN118631719A CN118631719A CN202410693077.5A CN202410693077A CN118631719A CN 118631719 A CN118631719 A CN 118631719A CN 202410693077 A CN202410693077 A CN 202410693077A CN 118631719 A CN118631719 A CN 118631719A
- Authority
- CN
- China
- Prior art keywords
- information
- transmitted
- key
- data stream
- 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
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 249
- 238000000034 method Methods 0.000 title claims abstract description 63
- 238000013507 mapping Methods 0.000 claims abstract description 148
- 230000004044 response Effects 0.000 claims abstract description 40
- 238000004590 computer program Methods 0.000 claims description 25
- 230000015654 memory Effects 0.000 claims description 11
- 238000004891 communication Methods 0.000 abstract description 15
- 238000005516 engineering process Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 14
- 230000006870 function Effects 0.000 description 13
- 238000012545 processing Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 8
- 238000002955 isolation Methods 0.000 description 4
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 3
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 3
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 3
- 238000010276 construction Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 2
- 239000000758 substrate Substances 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000013503 de-identification Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/02—Topology update or discovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0894—Policy-based network configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域Technical Field
本公开涉及通信技术领域,更具体地,涉及一种数据传输方法、装置、设备、存储介质和程序产品。The present disclosure relates to the field of communication technology, and more specifically, to a data transmission method, apparatus, device, storage medium and program product.
背景技术Background Art
随着通信技术的发展,可以基于网络策略配置规则,根据数据流中数据包的路由信息,对数据流中的数据包进行传输,以实现网络隔离。With the development of communication technology, it is possible to configure rules based on network policies and transmit data packets in data streams according to the routing information of the data packets in the data streams to achieve network isolation.
在实现本公开构思的过程中,发明人发现相关技术中至少存在如下问题:在对数据流中的数据包进行传输时,对于每个数据包(包括输入方向和输出方向),都需要根据数据包的路由信息进行传输,从而使得数据传输所需要消耗的计算资源较多,导致数据传输的效率较低、性能较差。In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related art: when transmitting data packets in a data stream, each data packet (including input and output directions) needs to be transmitted according to the routing information of the data packet, which requires more computing resources to be consumed for data transmission, resulting in low efficiency and poor performance of data transmission.
发明内容Summary of the invention
有鉴于此,本公开提供了一种数据传输方法、装置、设备、存储介质和程序产品。In view of this, the present disclosure provides a data transmission method, apparatus, device, storage medium and program product.
根据本公开的一个方面,提供了一种数据传输方法,包括:响应于接收到待传输数据流,获取待传输数据流的路由信息,其中,待传输数据流包括M个具有顺序关系的待传输数据包,M为正整数;在数据流映射中未存在与路由信息相匹配的信息的情况下,根据传输规则映射和路由信息,确定目标传输规则;根据路由信息和目标传输规则,更新数据流映射,得到更新后的数据流映射;以及利用更新后的数据流映射,对M个待传输数据包进行传输。According to one aspect of the present disclosure, a data transmission method is provided, comprising: in response to receiving a data stream to be transmitted, obtaining routing information of the data stream to be transmitted, wherein the data stream to be transmitted includes M data packets to be transmitted having a sequential relationship, and M is a positive integer; in the case where there is no information matching the routing information in the data stream mapping, determining a target transmission rule according to the transmission rule mapping and the routing information; updating the data stream mapping according to the routing information and the target transmission rule to obtain an updated data stream mapping; and transmitting the M data packets to be transmitted using the updated data stream mapping.
根据本公开的实施例,上述的传输规则映射包括输入规则映射和输出规则映射;输入规则映射包括P个输入规则键值关系,每个输入规则键值关系包括输入键信息和输入操作值信息,P为正整数;以及输出规则映射包括Q个输出规则键值关系,每个输出规则键值关系包括输出键信息和输出操作值信息,Q为正整数。According to an embodiment of the present disclosure, the above-mentioned transmission rule mapping includes an input rule mapping and an output rule mapping; the input rule mapping includes P input rule key-value relationships, each input rule key-value relationship includes input key information and input operation value information, and P is a positive integer; and the output rule mapping includes Q output rule key-value relationships, each output rule key-value relationship includes output key information and output operation value information, and Q is a positive integer.
根据本公开的实施例,上述的输入规则键值关系是通过如下方式构建得到的:根据网络策略配置信息,确定输入键信息和输入操作值信息;以及根据输入键信息和输入操作值信息,构建输入规则键值关系;输出规则键值关系是通过如下方式构建得到的:根据网络策略配置信息,确定输出键信息和输出操作值信息;以及根据输出键信息和输出操作值信息,构建输出规则键值关系。According to an embodiment of the present disclosure, the above-mentioned input rule key-value relationship is constructed in the following manner: according to the network policy configuration information, the input key information and the input operation value information are determined; and according to the input key information and the input operation value information, the input rule key-value relationship is constructed; the output rule key-value relationship is constructed in the following manner: according to the network policy configuration information, the output key information and the output operation value information are determined; and according to the output key information and the output operation value information, the output rule key-value relationship is constructed.
根据本公开的实施例,上述的数据流映射包括S个传输规则键值关系,每个传输规则键值关系包括键信息和值信息,S为正整数;数据传输方法还包括,在响应于接收到待传输数据流,获取待传输数据流的路由信息之后:根据路由信息,确定待传输数据流的套接字信息,其中,属于同一待传输数据流的M个待传输数据包具有相同的套接字信息;将套接字信息与S个键信息进行匹配,得到匹配结果;在匹配结果表征数据流映射中存在与套接字信息相匹配的目标键信息的情况下,将与目标键信息对应的值信息确定为目标传输规则;以及基于目标传输规则,对M个待传输数据包进行传输。According to an embodiment of the present disclosure, the above-mentioned data stream mapping includes S transmission rule key-value relationships, each transmission rule key-value relationship includes key information and value information, and S is a positive integer; the data transmission method also includes, in response to receiving the data stream to be transmitted, obtaining the routing information of the data stream to be transmitted: determining the socket information of the data stream to be transmitted according to the routing information, wherein the M data packets to be transmitted belonging to the same data stream to be transmitted have the same socket information; matching the socket information with the S key information to obtain a matching result; when the matching result indicates that there is target key information matching the socket information in the data stream mapping, determining the value information corresponding to the target key information as the target transmission rule; and transmitting the M data packets to be transmitted based on the target transmission rule.
根据本公开的实施例,上述的在数据流映射中未存在与路由信息相匹配的信息的情况下,根据传输规则映射和路由信息,确定目标传输规则包括:将路由信息与P个输入键信息和Q个输出键信息进行匹配,得到匹配结果;以及响应于匹配结果表征P个输入键信息和Q个输出键信息中存在与路由信息相匹配的目标键信息,将与目标键信息对应的操作值信息确定为目标传输规则。According to an embodiment of the present disclosure, in the above-mentioned case where there is no information matching the routing information in the data flow mapping, determining the target transmission rule based on the transmission rule mapping and the routing information includes: matching the routing information with P input key information and Q output key information to obtain a matching result; and in response to the matching result indicating that there is target key information matching the routing information in the P input key information and the Q output key information, determining the operation value information corresponding to the target key information as the target transmission rule.
根据本公开的实施例,上述的数据流映射包括S个传输规则映射关系,每个传输规则映射关系包括键信息和值信息;根据路由信息和目标传输规则,更新数据流映射,得到更新后的数据流映射包括:将套接字信息确定为键信息;将目标传输规则确定为值信息;根据键信息和值信息,构建目标传输规则键值关系;以及利用目标传输规则键值关系,更新数据流映射,得到更新后的数据流映射。According to an embodiment of the present disclosure, the above-mentioned data flow mapping includes S transmission rule mapping relationships, each transmission rule mapping relationship includes key information and value information; according to the routing information and the target transmission rule, the data flow mapping is updated to obtain the updated data flow mapping including: determining the socket information as the key information; determining the target transmission rule as the value information; constructing the target transmission rule key-value relationship according to the key information and the value information; and using the target transmission rule key-value relationship to update the data flow mapping to obtain the updated data flow mapping.
根据本公开的实施例,上述的利用更新后的数据流映射,对M个待传输数据包进行传输包括:响应于接收到第m个待传输数据包,将套接字信息与S个键信息进行匹配,得到匹配结果;在匹配结果表征数据流映射中存在与套接字信息相匹配的目标键信息的情况下,将与目标键信息对应的值信息确定为目标传输规则;以及基于目标传输规则,对第m个待传输数据包进行传输。According to an embodiment of the present disclosure, the above-mentioned use of the updated data stream mapping to transmit M data packets to be transmitted includes: in response to receiving the mth data packet to be transmitted, matching the socket information with the S key information to obtain a matching result; when the matching result indicates that there is target key information matching the socket information in the data stream mapping, determining the value information corresponding to the target key information as the target transmission rule; and transmitting the mth data packet to be transmitted based on the target transmission rule.
根据本公开的实施例,上述的响应于接收到待传输数据流,获取待传输数据流的路由信息包括:响应于接收到待传输数据流,利用跟踪工具,获取路由信息;方法还包括,在利用更新后的数据流映射,对M个待传输数据包进行传输之后:响应于M个待传输数据包均传输完成,删除更新后的数据流映射中与套接字信息对应的传输规则键值关系。According to an embodiment of the present disclosure, the above-mentioned response to receiving the data stream to be transmitted, obtaining the routing information of the data stream to be transmitted includes: in response to receiving the data stream to be transmitted, using a tracking tool to obtain the routing information; the method also includes, after using the updated data stream mapping to transmit the M data packets to be transmitted: in response to the M data packets to be transmitted being transmitted, deleting the transmission rule key-value relationship corresponding to the socket information in the updated data stream mapping.
根据本公开的另一个方面,提供了一种数据传输装置,包括:获取模块,用于响应于接收到待传输数据流,获取待传输数据流的路由信息,其中,待传输数据流包括M个具有顺序关系的待传输数据包,M为正整数;确定模块,用于在数据流映射中未存在与路由信息相匹配的信息的情况下,根据传输规则映射和路由信息,确定目标传输规则;更新模块,用于根据路由信息和目标传输规则,更新数据流映射,得到更新后的数据流映射;以及传输模块,用于利用更新后的数据流映射,对M个待传输数据包进行传输。According to another aspect of the present disclosure, a data transmission device is provided, including: an acquisition module, used to acquire routing information of the data stream to be transmitted in response to receiving a data stream to be transmitted, wherein the data stream to be transmitted includes M data packets to be transmitted with a sequential relationship, and M is a positive integer; a determination module, used to determine the target transmission rule according to the transmission rule mapping and the routing information when there is no information matching the routing information in the data stream mapping; an update module, used to update the data stream mapping according to the routing information and the target transmission rule to obtain an updated data stream mapping; and a transmission module, used to transmit the M data packets to be transmitted using the updated data stream mapping.
根据本公开的另一个方面,提供了一种电子设备,包括:一个或多个处理器;存储器,用于存储一个或多个指令,其中,当上述一个或多个指令被上述一个或多个处理器执行时,使得上述一个或多个处理器实现如本公开所述的方法。According to another aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method described in the present disclosure.
根据本公开的另一个方面,提供了一种计算机可读存储介质,其上存储有可执行指令,上述可执行指令被处理器执行时使处理器实现如本公开所述的方法。According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which executable instructions are stored. When the executable instructions are executed by a processor, the processor implements the method described in the present disclosure.
根据本公开的另一个方面,提供了一种计算机程序产品,上述计算机程序产品包括计算机可执行指令,上述计算机可执行指令在被执行时用于实现如本公开所述的方法。According to another aspect of the present disclosure, a computer program product is provided. The computer program product includes computer executable instructions. When the computer executable instructions are executed, they are used to implement the method described in the present disclosure.
根据本公开的实施例,由于目标传输规则是根据传输规则映射和待传输数据流的路由信息确定的,数据流映射是根据目标传输规则和待传输数据流中所有待传输数据包共同的路由信息确定的,因此利用数据流映射并基于目标传输规则,可以实现根据所有待传输数据包共同的路由信息对M个待传输数据包统一进行传输,而无需根据每个待传输数据包的路由信息对M个待传输数据包分别进行传输,由此降低了数据传输过程中消耗的计算资源,因而至少部分地克服了相关技术中对数据流中的数据包进行传输时数据传输的效率较低、性能较差的技术问题,从而有利于提高数据传输的效率和性能。According to the embodiments of the present disclosure, since the target transmission rule is determined according to the transmission rule mapping and the routing information of the data stream to be transmitted, and the data stream mapping is determined according to the target transmission rule and the common routing information of all the data packets to be transmitted in the data stream to be transmitted, by utilizing the data stream mapping and based on the target transmission rule, it is possible to uniformly transmit M data packets to be transmitted according to the common routing information of all the data packets to be transmitted, without having to transmit the M data packets to be transmitted separately according to the routing information of each data packet to be transmitted, thereby reducing the computing resources consumed in the data transmission process, and thus at least partially overcoming the technical problems of low efficiency and poor performance of data transmission when transmitting data packets in the data stream in the related art, thereby facilitating improving the efficiency and performance of data transmission.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过以下参照附图对本公开实施例的描述,本公开的上述以及其他目的、特征和优点将更为清楚,在附图中:The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
图1示意性示出了根据本公开实施例的可以应用数据传输方法的系统架构。FIG. 1 schematically shows a system architecture to which a data transmission method according to an embodiment of the present disclosure can be applied.
图2示意性示出了根据本公开实施例的数据传输方法的流程图。FIG. 2 schematically shows a flow chart of a data transmission method according to an embodiment of the present disclosure.
图3示例性示出了根据本公开实施例的获得传输规则映射和数据流映射的过程的示例示意图。FIG. 3 exemplarily shows an example schematic diagram of a process of obtaining a transmission rule mapping and a data flow mapping according to an embodiment of the present disclosure.
图4示例性示出了根据本公开实施例的数据传输过程的示意图。FIG. 4 exemplarily shows a schematic diagram of a data transmission process according to an embodiment of the present disclosure.
图5示例性示出了根据本公开实施例的数据传输架构图。FIG. 5 exemplarily shows a data transmission architecture diagram according to an embodiment of the present disclosure.
图6示意性示出了根据本公开的实施例的数据传输装置的框图。FIG6 schematically shows a block diagram of a data transmission device according to an embodiment of the present disclosure.
图7示意性示出了根据本公开实施例的适于实现数据传输方法的电子设备的框图。FIG7 schematically shows a block diagram of an electronic device suitable for implementing a data transmission method according to an embodiment of the present disclosure.
具体实施方式DETAILED DESCRIPTION
以下,将参照附图来描述本公开的实施例。但是应该理解,这些描述只是示例性的,而并非要限制本公开的范围。在下面的详细描述中,为便于解释,阐述了许多具体的细节以提供对本公开实施例的全面理解。然而,明显地,一个或多个实施例在没有这些具体细节的情况下也可以被实施。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本公开的概念。Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本公开。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "include", "comprising", etc. used herein indicate the existence of the features, steps, operations and/or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
在使用类似于“A、B和C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B和C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。When using expressions such as "at least one of A, B, and C", they should generally be interpreted according to the meaning of the expression commonly understood by technical personnel in this field (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and/or A, B, C, etc.).
在本公开的实施例中,所涉及的数据(例如,包括但不限于用户个人信息)的收集、更新、分析、处理、使用、传输、提供、公开、存储等方面,均符合相关法律法规的规定,被用于合法的用途,且不违背公序良俗。特别地,对用户个人信息采取了必要措施,防止对用户个人信息数据的非法访问,维护用户个人信息安全和网络安全。In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.
在本公开的实施例中,在获取或采集用户个人信息之前,均获取了用户的授权或同意。In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
例如,在接收到待传输数据流之后,可以采用包括去标识化或者匿名化处理方式对您的信息进行脱敏,以保护您的信息安全。For example, after receiving the data stream to be transmitted, your information can be desensitized using methods including de-identification or anonymization to protect the security of your information.
随着通信技术领域的发展,可以基于网络策略配置规则,根据数据流中数据包的路由信息,对数据流中的数据包进行传输(转发或丢弃等),实现网络隔离。With the development of the field of communication technology, network isolation can be achieved by transmitting (forwarding or discarding, etc.) data packets in a data stream based on network policy configuration rules and according to the routing information of the data packets in the data stream.
网络隔离可以通过限制网络中不同部分之间的通信来提高网络的安全性和隐私保护。作为一个示例,通过设置网络策略配置规则,并根据路由信息对数据流中的数据包进行过滤和控制,可以实现网络隔离效果。Network isolation can improve network security and privacy protection by limiting the communication between different parts of the network. As an example, network isolation can be achieved by setting network policy configuration rules and filtering and controlling data packets in the data flow based on routing information.
在实现本公开构思的过程中,发明人发现相关技术中至少存在如下问题:在对数据流中的数据包进行传输时,对于每个数据包(包括输入方向和输出方向),都需要根据数据包的路由信息进行传输,从而使得数据传输所需要消耗的计算资源较多,导致了数据传输的效率低、性能差。In the process of realizing the concept of the present disclosure, the inventors found that there are at least the following problems in the related art: when transmitting data packets in a data stream, each data packet (including input and output directions) needs to be transmitted according to the routing information of the data packet, which requires more computing resources to be consumed for data transmission, resulting in low efficiency and poor performance of data transmission.
为了至少部分地解决相关技术中存在的技术问题,本公开提供了一种数据传输方法、装置、设备、存储介质和程序产品。In order to at least partially solve the technical problems existing in the related art, the present disclosure provides a data transmission method, apparatus, device, storage medium and program product.
图1示意性示出了根据本公开实施例的可以应用数据传输方法的系统架构。需要注意的是,图1所示仅为可以应用本公开实施例的系统架构的示例,以帮助本领域技术人员理解本公开的技术内容,但并不意味着本公开实施例不可以用于其他设备、系统、环境或场景。FIG1 schematically shows a system architecture to which the data transmission method according to an embodiment of the present disclosure can be applied. It should be noted that FIG1 is only an example of a system architecture to which the embodiment of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiment of the present disclosure cannot be used in other devices, systems, environments or scenarios.
如图1所示,根据该实施例的系统架构100可以包括第一终端设备101、第二终端设备102、第三终端设备103,网络104和服务器105。网络104用以在第一终端设备101、第二终端设备102、第三终端设备103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG1 , the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
用户可以使用第一终端设备101、第二终端设备102、第三终端设备103中的至少一个通过网络104与服务器105交互,以接收或发送消息等。第一终端设备101、第二终端设备102、第三终端设备103上可以安装有各种通讯客户端应用,例如购物类应用、网页浏览器应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等(仅为示例)。The user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
第一终端设备101、第二终端设备102、第三终端设备103可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
服务器105可以是提供各种服务的服务器,例如对用户利用第一终端设备101、第二终端设备102、第三终端设备103所浏览的网站提供支持的后台管理服务器(仅为示例)。后台管理服务器可以对接收到的用户请求等数据进行分析等处理,并将处理结果(例如根据用户请求获取或生成的网页、信息、或数据等)反馈给终端设备。The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
需要说明的是,本公开实施例所提供的数据传输方法一般可以由服务器105执行。相应地,本公开实施例所提供的数据传输装置一般可以设置于服务器105中。本公开实施例所提供的数据传输方法也可以由不同于服务器105且能够与第一终端设备101、第二终端设备102、第三终端设备103和/或服务器105通信的服务器或服务器集群执行。相应地,本公开实施例所提供的数据传输装置也可以设置于不同于服务器105且能够与第一终端设备101、第二终端设备102、第三终端设备103和/或服务器105通信的服务器或服务器集群中。It should be noted that the data transmission method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data transmission device provided in the embodiment of the present disclosure can generally be set in the server 105. The data transmission method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and/or the server 105. Accordingly, the data transmission device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and/or the server 105.
备选地,本公开实施例所提供的数据传输方法也可以由第一终端设备101、第二终端设备102或第三终端设备103执行,或者也可以由不同于第一终端设备101、第二终端设备102或第三终端设备103的其他终端设备执行。相应地,本公开实施例所提供的数据传输装置也可以设置于第一终端设备101、第二终端设备102或第三终端设备103中,或设置于不同于第一终端设备101、第二终端设备102或第三终端设备103的其他终端设备中。Alternatively, the data transmission method provided in the embodiment of the present disclosure may also be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the data transmission apparatus provided in the embodiment of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may be provided in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the number of terminal devices, networks and servers in Figure 1 is only illustrative. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
应注意,以下方法中各个操作的序号仅作为该操作的表示以便描述,而不应被看作表示该各个操作的执行顺序。除非明确指出,否则该方法不需要完全按照所示顺序来执行。It should be noted that the sequence numbers of the operations in the following method are only used as representations of the operations for the purpose of description, and should not be regarded as representing the execution order of the operations. Unless explicitly stated, the method does not need to be executed completely in the order shown.
图2示意性示出了根据本公开实施例的数据传输方法的流程图。FIG. 2 schematically shows a flow chart of a data transmission method according to an embodiment of the present disclosure.
如图2所示,该数据传输方法包括操作S210~S240。As shown in FIG. 2 , the data transmission method includes operations S210 to S240 .
在操作S210,响应于接收到待传输数据流,获取待传输数据流的路由信息,其中,待传输数据流包括M个具有顺序关系的待传输数据包,M为正整数。In operation S210, in response to receiving a data stream to be transmitted, routing information of the data stream to be transmitted is obtained, wherein the data stream to be transmitted includes M data packets to be transmitted in a sequential relationship, and M is a positive integer.
在操作S220,在数据流映射中未存在与路由信息相匹配的信息的情况下,根据传输规则映射和路由信息,确定目标传输规则。In operation S220, if there is no information matching the routing information in the data flow map, a target transmission rule is determined according to the transmission rule map and the routing information.
在操作S230,根据路由信息和目标传输规则,更新数据流映射,得到更新后的数据流映射。In operation S230, the data flow mapping is updated according to the routing information and the target transmission rule to obtain an updated data flow mapping.
在操作S240,利用更新后的数据流映射,对M个待传输数据包进行传输。In operation S240, the M data packets to be transmitted are transmitted using the updated data flow mapping.
根据本公开的实施例,待传输数据流包括M个具有顺序关系的待传输数据包,M为正整数。待传输数据包可以理解为在网络中进行数据传输的基本单位,待传输数据流可以理解为具有共同特征(例如路由信息)的待传输数据包组成的序列。待传输数据包可以包括输入方向的数据包和输出方向的数据包。输入方向可以理解为数据包进入设备或网络接口的方向,输出方向可以理解为数据包离开设备或网络接口的方向。前述顺序关系可以包括传输数据流时发送数据包的时间顺序。According to an embodiment of the present disclosure, the data stream to be transmitted includes M data packets to be transmitted with a sequential relationship, where M is a positive integer. The data packet to be transmitted can be understood as the basic unit for data transmission in the network, and the data stream to be transmitted can be understood as a sequence of data packets to be transmitted with common characteristics (such as routing information). The data packets to be transmitted may include data packets in the input direction and data packets in the output direction. The input direction may be understood as the direction in which the data packet enters the device or network interface, and the output direction may be understood as the direction in which the data packet leaves the device or network interface. The aforementioned sequential relationship may include the time sequence of sending data packets when transmitting the data stream.
根据本公开的一个实施例,路由信息可以理解为数据包在网络中传输时的路径和相关信息。待传输数据流的路由信息可以包括待传输数据流的五元组信息(5-tuple)。五元组信息可以包括:源IP地址(Source IP Address,sip)、目标IP地址(Destination IPAddress,dip)、源端口号(Source Port,sport)、目标端口号(Destination Port,dport)和传输协议(Protocol,proto)。According to one embodiment of the present disclosure, routing information can be understood as the path and related information of a data packet when it is transmitted in a network. The routing information of the data stream to be transmitted may include five-tuple information (5-tuple) of the data stream to be transmitted. The five-tuple information may include: source IP address (Source IP Address, sip), destination IP address (Destination IPAddress, dip), source port number (Source Port, sport), destination port number (Destination Port, dport) and transport protocol (Protocol, proto).
根据本公开的实施例,源IP地址可以用于表征发送数据包的源主机的IP地址。目标IP地址可以用于表征接收数据包的目标主机的IP地址。源端口号可以用于表征发送数据包的源主机上的应用程序使用的端口号。目标端口号可以用于表征接收数据包的目标主机上的应用程序使用的端口号。传输协议可以用于表征用于发送数据包的网络传输协议,例如TCP(Transmission Control Protocol)、UDP(User Datagram Protocol)、ICMP(Internet Control Message Protocol)等。According to an embodiment of the present disclosure, the source IP address can be used to characterize the IP address of the source host that sends the data packet. The destination IP address can be used to characterize the IP address of the destination host that receives the data packet. The source port number can be used to characterize the port number used by the application on the source host that sends the data packet. The destination port number can be used to characterize the port number used by the application on the destination host that receives the data packet. The transport protocol can be used to characterize the network transport protocol used to send the data packet, such as TCP (Transmission Control Protocol), UDP (User Datagram Protocol), ICMP (Internet Control Message Protocol), etc.
根据本公开的实施例,对于同一条待传输数据流,待传输数据流对应的路由信息可以包括该待传输数据流中的所有待传输数据包共同具有的路由信息,以确保所有的待传输数据包都能够正确地传输至目标位置。示例性地,同一条待传输数据流中的所有待传输数据包可以具有相同的五元组信息。According to an embodiment of the present disclosure, for the same data stream to be transmitted, the routing information corresponding to the data stream to be transmitted may include routing information common to all data packets to be transmitted in the data stream to be transmitted, so as to ensure that all data packets to be transmitted can be correctly transmitted to the target location. Exemplarily, all data packets to be transmitted in the same data stream to be transmitted may have the same five-tuple information.
根据本公开的实施例,数据流映射可以根据待传输数据流中所有待传输数据包共同的路由信息,对M个待传输数据包进行传输。数据流映射可以理解为基于数据流的网络策略配置信息。According to an embodiment of the present disclosure, data flow mapping can transmit M data packets to be transmitted according to the common routing information of all data packets to be transmitted in the data flow to be transmitted. Data flow mapping can be understood as network policy configuration information based on data flow.
根据本公开的实施例,传输规则映射可以根据待传输数据流中每个待传输数据包对应的路由信息,分别对M个待传输数据包进行传输。传输规则映射可以理解为基于数据包的网络策略配置信息。According to an embodiment of the present disclosure, the transmission rule mapping can transmit M data packets to be transmitted respectively according to the routing information corresponding to each data packet to be transmitted in the data stream to be transmitted. The transmission rule mapping can be understood as network policy configuration information based on data packets.
根据本公开的实施例,目标传输规则可以理解为与待传输数据流中的M个待传输数据包相对应的网络策略(可以包括转发或丢弃),可以基于目标传输规则对待传输数据流中的待传输数据包进行传输。According to an embodiment of the present disclosure, the target transmission rule can be understood as a network policy (which may include forwarding or discarding) corresponding to the M data packets to be transmitted in the data stream to be transmitted, and the data packets to be transmitted in the data stream to be transmitted can be transmitted based on the target transmission rule.
根据本公开的实施例,在数据流映射中未存在与路由信息相匹配的信息的情况下,可以根据传输规则映射和路由信息,确定目标传输规则。可以根据目标传输规则,对M个待传输数据包分别进行传输。According to an embodiment of the present disclosure, when there is no information matching the routing information in the data flow mapping, the target transmission rule can be determined according to the transmission rule mapping and the routing information. The M data packets to be transmitted can be transmitted respectively according to the target transmission rule.
根据本公开的实施例,可以根据路由信息和目标传输规则,更新数据流映射,得到更新后的数据流映射。示例性地,更新数据流映射可以包括生成和/或保存与路由信息相匹配的数据流映射。在得到更新后的数据流映射之后,响应于再次接收到具有相同路由信息的待传输数据流,可以利用更新后的数据流映射,基于目标传输规则,对M个待传输数据包统一进行传输。According to an embodiment of the present disclosure, the data stream mapping can be updated according to the routing information and the target transmission rule to obtain an updated data stream mapping. Exemplarily, updating the data stream mapping can include generating and/or saving a data stream mapping that matches the routing information. After obtaining the updated data stream mapping, in response to receiving a data stream to be transmitted with the same routing information again, the updated data stream mapping can be used to uniformly transmit the M data packets to be transmitted based on the target transmission rule.
根据本公开的实施例,在数据流映射中存在于路由信息相匹配的信息的情况下,可以根据数据流映射和路由信息,确定目标传输规则。可以根据目标传输规则,对M个待传输数据包统一进行传输。According to an embodiment of the present disclosure, when there is information matching the routing information in the data flow mapping, the target transmission rule can be determined according to the data flow mapping and the routing information. The M data packets to be transmitted can be uniformly transmitted according to the target transmission rule.
根据本公开的实施例,由于目标传输规则是根据传输规则映射和待传输数据流的路由信息确定的,数据流映射是根据目标传输规则和待传输数据流中所有待传输数据包共同的路由信息确定的,因此利用数据流映射并基于目标传输规则,可以实现根据所有待传输数据包共同的路由信息对M个待传输数据包统一进行传输,而无需根据每个待传输数据包的路由信息对M个待传输数据包分别进行传输,由此降低了数据传输过程中消耗的计算资源,因而至少部分地克服了相关技术中对数据流中的数据包进行传输时数据传输的效率低、性能差的技术问题,从而有利于提高数据传输的效率和性能。According to the embodiments of the present disclosure, since the target transmission rule is determined according to the transmission rule mapping and the routing information of the data stream to be transmitted, and the data stream mapping is determined according to the target transmission rule and the common routing information of all the data packets to be transmitted in the data stream to be transmitted, therefore, by utilizing the data stream mapping and based on the target transmission rule, it is possible to uniformly transmit M data packets to be transmitted according to the common routing information of all the data packets to be transmitted, without having to transmit the M data packets to be transmitted separately according to the routing information of each data packet to be transmitted, thereby reducing the computing resources consumed in the data transmission process, and thus at least partially overcoming the technical problems of low efficiency and poor performance of data transmission when transmitting data packets in the data stream in the related art, thereby facilitating improving the efficiency and performance of data transmission.
下面参考图3-图5,对根据本发明实施例的数据传输方法做进一步说明。The data transmission method according to the embodiment of the present invention is further described below with reference to FIG. 3 to FIG. 5 .
根据本公开的实施例,上述的传输规则映射包括输入规则映射和输出规则映射;输入规则映射包括P个输入规则键值关系,每个输入规则键值关系包括输入键信息和输入操作值信息,P为正整数;以及输出规则映射包括Q个输出规则键值关系,每个输出规则键值关系包括输出键信息和输出操作值信息,Q为正整数。According to an embodiment of the present disclosure, the above-mentioned transmission rule mapping includes an input rule mapping and an output rule mapping; the input rule mapping includes P input rule key-value relationships, each input rule key-value relationship includes input key information and input operation value information, and P is a positive integer; and the output rule mapping includes Q output rule key-value relationships, each output rule key-value relationship includes output key information and output operation value information, and Q is a positive integer.
根据本公开的实施例,传输规则映射可以根据待传输数据包的路由信息(五元组信息,5-tuple)确定目标传输规则,从而可以基于目标传输规则对待传输数据包进行传输。According to an embodiment of the present disclosure, the transmission rule mapping can determine the target transmission rule according to the routing information (five-tuple information, 5-tuple) of the data packet to be transmitted, so that the data packet to be transmitted can be transmitted based on the target transmission rule.
根据本公开的实施例,输入规则映射可以理解为与输入方向的待传输数据包对应的网络策略配置信息,可以基于输入规则映射中的输入规则键值关系对输入方向的待传输数据包进行传输。输入键信息可以用于与输入方向的待传输数据包的路由信息匹配,输入值信息可以理解为与输入键信息对应的网络策略。According to the embodiments of the present disclosure, the input rule mapping can be understood as the network policy configuration information corresponding to the data packets to be transmitted in the input direction, and the data packets to be transmitted in the input direction can be transmitted based on the input rule key-value relationship in the input rule mapping. The input key information can be used to match the routing information of the data packets to be transmitted in the input direction, and the input value information can be understood as the network policy corresponding to the input key information.
作为一个示例,输入键信息可以包括输入方向的待传输数据包的路由信息,例如五元组信息。输入值信息可以包括与输入键信息对应的处理策略,例如转发和丢弃。As an example, the input key information may include routing information of a data packet to be transmitted in the input direction, such as five-tuple information. The input value information may include a processing strategy corresponding to the input key information, such as forwarding and discarding.
根据本公开的实施例,输出规则映射可以理解为与输出方向的待传输数据包对应的网络策略配置信息,可以基于输出规则映射中的输出规则键值关系对输出方向的待传输数据包进行传输。输出键信息可以用于与输出方向的待传输数据包的路由信息匹配,输出值信息可以理解为与输出键信息对应的网络策略。According to the embodiments of the present disclosure, the output rule mapping can be understood as the network policy configuration information corresponding to the data packet to be transmitted in the output direction, and the data packet to be transmitted in the output direction can be transmitted based on the output rule key-value relationship in the output rule mapping. The output key information can be used to match the routing information of the data packet to be transmitted in the output direction, and the output value information can be understood as the network policy corresponding to the output key information.
作为一个示例,输出键信息可以包括输出方向的待传输数据包的路由信息,例如五元组信息。输出值信息可以包括与输出键信息对应的处理策略,例如转发和丢弃。As an example, the output key information may include routing information of the data packet to be transmitted in the output direction, such as five-tuple information. The output value information may include a processing strategy corresponding to the output key information, such as forwarding and discarding.
例如,在k8s集群中,传输规则映射可以理解为基于eBPF程序实现的Policy Map(策略映射),Policy Map可以根据待传输数据包的五元组信息(5-tuple,包括sip、sport、proto、dip和dport)对待传输数据包进行传输。输入规则映射可以理解为Policy Map中的Ingress Policy Map(入站策略映射),输出规则映射可以理解为Policy Map中的EgressPolicy Map(出站策略映射)。Ingress Policy Map可以包括P个输入规则键值关系,每个输入规则键值关系均包括输入键信息(key,可以包括sip、sport、proto、dip和dport,也即五元组信息)和输入键信息(value,可以包括allow和deny,也即转发和丢弃)。Egress PolicyMap可以包括Q个输出规则键值关系,每个输出规则键值关系均包括输出键信息(key,可以包括sip、sport、proto、dip和dport,也即五元组信息)和输出键信息(value,可以包括allow和deny,也即转发和丢弃)。For example, in a k8s cluster, the transmission rule map can be understood as a Policy Map implemented based on the eBPF program. The Policy Map can transmit the data packets to be transmitted according to the five-tuple information (5-tuple, including sip, sport, proto, dip and dport) of the data packets to be transmitted. The input rule map can be understood as the Ingress Policy Map in the Policy Map, and the output rule map can be understood as the Egress Policy Map in the Policy Map. The Ingress Policy Map can include P input rule key-value relationships, each of which includes input key information (key, which can include sip, sport, proto, dip and dport, that is, five-tuple information) and input key information (value, which can include allow and deny, that is, forwarding and discarding). The Egress PolicyMap may include Q output rule key-value relationships, each of which includes output key information (key, which may include sip, sport, proto, dip, and dport, i.e., five-tuple information) and output key information (value, which may include allow and deny, i.e., forward and discard).
根据本公开的一个实施例,可以将待传输数据流中的待传输数据包的五元组信息,与输入键信息或输出键信息进行匹配,并根据对应的输入值信息或输出值信息,对待传输数据包进行转发或丢弃。由此,可以实现针对单个待传输数据包进行过滤和处理,从而实现细粒度的数据管理和数据控制。According to an embodiment of the present disclosure, the five-tuple information of the data packet to be transmitted in the data stream to be transmitted can be matched with the input key information or the output key information, and the data packet to be transmitted can be forwarded or discarded according to the corresponding input value information or the output value information. In this way, filtering and processing can be implemented for a single data packet to be transmitted, thereby realizing fine-grained data management and data control.
根据本公开的实施例,上述的输入规则键值关系是通过如下方式构建得到的:根据网络策略配置信息,确定输入键信息和输入操作值信息;以及根据输入键信息和输入操作值信息,构建输入规则键值关系;输出规则键值关系是通过如下方式构建得到的:根据网络策略配置信息,确定输出键信息和输出操作值信息;以及根据输出键信息和输出操作值信息,构建输出规则键值关系。According to an embodiment of the present disclosure, the above-mentioned input rule key-value relationship is constructed in the following manner: according to the network policy configuration information, the input key information and the input operation value information are determined; and according to the input key information and the input operation value information, the input rule key-value relationship is constructed; the output rule key-value relationship is constructed in the following manner: according to the network policy configuration information, the output key information and the output operation value information are determined; and according to the output key information and the output operation value information, the output rule key-value relationship is constructed.
根据本公开的实施例,网络策略配置信息可以理解为用于定义和管理网络中流量的规则集合,前述规则可以根据需要对数据流和/或数据包进行转发(allow)或丢弃(deny),以决定数据包在网络中的行为。示例性地,网络策略配置信息可以包括与流量对应的匹配规则和允许或拒绝特定流量的网络策略。上述的输入/输出键值信息可以理解为键值对,输入/输出键信息可以用于对应标识和访问输入/输出值信息,输入/输出值信息与输入/输出键信息对应关联。According to an embodiment of the present disclosure, network policy configuration information can be understood as a set of rules for defining and managing traffic in a network, and the aforementioned rules can forward (allow) or discard (deny) data streams and/or data packets as needed to determine the behavior of data packets in the network. Exemplarily, the network policy configuration information may include matching rules corresponding to traffic and network policies that allow or deny specific traffic. The above-mentioned input/output key value information can be understood as a key-value pair, and the input/output key information can be used to correspond to identification and access input/output value information, and the input/output value information is correspondingly associated with the input/output key information.
根据本公开的实施例,本领域技术人员可以基于实际需求或应用场景等,根据网络策略配置信息,对输入键值关系和/或输出键值关系进行合理地设置。示例性地,网络策略配置信息可以包括与流量对应的匹配规则和允许或拒绝特定流量的网络策略。可以根据前述匹配规则和网络策略,构建输入键值关系和输出键值关系。前述流量可以包括数据流和/或数据包。According to the embodiments of the present disclosure, those skilled in the art can reasonably set the input key-value relationship and/or the output key-value relationship according to the network policy configuration information based on actual needs or application scenarios. Exemplarily, the network policy configuration information may include matching rules corresponding to traffic and network policies that allow or deny specific traffic. The input key-value relationship and the output key-value relationship can be constructed based on the aforementioned matching rules and network policies. The aforementioned traffic may include data streams and/or data packets.
作为一个示例,可以根据特定的IP地址、端口号、协议类型、用户身份、应用程序类型等确定匹配规则,并根据匹配规则确定输入键信息和/或输出键信息。可以针对特定IP地址、端口号、协议类型、用户身份、应用程序类型等的数据流,定义对应的允许或拒绝的网络策略,并可以根据网络策略确定输入值信息和/或输出值信息。As an example, a matching rule may be determined based on a specific IP address, port number, protocol type, user identity, application type, etc., and input key information and/or output key information may be determined based on the matching rule. A corresponding network policy of permission or rejection may be defined for a data flow of a specific IP address, port number, protocol type, user identity, application type, etc., and input value information and/or output value information may be determined based on the network policy.
图3示例性示出了根据本公开的实施例的获得传输规则映射和数据流映射的过程的示例示意图。FIG. 3 exemplarily shows an example schematic diagram of a process of obtaining a transmission rule mapping and a data flow mapping according to an embodiment of the present disclosure.
根据本公开的一个实施例,在k8s(Kubemetes)集群中,网络策略配置信息可以包括网络策略(Network Policy),Network Policy可以用于定义容器之间的通信规则,以便实现对特定流量的控制和管理,有助于提高k8s集群的安全性和可靠性。作为一个示例,Network Policy可以包括匹配规则和策略信息。According to an embodiment of the present disclosure, in a k8s (Kubemetes) cluster, network policy configuration information may include a network policy, which may be used to define communication rules between containers so as to control and manage specific traffic, thereby helping to improve the security and reliability of the k8s cluster. As an example, a Network Policy may include matching rules and policy information.
传输规则映射可以包括基于eBPF程序实现的策略映射(PolicyMap,kube_policy),PolicyMap可以根据数据包的路由信息(五元组信息,5-tuple)进行匹配,并根据预设的策略规则进行相应的处理操作,例如允许或拒绝特定的数据包、限制带宽、对数据包进行转发或丢弃等。通过基于eBPF程序实现的PolicyMap,可以更加灵活地控制和管理流量,实现精细化的网络策略配置。The transmission rule mapping can include a policy map (PolicyMap, kube_policy) based on the eBPF program. PolicyMap can match according to the routing information (five-tuple information, 5-tuple) of the data packet and perform corresponding processing operations according to the preset policy rules, such as allowing or denying specific data packets, limiting bandwidth, forwarding or discarding data packets, etc. Through the PolicyMap implemented based on the eBPF program, traffic can be controlled and managed more flexibly, and refined network policy configuration can be achieved.
示例性地,如图3所示,网络策略配置信息301(Network Policy)的匹配规则可以包括与输入方向对应的入站规则(Ingress rule)和与输出方向对应的出站规则(Egressrule)。入站规则和出站规则可以基于网络策略目标(Network Policy Peer)和网络策略端口(Network Policy Port)确定,Network Policy Peer和Network Policy Port可以与数据流的路由信息相匹配。例如,Network Policy Peer可以包括容器组选择器(PodSelector)、命名空间选择器(Name space Selector)和IP块(IP Block)。Network PolicyPort可以包括端口(Port)和协议(Protocol)。Network Policy的网络策略可以包括转发(allow)和丢弃(deny)。Exemplarily, as shown in FIG3 , the matching rules of the network policy configuration information 301 (Network Policy) may include an ingress rule (Ingress rule) corresponding to the input direction and an egress rule (Egress rule) corresponding to the output direction. The ingress rule and the egress rule may be determined based on the network policy target (Network Policy Peer) and the network policy port (Network Policy Port), and the Network Policy Peer and the Network Policy Port may match the routing information of the data flow. For example, the Network Policy Peer may include a container group selector (PodSelector), a namespace selector (Name space Selector), and an IP block (IP Block). The Network PolicyPort may include a port (Port) and a protocol (Protocol). The network policy of the Network Policy may include forwarding (allow) and discarding (deny).
示例性地,如图3所示,可以利用eBPF程序,根据网络策略配置信息301(NetworkPolicy)的入站规则(Ingress rule)和出站规则(Egress rule)对应确定传输规则映射302(Policy Map)的输入键值关系3021(Ingress Policy Map,入站策略映射)和输出键值关系3022(Egress Policy Map,出站策略映射)。Ingress Policy Map和Egress Policy Map的key(也即输入键信息和输出键信息)均包括sip、sport、proto、dip和dport(也即五元组信息,5-tuple),Ingress Policy Map和Egress Policy Map的value(也即输入值信息和输出值信息)均包括allow(也即转发)和deny(也即丢弃)。Exemplarily, as shown in FIG3 , an eBPF program can be used to determine the input key-value relationship 3021 (Ingress Policy Map) and the output key-value relationship 3022 (Egress Policy Map) of the transmission rule map 302 (Policy Map) according to the ingress rule (Ingress rule) and the outbound rule (Egress rule) of the network policy configuration information 301 (NetworkPolicy). The key (i.e., input key information and output key information) of the Ingress Policy Map and the Egress Policy Map both include sip, sport, proto, dip, and dport (i.e., 5-tuple information), and the value (i.e., input value information and output value information) of the Ingress Policy Map and the Egress Policy Map both include allow (i.e., forward) and deny (i.e., discard).
根据本公开的实施例,上述的数据流映射可以包括S个传输规则键值关系,每个传输规则键值关系包括键信息和值信息,S为正整数。根据本公开实施例的数据传输方法还可以包括,在操作S210之后:根据路由信息,确定待传输数据流的套接字信息,其中,属于同一待传输数据流的M个待传输数据包具有相同的套接字信息;将套接字信息与S个键信息进行匹配,得到匹配结果;在匹配结果表征数据流映射中存在与套接字信息相匹配的目标键信息的情况下,将与目标键信息对应的值信息确定为目标传输规则;以及基于目标传输规则,对M个待传输数据包进行传输。According to an embodiment of the present disclosure, the above-mentioned data stream mapping may include S transmission rule key-value relationships, each transmission rule key-value relationship includes key information and value information, and S is a positive integer. According to an embodiment of the present disclosure, the data transmission method may also include, after operation S210: determining the socket information of the data stream to be transmitted according to the routing information, wherein the M data packets to be transmitted belonging to the same data stream to be transmitted have the same socket information; matching the socket information with the S key information to obtain a matching result; in the case where the matching result indicates that there is target key information matching the socket information in the data stream mapping, determining the value information corresponding to the target key information as the target transmission rule; and transmitting the M data packets to be transmitted based on the target transmission rule.
根据本公开的实施例,套接字(socket)信息可以理解为用于在网络中传输数据的接口,套接字信息可以用于建立和管理会话。数据的套接字信息可以与数据的五元组信息相对应,以保证数据的正确传输。作为一个示例,可以根据待传输数据流的路由信息(例如五元组信息5-tuple,),确定待传输数据流的套接字信息(socket)。According to an embodiment of the present disclosure, socket information can be understood as an interface for transmitting data in a network, and socket information can be used to establish and manage sessions. The socket information of data can correspond to the five-tuple information of data to ensure the correct transmission of data. As an example, the socket information of the data stream to be transmitted can be determined based on the routing information of the data stream to be transmitted (e.g., five-tuple information 5-tuple,).
根据本公开的实施例,会话(session)可以理解为在网络通信中,两个或多个应用程序之间进行交互的过程。在会话期间,交互的参与方可以通过套接字信息进行通信、传输数据并维护会话状态。According to the embodiments of the present disclosure, a session can be understood as a process of interaction between two or more applications in network communication. During a session, the interacting parties can communicate, transmit data and maintain session status through socket information.
根据本公开的实施例,会话可以包括一个或多个数据流。对于同一个会话,会话对应的路由信息可以包括该会话中的所有待传输数据流共同具有的路由信息,以确保所有的待传输数据流都能够正确地传输至目标位置。示例性地,同一个会话中的所有待传输数据流可以具有相同的套接字信息。在此基础上,对于同一个待传输数据流,待传输数据流中的M个待传输数据包可以具有相同的套接字信息。According to an embodiment of the present disclosure, a session may include one or more data streams. For the same session, the routing information corresponding to the session may include routing information common to all data streams to be transmitted in the session to ensure that all data streams to be transmitted can be correctly transmitted to the target location. Exemplarily, all data streams to be transmitted in the same session may have the same socket information. On this basis, for the same data stream to be transmitted, the M data packets to be transmitted in the data stream to be transmitted may have the same socket information.
根据本公开的实施例,上述与数据流映射对应的传输规则键值关系可以理解为键值对,传输规则键值关系的键信息可以用于标识和访问传输规则键值关系的值信息,前述值信息与前述键信息相关联。备选地,传输规则键值关系可以包括用于输入方向的传输规则键值关系和用于输出方向的传输规则键值关系。According to an embodiment of the present disclosure, the transmission rule key-value relationship corresponding to the data flow mapping can be understood as a key-value pair, and the key information of the transmission rule key-value relationship can be used to identify and access the value information of the transmission rule key-value relationship, and the aforementioned value information is associated with the aforementioned key information. Alternatively, the transmission rule key-value relationship can include a transmission rule key-value relationship for the input direction and a transmission rule key-value relationship for the output direction.
根据本公开的实施例,传输规则键值关系的键信息可以包括与路由信息(五元组信息)相对应的套接字信息,传输规则键值关系的值信息可以包括转发(allow)和丢弃(deny)。According to an embodiment of the present disclosure, the key information of the transmission rule key-value relationship may include socket information corresponding to the routing information (five-tuple information), and the value information of the transmission rule key-value relationship may include forwarding (allow) and discarding (deny).
示例性地,如图3所示,在k8s集群中,可以根据传输规则映射302确定数据流映射303。数据流映射303可以理解为基于数据流的会话映射(Session Map),Session Map可以根据待传输数据流的套接字信息(socket)对待传输数据流中的M个待传输数据包进行传输。Session Map可以包括S个传输规则键值关系3031,每个传输规则键值关系3031均包括键信息(key,可以包括socket,也即套接字信息)和值信息(value,可以包括allow和deny,也即转发和丢弃)。Exemplarily, as shown in FIG3 , in a k8s cluster, a data stream mapping 303 can be determined according to a transmission rule mapping 302. The data stream mapping 303 can be understood as a session mapping (Session Map) based on a data stream, and the Session Map can transmit the M data packets to be transmitted in the data stream to be transmitted according to the socket information (socket) of the data stream to be transmitted. The Session Map may include S transmission rule key-value relationships 3031, and each transmission rule key-value relationship 3031 includes key information (key, which may include socket, i.e., socket information) and value information (value, which may include allow and deny, i.e., forwarding and discarding).
根据本公开的实施例,在响应于接收到待传输数据流,获取待传输数据流的路由信息(五元组信息5-tuple,)之后,可以根据待传输数据流中的待传输数据包的五元组信息(5-tuple),确定待传输数据流的套接字信息(socket)。由于同一待传输数据流的M个待传输数据包具有相同的五元组信息(5-tuple),从而同一待传输数据流的M个待传输数据包具有相同的套接字信息(socket)。According to an embodiment of the present disclosure, in response to receiving a data stream to be transmitted, after obtaining routing information (five-tuple information 5-tuple) of the data stream to be transmitted, the socket information (socket) of the data stream to be transmitted can be determined according to the five-tuple information (5-tuple) of the data packet to be transmitted in the data stream to be transmitted. Since the M data packets to be transmitted of the same data stream to be transmitted have the same five-tuple information (5-tuple), the M data packets to be transmitted of the same data stream to be transmitted have the same socket information (socket).
根据本公开的实施例,可以将套接字信息与S个键信息进行匹配,得到匹配结果。作为一个示例,匹配结果可以包括数据流映射中存在与套接字信息相匹配的目标键信息和数据流映射中不存在与套接字信息相匹配的目标键值信息。According to an embodiment of the present disclosure, the socket information can be matched with the S key information to obtain a matching result. As an example, the matching result can include target key information that matches the socket information in the data stream mapping and target key value information that does not match the socket information in the data stream mapping.
示例性地,在k8s集群中,响应于接收到待传输数据流,可以先获取待传输数据流的五元组信息(5-tuple,包括sip、sport、proto、dip和dport)。可以根据前述五元组信息(5-tuple),确定待传输数据流的套接字信息(socket)。可以将待传输数据流的套接字信息(socket)与SessionMap中的S个键信息(key,包括socket)进行匹配,得到匹配结果。Exemplarily, in a k8s cluster, in response to receiving a data stream to be transmitted, the five-tuple information (5-tuple, including sip, sport, proto, dip and dport) of the data stream to be transmitted can be obtained first. The socket information (socket) of the data stream to be transmitted can be determined based on the aforementioned five-tuple information (5-tuple). The socket information (socket) of the data stream to be transmitted can be matched with the S key information (key, including socket) in SessionMap to obtain a matching result.
示例性地,在k8s集群中,在匹配结果表征SessionMap中存在与待传输数据流的套接字信息(socket)相匹配的目标键信息(key,与待传输数据流的socket匹配)的情况下,可以将与前述目标键信息对应的目标值信息(value,包括allow或deny)确定为目标传输规则。在此基础上,可以实现根据待传输数据流的套接字信息(socket)确定目标传输规则,从而基于目标传输规则对待传输数据流中的M个待传输数据包统一进行传输。For example, in a k8s cluster, when the matching result indicates that there is target key information (key, matching the socket of the data stream to be transmitted) in SessionMap, the target value information (value, including allow or deny) corresponding to the aforementioned target key information can be determined as the target transmission rule. On this basis, the target transmission rule can be determined according to the socket information (socket) of the data stream to be transmitted, so that the M data packets to be transmitted in the data stream to be transmitted are uniformly transmitted based on the target transmission rule.
根据本公开的实施例,在匹配结果表征数据流映射中存在与套接字信息相匹配的目标键信息的情况下,可以将与该目标键信息对应的目标值信息确定为目标传输规则(可以包括对M个待传输数据包进行转发或丢弃)。在此基础上,可以基于目标传输规则,对M个待传输数据包进行传输。由此,可以实现根据所有待传输数据包共同的路由信息对M个待传输数据包统一进行传输,而无需根据每个待传输数据包的路由信息对M个待传输数据包分别进行传输,由此降低了数据传输过程中消耗的计算资源,因而至少部分地克服了相关技术中对数据流中的数据包进行传输时数据传输的效率低、性能差的技术问题,从而有利于提高数据传输的效率和性能。According to an embodiment of the present disclosure, in the case where there is target key information matching the socket information in the matching result characterizing the data stream mapping, the target value information corresponding to the target key information can be determined as a target transmission rule (which may include forwarding or discarding M data packets to be transmitted). On this basis, the M data packets to be transmitted can be transmitted based on the target transmission rule. Thus, it is possible to uniformly transmit the M data packets to be transmitted according to the common routing information of all data packets to be transmitted, without having to transmit the M data packets to be transmitted separately according to the routing information of each data packet to be transmitted, thereby reducing the computing resources consumed in the data transmission process, and thus at least partially overcoming the technical problems of low efficiency and poor performance of data transmission when transmitting data packets in a data stream in the related art, thereby facilitating improving the efficiency and performance of data transmission.
根据本公开的实施例,操作S220可以包括:将路由信息与P个输入键信息和Q个输出键信息进行匹配,得到匹配结果;以及响应于匹配结果表征P个输入键信息和Q个输出键信息中存在与路由信息相匹配的目标键信息,将与目标键信息对应的操作值信息确定为目标传输规则。According to an embodiment of the present disclosure, operation S220 may include: matching routing information with P input key information and Q output key information to obtain a matching result; and in response to the matching result indicating that there is target key information in the P input key information and the Q output key information that matches the routing information, determining the operation value information corresponding to the target key information as the target transmission rule.
根据本公开的实施例,在响应于接收到待传输数据流,获取待传输数据流的路由信息(五元组信息)之后,可以根据待传输数据流中的待传输数据包的五元组信息,确定待传输数据流的套接字信息。在数据流映射的S个传输规则键值关系中未存在与前述套接字信息相匹配的信息的情况下,可以将路由信息(五元组信息)与传输规则映射中的P个输入键信息和Q个输出键信息进行匹配,得到匹配结果。According to an embodiment of the present disclosure, in response to receiving a data stream to be transmitted, after obtaining routing information (five-tuple information) of the data stream to be transmitted, the socket information of the data stream to be transmitted can be determined according to the five-tuple information of the data packet to be transmitted in the data stream to be transmitted. In the case that there is no information matching the aforementioned socket information in the S transmission rule key-value relationships of the data stream mapping, the routing information (five-tuple information) can be matched with the P input key information and the Q output key information in the transmission rule mapping to obtain a matching result.
根据本公开的实施例,响应于上述的匹配结果表征P个输入键信息和Q个输出键信息中存在于路由信息相匹配的目标键信息,可以将与目标键信息对应的目标值信息确定为目标传输规则。目标值信息可以理解为与目标键信息对应的值信息。According to an embodiment of the present disclosure, in response to the above-mentioned matching result characterizing the target key information that exists in the P input key information and the Q output key information and matches the routing information, the target value information corresponding to the target key information can be determined as the target transmission rule. The target value information can be understood as the value information corresponding to the target key information.
示例性地,目标键信息可以包括输入键信息或输出键信息,目标值信息可以包括转发和丢弃。在此基础上,可以根据前述目标传输规则,对待传输数据流中的M个待传输数据包进行传输。Exemplarily, the target key information may include input key information or output key information, and the target value information may include forwarding and discarding. On this basis, the M data packets to be transmitted in the data stream to be transmitted may be transmitted according to the aforementioned target transmission rule.
示例性地,在k8s集群中,响应于接收到待传输数据流,可以先获取待传输数据流的五元组信息(5-tuple,包括sip、sport、proto、dip和dport)。可以根据前述五元组信息(5-tuple),确定待传输数据流的套接字信息(socket)。可以将待传输数据流的套接字信息(socket)与SessionMap中的S个键信息(key,包括socket)进行匹配,得到匹配结果。Exemplarily, in a k8s cluster, in response to receiving a data stream to be transmitted, the five-tuple information (5-tuple, including sip, sport, proto, dip and dport) of the data stream to be transmitted can be obtained first. The socket information (socket) of the data stream to be transmitted can be determined based on the aforementioned five-tuple information (5-tuple). The socket information (socket) of the data stream to be transmitted can be matched with the S key information (key, including socket) in SessionMap to obtain a matching result.
示例性地,在k8s集群中,在匹配结果表征SessionMap中未存在与待传输数据流的套接字信息(socket)相匹配的目标键信息的情况下,可以将待传输数据流的五元组信息(5-tuple)与的PolicyMap中的P个输入键信息(key,包括sip、sport、proto、dip和dport)和Q个输出键信息(key,包括sip、sport、proto、dip和dport)进行匹配,得到匹配结果。Exemplarily, in a k8s cluster, when the matching result indicates that there is no target key information in SessionMap that matches the socket information (socket) of the data stream to be transmitted, the quintuple information (5-tuple) of the data stream to be transmitted can be matched with the P input key information (key, including sip, sport, proto, dip and dport) and Q output key information (key, including sip, sport, proto, dip and dport) in PolicyMap to obtain a matching result.
示例性地,在k8s集群中,响应于匹配结果表征PolicyMap中的P个输入键信息和Q个输出键信息中存在于待传输数据流的五元组信息(5-tuple)相匹配的目标键信息(key,与待传输数据流的5-tuple相匹配),可以将与前述目标键信息对应的目标值信息(value,包括allow或deny)确定为目标传输规则。可以基于目标传输规则,对待传输数据流中的M个待传输数据包进行分别传输。Exemplarily, in a k8s cluster, in response to the target key information (key, matching the 5-tuple of the data stream to be transmitted) that matches the P input key information and Q output key information in the PolicyMap in the matching result, the target value information (value, including allow or deny) corresponding to the aforementioned target key information can be determined as the target transmission rule. Based on the target transmission rule, the M data packets to be transmitted in the data stream to be transmitted can be transmitted separately.
根据本公开的实施例,上述的数据流映射包括S个传输规则映射关系,每个传输规则映射关系包括键信息和值信息;操作S230可以包括:将套接字信息确定为键信息;将目标传输规则确定为值信息;根据键信息和值信息,构建目标传输规则键值关系;以及利用目标传输规则键值关系,更新数据流映射,得到更新后的数据流映射。According to an embodiment of the present disclosure, the above-mentioned data flow mapping includes S transmission rule mapping relationships, each transmission rule mapping relationship includes key information and value information; operation S230 may include: determining the socket information as key information; determining the target transmission rule as value information; constructing a target transmission rule key-value relationship based on the key information and the value information; and using the target transmission rule key-value relationship to update the data flow mapping to obtain an updated data flow mapping.
根据本公开的实施例,在数据流映射的S个传输规则键值关系中未存在与待传输数据流的路由信息(套接字信息,socket)相匹配的信息的情况下,可以根据待传输数据流的路由信息(五元组信息,5-tuple),确定与待传输数据流对应的目标传输规则。在确定与待传输数据流对应的目标传输规则之后,可以将待传输数据流的套接字信息确定为传输规则键值关系的键信息,将与待传输数据流对应的目标传输规则确定为传输规则键值关系的值信息。在此基础上,可以根据基于待传输数据流确定的键信息和值信息,构建与待传输数据流对应的目标传输规则键值关系。可以利用目标传输规则键值关系,更新数据流映射,得到更新后的数据流映射。According to an embodiment of the present disclosure, when there is no information matching the routing information (socket information, socket) of the data stream to be transmitted in the S transmission rule key-value relationships of the data stream mapping, the target transmission rule corresponding to the data stream to be transmitted can be determined based on the routing information (five-tuple information, 5-tuple) of the data stream to be transmitted. After determining the target transmission rule corresponding to the data stream to be transmitted, the socket information of the data stream to be transmitted can be determined as the key information of the transmission rule key-value relationship, and the target transmission rule corresponding to the data stream to be transmitted can be determined as the value information of the transmission rule key-value relationship. On this basis, a target transmission rule key-value relationship corresponding to the data stream to be transmitted can be constructed based on the key information and value information determined based on the data stream to be transmitted. The target transmission rule key-value relationship can be used to update the data stream mapping to obtain an updated data stream mapping.
示例性地,在k8s集群中,在SessionMap的S个传输规则键值关系中未存在与待传输数据流的套接字信息(socket)相匹配的信息情况下,可以根据待传输数据流的五元组信息(5-tuple)确定与待传输数据流对应的目标传输规则(包括allow或deny)。在确定与待传输数据流对应的目标传输规则之后,可以将待传输数据流的套接字信息(socket)确定为传输规则键值关系的键信息(key),将与待传输数据流对应的目标传输规则(allow或deny)确定为传输规则键值关系的值信息(value)。在此基础上,可以基于前述键信息(key)和值信息(value),构建与待传输数据流对应的目标传输规则键值关系。Exemplarily, in a k8s cluster, when there is no information matching the socket information (socket) of the data stream to be transmitted in the S transmission rule key-value relationships of SessionMap, the target transmission rule (including allow or deny) corresponding to the data stream to be transmitted can be determined based on the five-tuple information (5-tuple) of the data stream to be transmitted. After determining the target transmission rule corresponding to the data stream to be transmitted, the socket information (socket) of the data stream to be transmitted can be determined as the key information (key) of the transmission rule key-value relationship, and the target transmission rule (allow or deny) corresponding to the data stream to be transmitted can be determined as the value information (value) of the transmission rule key-value relationship. On this basis, a target transmission rule key-value relationship corresponding to the data stream to be transmitted can be constructed based on the aforementioned key information (key) and value information (value).
示例性地,在k8s集群中,确定目标传输规则键值关系之后,可以将上述的目标键信息和目标值信息关联写入BPF_MAP_TYPE_SK_STORAGE类型的map,从而可以更新SessionMap,得到更新后的SessionMap。Exemplarily, in a k8s cluster, after determining the target transmission rule key-value relationship, the above-mentioned target key information and target value information can be associated and written into a map of type BPF_MAP_TYPE_SK_STORAGE, so that the SessionMap can be updated to obtain an updated SessionMap.
根据本公开的实施例,通过以上的设置,更新后的数据流映射中包括了与待传输数据流的路由信息(套接字信息)相匹配的信息,从而在再次响应于具有同样的路由信息(套接字信息)的待传输数据流的情况下,可以根据套接字信息确定S个传输规则键值关系中与待传输数据流对应的目标键信息和目标值信息,并可以将目标值信息确定为目标传输规则。在此基础上,可以基于目标传输规则对待传输数据流中的M个待传输数据包统一进行传输,由此而无需根据每个待传输数据包的路由信息对M个待传输数据包分别进行传输,由此降低了数据传输过程中消耗的计算资源,因而至少部分地克服了相关技术中对数据流中的数据包进行传输时数据传输的效率低、性能差的技术问题。According to the embodiments of the present disclosure, through the above settings, the updated data stream mapping includes information that matches the routing information (socket information) of the data stream to be transmitted, so that when responding to the data stream to be transmitted with the same routing information (socket information) again, the target key information and target value information corresponding to the data stream to be transmitted in the S transmission rule key-value relationship can be determined according to the socket information, and the target value information can be determined as the target transmission rule. On this basis, the M data packets to be transmitted in the data stream to be transmitted can be uniformly transmitted based on the target transmission rule, thereby eliminating the need to transmit the M data packets to be transmitted separately according to the routing information of each data packet to be transmitted, thereby reducing the computing resources consumed in the data transmission process, and thus at least partially overcoming the technical problems of low efficiency and poor performance of data transmission when transmitting data packets in the data stream in the related art.
根据本公开的实施例,操作S240可以包括:响应于接收到第m个待传输数据包,将套接字信息与S个键信息进行匹配,得到匹配结果;在匹配结果表征数据流映射中存在与套接字信息相匹配的目标键信息的情况下,将与目标键信息对应的值信息确定为目标传输规则;以及基于目标传输规则,对第m个待传输数据包进行传输。According to an embodiment of the present disclosure, operation S240 may include: in response to receiving the mth data packet to be transmitted, matching the socket information with S key information to obtain a matching result; in a case where the matching result represents the presence of target key information matching the socket information in the data stream mapping, determining the value information corresponding to the target key information as a target transmission rule; and transmitting the mth data packet to be transmitted based on the target transmission rule.
示例性地,在k8s集群中,响应于接收到第m个待传输数据包,可以将待传输数据包的套接字信息(socket)与SessionMap中的S个键信息(key,包括socket)进行匹配,得到匹配结果。在匹配结果表征SessionMap中存在于待传输数据包的套接字信息(socket)相匹配的目标键信息(key,与待传输数据流的socket匹配)的情况下,可以将与前述目标键信息对应的目标值信息(value,包括allow或deny)确定为目标传输规则。在此基础上,可以基于前述目标传输规则,对第m个待传输数据包进行传输。Exemplarily, in a k8s cluster, in response to receiving the mth data packet to be transmitted, the socket information (socket) of the data packet to be transmitted can be matched with S key information (key, including socket) in SessionMap to obtain a matching result. In the case where the matching result represents the target key information (key, matching the socket of the data stream to be transmitted) that matches the socket information (socket) of the data packet to be transmitted in SessionMap, the target value information (value, including allow or deny) corresponding to the aforementioned target key information can be determined as the target transmission rule. On this basis, the mth data packet to be transmitted can be transmitted based on the aforementioned target transmission rule.
根据本公开的实施例,上述的响应于接收到待传输数据流,获取待传输数据流的路由信息包括:响应于接收到待传输数据流,利用跟踪工具,获取路由信息;方法还包括,在利用更新后的数据流映射,对M个待传输数据包进行传输之后:响应于M个待传输数据包均传输完成,删除更新后的数据流映射中与套接字信息对应的传输规则键值关系。According to an embodiment of the present disclosure, the above-mentioned response to receiving the data stream to be transmitted, obtaining the routing information of the data stream to be transmitted includes: in response to receiving the data stream to be transmitted, using a tracking tool to obtain the routing information; the method also includes, after using the updated data stream mapping to transmit the M data packets to be transmitted: in response to the M data packets to be transmitted being transmitted, deleting the transmission rule key-value relationship corresponding to the socket information in the updated data stream mapping.
根据本公开的一个实施例,响应于接收到待传输数据流,可以利用跟踪工具,获取待传输数据流的路由信息。According to an embodiment of the present disclosure, in response to receiving a data stream to be transmitted, a tracing tool may be used to obtain routing information of the data stream to be transmitted.
根据本公开的实施例,跟踪工具可以用于跟踪待传输数据流的状态,并获取待传输数据流的路由信息(可以包括五元组信息)。According to an embodiment of the present disclosure, a tracking tool may be used to track the status of a data stream to be transmitted, and obtain routing information (which may include quintuple information) of the data stream to be transmitted.
示例性地,在k8s集群中,跟踪工具可以基于连接跟踪表(Connection TrackingTable)实现。连接跟踪表可以存储当前活动的网络连接的状态信息,状态信息可以包括五元组信息。响应于接收到待传输数据流,可以通过检查待传输数据表来确定待传输数据流的路由信息。Exemplarily, in a k8s cluster, the tracking tool can be implemented based on a connection tracking table. The connection tracking table can store the status information of the currently active network connection, and the status information can include five-tuple information. In response to receiving a data stream to be transmitted, the routing information of the data stream to be transmitted can be determined by checking the data table to be transmitted.
根据本公开的一个实施例,在待传输数据流的M个待传输数据包均传输完成之后,可以删除更新后的数据流映射中与待传输数据流的套接字信息对应的传输规则键值关系,从而可以无需对已完成传输的数据流的相关信息进行维护,有利于进一步降低数据传输过程中消耗的计算资源,有助于提高数据传输的效率和性能。According to one embodiment of the present disclosure, after all M data packets to be transmitted of the data stream to be transmitted are transmitted, the transmission rule key-value relationship corresponding to the socket information of the data stream to be transmitted in the updated data stream mapping can be deleted, thereby eliminating the need to maintain relevant information of the data stream that has completed transmission, which is beneficial to further reduce the computing resources consumed in the data transmission process and helps to improve the efficiency and performance of data transmission.
示例性地,在k8s集群中,响应于待传输数据流中的M个待传输数据包均传输完成,可以删除更新后的SessionMap中与该待传输数据流的套接字信息(socket)对应的传输规则键值关系。Exemplarily, in a k8s cluster, in response to the completion of transmission of all M data packets to be transmitted in a data stream to be transmitted, the transmission rule key-value relationship corresponding to the socket information (socket) of the data stream to be transmitted in the updated SessionMap can be deleted.
图4示例性示出了根据本公开实施例的数据传输过程的示意图。FIG. 4 exemplarily shows a schematic diagram of a data transmission process according to an embodiment of the present disclosure.
响应于接收到待传输数据流401,可以获取待传输数据流401的路由信息402(五元组信息),可以根据路由信息402,确定待传输数据流401的套接字信息403。In response to receiving the data stream 401 to be transmitted, routing information 402 (five-tuple information) of the data stream 401 to be transmitted may be acquired, and socket information 403 of the data stream 401 to be transmitted may be determined according to the routing information 402 .
可以将套接字信息403与数据流映射404中的S个键信息进行匹配,得到第一匹配结果405。在第一匹配结果405表征数据流映射404中存在与套接字信息403相匹配的目标键信息406的情况下,可以将目标键信息406对应的目标值信息407确定为与待传输数据流401的对应的目标传输规则408。The socket information 403 may be matched with the S key information in the data stream mapping 404 to obtain a first matching result 405. When the first matching result 405 indicates that there is target key information 406 matching the socket information 403 in the data stream mapping 404, the target value information 407 corresponding to the target key information 406 may be determined as a target transmission rule 408 corresponding to the data stream 401 to be transmitted.
在第一匹配结果405表征数据流映射404中未存在与套接字信息403相匹配的目标键信息406的情况下,可以将路由信息402与传输规则映射409中的P个输入键信息和Q个输出键信息进行匹配,得到第二匹配结果410。响应于第二匹配结果410表征P个输入键信息和Q个输出键信息中存在与路由信息402相匹配的目标键信息406,可以将目标键信息406对应的目标值信息407确定为与待传输数据流401的对应的目标传输规则408。在此基础上,可以根据路由信息402和目标传输规则408,更新数据流映射404。In the case where the first matching result 405 indicates that there is no target key information 406 matching the socket information 403 in the data stream mapping 404, the routing information 402 can be matched with the P input key information and the Q output key information in the transmission rule mapping 409 to obtain the second matching result 410. In response to the second matching result 410 indicating that there is target key information 406 matching the routing information 402 in the P input key information and the Q output key information, the target value information 407 corresponding to the target key information 406 can be determined as the target transmission rule 408 corresponding to the data stream 401 to be transmitted. On this basis, the data stream mapping 404 can be updated according to the routing information 402 and the target transmission rule 408.
在确定目标传输规则408之后,可以基于目标传输规则408,对待传输数据流401中的M个待传输数据包进行传输。After the target transmission rule 408 is determined, the M data packets to be transmitted in the data stream 401 to be transmitted may be transmitted based on the target transmission rule 408 .
图5示例性示出了根据本公开的一个实施例的数据传输架构图。FIG. 5 exemplarily shows a data transmission architecture diagram according to an embodiment of the present disclosure.
根据本公开的实施例,可以基于网络策略配置信息确定传输规则映射和数据流映射。According to an embodiment of the present disclosure, transmission rule mapping and data flow mapping may be determined based on network policy configuration information.
示例性地,如图5所示,在k8s集群中,可以根据网络策略配置501信息(NetworkPolicy)确定传输规则映射(Policy Map),并可以根据传输规则映射(Policy Map)确定数据流映射。传输规则映射(Policy Map)可以包括输入键值关系5021(Ingress Policy Map)和输出键值关系5022(Egress Policy Map)。数据流映射可以包括传输规则键值关系503(Session Map)。Exemplarily, as shown in FIG5 , in a k8s cluster, a transmission rule mapping (Policy Map) can be determined according to the network policy configuration 501 information (NetworkPolicy), and a data flow mapping can be determined according to the transmission rule mapping (Policy Map). The transmission rule mapping (Policy Map) can include an input key value relationship 5021 (Ingress Policy Map) and an output key value relationship 5022 (Egress Policy Map). The data flow mapping can include a transmission rule key value relationship 503 (Session Map).
示例性,在k8s集群中,可以在控制组入口钩子点5041(cgroup ingress hook点)处和控制组出口钩子点5042(cgroup egress hook点)处挂载传输规则键值关系503(Session Map),从而可以根据待传输数据包的套接字信息(socket),对待传输数据包进行传输。For example, in a k8s cluster, the transmission rule key-value relationship 503 (Session Map) can be mounted at the control group ingress hook point 5041 (cgroup ingress hook point) and the control group egress hook point 5042 (cgroup egress hook point), so that the data packet to be transmitted can be transmitted according to the socket information (socket) of the data packet to be transmitted.
示例地,在k8s集群中,可以在控制组入口钩子点5041(cgroup ingress hook点)处和控制组出口钩子点5042(cgroup egress hook点)处分别对应挂载基于eBPF程序505实现的输入键值关系5021(Ingress Policy Map)和输出键值关系5022(Egress PolicyMap),从而可以根据待传输数据包的五元组信息(5-tuple),对待传输数据包进行传输。For example, in a k8s cluster, the input key-value relationship 5021 (Ingress Policy Map) and the output key-value relationship 5022 (Egress PolicyMap) implemented based on the eBPF program 505 can be mounted at the control group ingress hook point 5041 (cgroup ingress hook point) and the control group exit hook point 5042 (cgroup egress hook point) respectively, so that the data packet to be transmitted can be transmitted according to the 5-tuple information (5-tuple) of the data packet to be transmitted.
以上仅是示例性实施例,但不限于此,还可以包括本领域已知的其他数据传输方法,只要能够实现数据传输即可。The above are only exemplary embodiments, but are not limited thereto, and may also include other data transmission methods known in the art as long as data transmission can be achieved.
图6示意性示出了根据本公开的实施例的数据传输装置的框图。FIG6 schematically shows a block diagram of a data transmission device according to an embodiment of the present disclosure.
如图6所示,数据传输装置600可以包括获取模块610、确定模块620、更新模块630和传输模块640。As shown in FIG. 6 , the data transmission device 600 may include an acquisition module 610 , a determination module 620 , an update module 630 and a transmission module 640 .
获取模块610,用于响应于接收到待传输数据流,获取待传输数据流的路由信息,其中,待传输数据流包括M个具有顺序关系的待传输数据包,M为正整数。The acquisition module 610 is used to acquire routing information of the data stream to be transmitted in response to receiving the data stream to be transmitted, wherein the data stream to be transmitted includes M data packets to be transmitted in a sequential relationship, and M is a positive integer.
确定模块620,用于在数据流映射中未存在与路由信息相匹配的信息的情况下,根据传输规则映射和路由信息,确定目标传输规则。The determination module 620 is used to determine the target transmission rule according to the transmission rule mapping and the routing information when there is no information matching the routing information in the data flow mapping.
更新模块630,用于根据路由信息和目标传输规则,更新数据流映射,得到更新后的数据流映射。The updating module 630 is used to update the data flow mapping according to the routing information and the target transmission rule to obtain the updated data flow mapping.
传输模块640,用于利用更新后的数据流映射,对M个待传输数据包进行传输。The transmission module 640 is used to transmit the M data packets to be transmitted by using the updated data stream mapping.
根据本公开的实施例,数据传输装置600可以包括传输规则映射模块和数据流映射模块。According to an embodiment of the present disclosure, the data transmission device 600 may include a transmission rule mapping module and a data flow mapping module.
根据本公开的实施例,传输规则映射模块可以包括输入规则映射子模块和输出规则映射子模块。According to an embodiment of the present disclosure, the transmission rule mapping module may include an input rule mapping submodule and an output rule mapping submodule.
输入规则映射子模块,可以包括P个输入规则键值关系,每个输入规则键值关系包括输入键信息和输入操作值信息,P为正整数。The input rule mapping submodule may include P input rule key-value relationships, each of which includes input key information and input operation value information, and P is a positive integer.
输出规则映射子模块,可以包括Q个输出规则键值关系,每个输出规则键值关系包括输出键信息和输出操作值信息,Q为正整数。The output rule mapping submodule may include Q output rule key-value relationships, each of which includes output key information and output operation value information, and Q is a positive integer.
根据本公开的实施例,输入规则映射子模块可以包括输入规则键值关系构建单元。输出规则映射子模块可以包括输出规则键值关系构建单兀。According to an embodiment of the present disclosure, the input rule mapping submodule may include an input rule key-value relationship building unit. The output rule mapping submodule may include an output rule key-value relationship building unit.
输入规则键值关系构建单元,可以用于根据网络策略配置信息,确定输入键信息和输入操作值信息;以及根据输入键信息和输入操作值信息,构建输入规则键值关系。The input rule key-value relationship building unit can be used to determine input key information and input operation value information according to network policy configuration information; and to build an input rule key-value relationship according to the input key information and input operation value information.
输出规则键值关系构建单元,可以用于根据网络策略配置信息,确定输出键信息和输出操作值信息;以及根据输出键信息和输出操作值信息,构建输出规则键值关系。The output rule key-value relationship construction unit can be used to determine the output key information and the output operation value information according to the network policy configuration information; and to construct the output rule key-value relationship according to the output key information and the output operation value information.
根据本公开的实施例,数据流映射模块可以包括传输规则键值关系子模块。According to an embodiment of the present disclosure, the data flow mapping module may include a transmission rule key-value relationship submodule.
传输规则键值关系子模块,可以包括S个传输规则键值关系,每个传输规则键值关系包括键信息和值信息,S为正整数。The transmission rule key-value relationship submodule may include S transmission rule key-value relationships, each transmission rule key-value relationship includes key information and value information, and S is a positive integer.
根据本公开的实施例,获取模块610可以包括套接字确定子模块和跟踪工具子模块。According to an embodiment of the present disclosure, the acquisition module 610 may include a socket determination submodule and a tracking tool submodule.
套接字确定子模块,可以用于在响应于接收到待传输数据流,获取待传输数据流的路由信息之后:根据路由信息,确定待传输数据流的套接字信息,其中,属于同一待传输数据流的M个待传输数据包具有相同的套接字信息。The socket determination submodule can be used to determine the socket information of the data stream to be transmitted according to the routing information after obtaining the routing information of the data stream to be transmitted in response to receiving the data stream to be transmitted, wherein the M data packets to be transmitted belonging to the same data stream to be transmitted have the same socket information.
跟踪工具子模块,可以用于响应于接收到待传输数据流,利用跟踪工具,获取路由信息。The tracking tool submodule may be used to obtain routing information using a tracking tool in response to receiving a data stream to be transmitted.
根据本公开的实施例,确定模块620可以包括第一匹配子模块、第二匹配子模块和目标传输规则确定子模块。According to an embodiment of the present disclosure, the determination module 620 may include a first matching submodule, a second matching submodule, and a target transmission rule determination submodule.
第一匹配子模块,可以用于在数据流映射中存在与路由信息相匹配的信息的情况下,将套接字信息与S个键信息进行匹配,得到匹配结果。The first matching submodule can be used to match the socket information with the S key information to obtain a matching result when there is information matching the routing information in the data flow mapping.
第二匹配子模块,可以用于在数据流映射中未存在与路由信息相匹配的信息的情况下,将路由信息与P个输入键信息和Q个输出键信息进行匹配,得到匹配结果。The second matching submodule may be used to match the routing information with the P input key information and the Q output key information to obtain a matching result when there is no information matching the routing information in the data flow mapping.
目标传输规则确定子模块,可以用于在匹配结果表征数据流映射中存在与套接字信息相匹配的目标键信息的情况下,将与目标键信息对应的值信息确定为目标传输规则;以及可以用于响应于匹配结果表征P个输入键信息和Q个输出键信息中存在与路由信息相匹配的目标键信息,将与目标键信息对应的操作值信息确定为目标传输规则。The target transmission rule determination submodule can be used to determine the value information corresponding to the target key information as the target transmission rule when there is target key information matching the socket information in the matching result representation data stream mapping; and can be used to determine the operation value information corresponding to the target key information as the target transmission rule in response to the presence of target key information matching the routing information in the matching result representation P input key information and Q output key information.
根据本公开的实施例,更新模块630可以包括键信息确定子模块、值信息确定子模块、目标传输规则键值关系构建子模块、数据流映射更新子模块和传输规则键值关系删除子模块。According to an embodiment of the present disclosure, the update module 630 may include a key information determination submodule, a value information determination submodule, a target transmission rule key-value relationship construction submodule, a data flow mapping update submodule and a transmission rule key-value relationship deletion submodule.
键信息确定子模块,可以用于将套接字信息确定为键信息。The key information determination submodule can be used to determine the socket information as key information.
值信息确定子模块,可以用于将目标传输规则确定为值信息。The value information determination submodule may be used to determine the target transmission rule as value information.
目标传输规则键值关系构建子模块,可以用于根据键信息和值信息,构建目标传输规则键值关系。The target transmission rule key-value relationship construction submodule can be used to construct the target transmission rule key-value relationship according to the key information and the value information.
数据流映射更新子模块,可以用于利用目标传输规则映射关系,更新数据流映射,得到更新后的数据流映射。The data stream mapping update submodule can be used to update the data stream mapping by using the target transmission rule mapping relationship to obtain an updated data stream mapping.
传输规则键值关系删除子模块,可以用于在利用更新后的数据流映射,对M个待传输数据包进行传输之后:响应于M个待传输数据包均传输完成,删除更新后的数据流映射中与套接字信息对应的传输规则键值关系。The transmission rule key value relationship deletion submodule can be used to delete the transmission rule key value relationship corresponding to the socket information in the updated data flow mapping after transmitting M data packets to be transmitted using the updated data flow mapping: in response to the transmission of all M data packets to be transmitted being completed.
根据本公开的实施例,传输模块640可以包括第三匹配子模块和数据包传输子模块。According to an embodiment of the present disclosure, the transmission module 640 may include a third matching submodule and a data packet transmission submodule.
第三匹配子模块,可以用于响应于接收到第m个待传输数据包,将套接字信息与S个键信息进行匹配,得到匹配结果。The third matching submodule can be used to match the socket information with the S key information in response to receiving the mth data packet to be transmitted, to obtain a matching result.
数据包传输子模块,可以用于基于目标传输规则,对第m个待传输数据包进行传输。The data packet transmission submodule can be used to transmit the mth data packet to be transmitted based on the target transmission rule.
根据本公开的实施例的模块、子模块、单元、子单元中的任意多个、或其中任意多个的至少部分功能可以在一个模块中实现。根据本公开实施例的模块、子模块、单元、子单元中的任意一个或多个可以被拆分成多个模块来实现。根据本公开实施例的模块、子模块、单元、子单元中的任意一个或多个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式的硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,根据本公开实施例的模块、子模块、单元、子单元中的一个或多个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
例如,获取模块610、确定模块620、更新模块630和传输模块640中的任意多个可以合并在一个模块/单元/子单元中实现,或者其中的任意一个模块/单元/子单元可以被拆分成多个模块/单元/子单元。或者,这些模块/单元/子单元中的一个或多个模块/单元/子单元的至少部分功能可以与其他模块/单元/子单元的至少部分功能相结合,并在一个模块/单元/子单元中实现。根据本公开的实施例,获取模块610、确定模块620、更新模块630和传输模块640中的至少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,获取模块610、确定模块620、更新模块630和传输模块640中的至少一个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。For example, any multiple of the acquisition module 610, the determination module 620, the update module 630, and the transmission module 640 can be combined in one module/unit/subunit for implementation, or any one of the modules/units/subunits can be split into multiple modules/units/subunits. Alternatively, at least part of the functions of one or more of these modules/units/subunits can be combined with at least part of the functions of other modules/units/subunits and implemented in one module/unit/subunit. According to an embodiment of the present disclosure, at least one of the acquisition module 610, the determination module 620, the update module 630, and the transmission module 640 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the acquisition module 610 , the determination module 620 , the update module 630 , and the transmission module 640 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
需要说明的是,本公开的实施例中数据传输装置部分与本公开的实施例中数据传输方法部分是相对应的,数据传输装置部分的描述具体参考数据传输方法部分,在此不再赘述。It should be noted that the data transmission device part in the embodiment of the present disclosure corresponds to the data transmission method part in the embodiment of the present disclosure. The description of the data transmission device part specifically refers to the data transmission method part, which will not be repeated here.
图7示意性示出了根据本公开实施例的适于实现数据传输方法的电子设备的框图。图7示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Fig. 7 schematically shows a block diagram of an electronic device suitable for implementing a data transmission method according to an embodiment of the present disclosure. The electronic device shown in Fig. 7 is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.
如图7所示,根据本公开实施例的计算机电子设备700包括处理器701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分709加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。处理器701例如可以包括通用微处理器(例如CPU)、指令集处理器和/或相关芯片组和/或专用微处理器(例如,专用集成电路(ASIC)),等等。处理器701还可以包括用于缓存用途的板载存储器。处理器701可以包括用于执行根据本公开实施例的方法流程的不同动作的单一处理单元或者是多个处理单元。As shown in FIG7 , a computer electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 709 into a random access memory (RAM) 703. The processor 701 may, for example, include a general-purpose microprocessor (e.g., a CPU), an instruction set processor and/or a related chipset and/or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
在RAM 703中,存储有电子设备700操作所需的各种程序和数据。处理器701、ROM702以及RAM 703通过总线704彼此相连。处理器701通过执行ROM 702和/或RAM 703中的程序来执行根据本公开实施例的方法流程的各种操作。需要注意,所述程序也可以存储在除ROM 702和RAM 703以外的一个或多个存储器中。处理器701也可以通过执行存储在所述一个或多个存储器中的程序来执行根据本公开实施例的方法流程的各种操作。In RAM 703, various programs and data required for the operation of electronic device 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other via bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and/or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
根据本公开的实施例,电子设备700还可以包括输入/输出(I/O)接口705,输入/输出(I/O)接口705也连接至总线704。电子设备700还可以包括连接至输入/输出(I/O)接口705的以下部件中的一项或多项:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至输入/输出(I/O)接口705。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。According to an embodiment of the present disclosure, the electronic device 700 may further include an input/output (I/O) interface 705, which is also connected to the bus 704. The electronic device 700 may further include one or more of the following components connected to the input/output (I/O) interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 708 including a hard disk, etc.; and a communication portion 709 including a network interface card such as a LAN card, a modem, etc. The communication portion 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input/output (I/O) interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage portion 708 as needed.
根据本公开的实施例,根据本公开实施例的方法流程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读存储介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。在该计算机程序被处理器701执行时,执行本公开实施例的系统中限定的上述功能。根据本公开的实施例,上文描述的系统、设备、装置、模块、单元等可以通过计算机程序模块来实现。According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and/or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
本公开还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例中描述的设备/装置/系统中所包含的;也可以是单独存在,而未装配入该设备/装置/系统中。上述计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被执行时,实现根据本公开实施例的方法。The present disclosure also provides a computer-readable storage medium, which may be included in the device/apparatus/system described in the above embodiments; or may exist independently without being assembled into the device/apparatus/system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
根据本公开的实施例,计算机可读存储介质可以是非易失性的计算机可读存储介质。例如可以包括但不限于:便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
例如,根据本公开的实施例,计算机可读存储介质可以包括上文描述的ROM 702和/或RAM 703和/或ROM 702和RAM 703以外的一个或多个存储器。For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and/or the RAM 703 described above and/or one or more memories other than the ROM 702 and the RAM 703 .
本公开的实施例还包括一种计算机程序产品,其包括计算机程序,该计算机程序包含用于执行本公开实施例所提供的方法的程序代码,当计算机程序产品在电子设备上运行时,该程序代码用于使电子设备实现本公开实施例所提供的数据传输方法。An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the data transmission method provided by the embodiment of the present disclosure.
在该计算机程序被处理器701执行时,执行本公开实施例的系统/装置中限定的上述功能。根据本公开的实施例,上文描述的系统、装置、模块、单元等可以通过计算机程序模块来实现。When the computer program is executed by the processor 701, the above functions defined in the system/device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
在一种实施例中,该计算机程序可以依托于光存储器件、磁存储器件等有形存储介质。在另一种实施例中,该计算机程序也可以在网络介质上以信号的形式进行传输、分发,并通过通信部分709被下载和安装,和/或从可拆卸介质711被安装。该计算机程序包含的程序代码可以用任何适当的网络介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 709, and/or installed from a removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
根据本公开的实施例,可以以一种或多种程序设计语言的任意组合来编写用于执行本公开实施例提供的计算机程序的程序代码,具体地,可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。程序设计语言包括但不限于诸如Java,C++,python,“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。本领域技术人员可以理解,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合,即使这样的组合或结合没有明确记载于本公开中。特别地,在不脱离本公开精神和教导的情况下,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合。所有这些组合和/或结合均落入本公开的范围。The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and/or claims of the present disclosure can be combined and/or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and/or claims of the present disclosure may be combined and/or combined in a variety of ways. All of these combinations and/or combinations fall within the scope of the present disclosure.
以上对本公开的实施例进行了描述。但是,这些实施例仅仅是为了说明的目的,而并非为了限制本公开的范围。尽管在以上分别描述了各实施例,但是这并不意味着各个实施例中的措施不能有利地结合使用。本公开的范围由所附权利要求及其等同物限定。不脱离本公开的范围,本领域技术人员可以做出多种替代和修改,这些替代和修改都应落在本公开的范围之内。The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410693077.5A CN118631719A (en) | 2024-05-30 | 2024-05-30 | Data transmission method and device, electronic device and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410693077.5A CN118631719A (en) | 2024-05-30 | 2024-05-30 | Data transmission method and device, electronic device and computer-readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118631719A true CN118631719A (en) | 2024-09-10 |
Family
ID=92600969
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410693077.5A Pending CN118631719A (en) | 2024-05-30 | 2024-05-30 | Data transmission method and device, electronic device and computer-readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118631719A (en) |
-
2024
- 2024-05-30 CN CN202410693077.5A patent/CN118631719A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12184696B2 (en) | Computer-based policy manager for cloud-based unified functions | |
US9749292B2 (en) | Selectively performing man in the middle decryption | |
US11336696B2 (en) | Control access to domains, servers, and content | |
US10341357B2 (en) | Selectively performing man in the middle decryption | |
US10038668B2 (en) | Computerized system and method for handling network traffic | |
US8117335B2 (en) | Service or application driven processing of network traffic using a smart router | |
US12015619B2 (en) | Dynamic routing of access request streams in a unified policy enforcement system | |
US11777993B2 (en) | Unified system for detecting policy enforcement issues in a cloud-based environment | |
US20150156183A1 (en) | System and method for filtering network communications | |
US9356844B2 (en) | Efficient application recognition in network traffic | |
US11140132B1 (en) | Network flow management | |
US11677723B2 (en) | Third-party gateway for security and privacy | |
US12058109B2 (en) | VPN deep packet inspection | |
CN115589383A (en) | eBPF-based virtual machine data transmission method, device, equipment and storage medium | |
CN114930776B (en) | Traffic mirroring in a hybrid network environment | |
EP4300915A1 (en) | Hostname based reverse split tunnel with wildcard support | |
CN113452663B (en) | Network Service Control Based on Application Characteristics | |
EP4518249A1 (en) | Security gateway, systems, methods and storage medium for validating ingress traffic in a computer network system | |
CN115037572B (en) | Application request identification method and device | |
CN118631719A (en) | Data transmission method and device, electronic device and computer-readable storage medium | |
CN107547478B (en) | Message transmission method, device and system | |
CN113726917B (en) | Domain name determination method, device and electronic device | |
CN118713919B (en) | Container network access control method, device, medium, equipment and program product | |
WO2025096172A1 (en) | Systems and methods for secured network information transmission |
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 |