Movatterモバイル変換


[0]ホーム

URL:


CN116016339A - Message path selection method, device, electronic equipment and medium - Google Patents

Message path selection method, device, electronic equipment and medium
Download PDF

Info

Publication number
CN116016339A
CN116016339ACN202211690426.5ACN202211690426ACN116016339ACN 116016339 ACN116016339 ACN 116016339ACN 202211690426 ACN202211690426 ACN 202211690426ACN 116016339 ACN116016339 ACN 116016339A
Authority
CN
China
Prior art keywords
address
physical address
hop gateway
gateway
hop
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211690426.5A
Other languages
Chinese (zh)
Inventor
张锋
范鸿雷
隋鹤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co LtdfiledCriticalBeijing Topsec Technology Co Ltd
Priority to CN202211690426.5ApriorityCriticalpatent/CN116016339A/en
Publication of CN116016339ApublicationCriticalpatent/CN116016339A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Landscapes

Abstract

Translated fromChinese

本申请属于通信技术领域,公开了报文路径选择的方法、装置、电子设备及介质,该方法包括,确定接收到基于请求报文返回的响应报文时,获得响应报文对应的多个下一跳网关地址;请求报文和响应报文是不同设备之间通过目标网关设备传输的报文;确定各下一跳网关地址分别对应设置的第一物理地址;获取请求报文对应的第二物理地址,第二物理地址是根据请求报文对应的上一跳网关设备确定的;根据各第一物理地址以及第二物理地址,从各下一跳网关地址中筛选出用于传输响应报文的下一跳网关设备的目标网关地址。这样,提高了报文路径选择的准确度。

Figure 202211690426

This application belongs to the field of communication technology, and discloses a method, device, electronic equipment and medium for selecting a message path. The method includes, when it is determined that a response message returned based on a request message is received, obtaining multiple downlinks corresponding to the response message. One-hop gateway address; the request message and the response message are messages transmitted between different devices through the target gateway device; determine the first physical address corresponding to each next-hop gateway address; obtain the second physical address corresponding to the request message The physical address, the second physical address is determined according to the previous hop gateway device corresponding to the request message; according to each first physical address and second physical address, the next hop gateway address is selected from each next hop gateway address for transmitting the response message The destination gateway address of the next-hop gateway device. In this way, the accuracy of message path selection is improved.

Figure 202211690426

Description

Translated fromChinese
报文路径选择的方法、装置、电子设备及介质Method, device, electronic device and medium for message path selection

技术领域technical field

本申请涉及通信技术领域,具体而言,涉及报文路径选择的方法、装置、电子设备及介质。The present application relates to the technical field of communication, and in particular, relates to a method, device, electronic equipment and medium for message path selection.

背景技术Background technique

在目标网关设备中存在多径路由的场景中,若请求报文的响应报文(即回复报文)的回复路径与该请求报文的请求路径不一致,则该响应报文通常无法到达正确的目的设备。这是由于网络环境中的安全防护设备通常会对传输报文的会话状态以及传输控制协议(TCP,Transmission Control Protocol)序列号进行检测。若传输报文的检测结果不符合预期,则会直接丢弃该传输报文,而若响应报文的回复路径与请求报文的请求路径不一致时,该响应报文通常无法通过安全防护设备的检测。In the scenario where there is multi-path routing in the target gateway device, if the reply path of the response packet (that is, the reply packet) of the request packet is inconsistent with the request path of the request packet, the response packet usually cannot reach the correct route. destination device. This is because the security protection equipment in the network environment usually detects the session state and Transmission Control Protocol (TCP, Transmission Control Protocol) sequence number of the transmitted message. If the detection result of the transmission message does not meet expectations, the transmission message will be discarded directly, and if the reply path of the response message is inconsistent with the request path of the request message, the response message usually cannot pass the detection of the security protection device .

现有技术下,通常通过链路时延以及带宽等方式进行路由的选择。但是,采用这种方式针对响应报文选择的回复路径,可能与请求路径不一致,进而导致响应报文被丢弃,报文路径选择的准确度较差。In the prior art, routing is usually selected by way of link delay and bandwidth. However, the reply path selected for the response message in this manner may not be consistent with the request path, which will cause the response message to be discarded, and the accuracy of message path selection is poor.

发明内容Contents of the invention

本申请实施例的目的在于提供报文路径选择的方法、装置、电子设备及介质,用以在进行报文路径选择时,提高报文路径选择的准确度。The purpose of the embodiments of the present application is to provide a method, device, electronic device, and medium for selecting a message path, so as to improve the accuracy of message path selection when performing message path selection.

一方面,提供一种报文路径选择的方法,应用于目标网关设备,包括:On the one hand, a method for selecting a packet path is provided, which is applied to a target gateway device, including:

确定接收到基于请求报文返回的响应报文时,获得响应报文对应的多个下一跳网关地址;请求报文和响应报文是不同设备之间通过目标网关设备传输的报文;When it is determined that a response message returned based on the request message is received, multiple next-hop gateway addresses corresponding to the response message are obtained; the request message and the response message are messages transmitted between different devices through the target gateway device;

确定各下一跳网关地址分别对应设置的第一物理地址;Determining that each next-hop gateway address corresponds to the set first physical address;

获取请求报文对应的第二物理地址,第二物理地址是根据请求报文对应的上一跳网关设备确定的;Obtaining a second physical address corresponding to the request message, where the second physical address is determined according to the previous hop gateway device corresponding to the request message;

根据各第一物理地址以及第二物理地址,从各下一跳网关地址中筛选出用于传输响应报文的下一跳网关设备的目标网关地址。According to the first physical address and the second physical address, the target gateway address of the next-hop gateway device used to transmit the response message is filtered out from the next-hop gateway addresses.

一种实施方式中,在获取请求报文对应的第二物理地址之前,方法还包括:In one embodiment, before acquiring the second physical address corresponding to the request message, the method further includes:

确定接收到请求报文时,获取发送请求报文的上一跳网关设备;When it is determined that the request message is received, obtain the last-hop gateway device that sends the request message;

获取上一跳网关设备的出接口物理地址;Obtain the physical address of the outgoing interface of the last-hop gateway device;

将出接口物理地址,确定为第二物理地址。The physical address of the outgoing interface is determined as the second physical address.

一种实施方式中,获得响应报文对应的多个下一跳网关地址,包括:In one embodiment, obtaining multiple next-hop gateway addresses corresponding to the response message includes:

获取响应报文的目的网络地址;Obtain the destination network address of the response message;

根据目的网络地址,从路由表中进行路由查询,获得目的网络地址对应的多个下一跳网关地址。According to the destination network address, a routing query is performed from the routing table to obtain multiple next-hop gateway addresses corresponding to the destination network address.

一种实施方式中,确定各下一跳网关地址分别对应设置的第一物理地址,包括:In one embodiment, determining that each next-hop gateway address corresponds to the first physical address set respectively includes:

获取地址解析协议表;Obtain the address resolution protocol table;

从地址解析协议表中,分别获得每一个下一跳网关地址对应的第一物理地址。From the address resolution protocol table, the first physical address corresponding to each next-hop gateway address is respectively obtained.

一种实施方式中,根据各第一物理地址以及第二物理地址,从各下一跳网关地址中筛选出用于传输响应报文的下一跳网关设备的目标网关地址,包括:In one embodiment, according to each first physical address and second physical address, the target gateway address of the next-hop gateway device used to transmit the response message is selected from each next-hop gateway address, including:

针对各第一物理地址中的目标跳转物理地址,将目标跳转物理地址与第二物理地址进行匹配;目标跳转物理地址为各第一物理地址中的任意一个;For the target jump physical address in each first physical address, match the target jump physical address with the second physical address; the target jump physical address is any one of the first physical addresses;

若确定匹配成功,则将目标跳转物理地址对应的下一跳网关地址,确定为目标网关地址。If it is determined that the matching is successful, the next-hop gateway address corresponding to the target jump physical address is determined as the target gateway address.

一方面,提供一种报文路径选择的装置,应用于目标网关设备,包括:On the one hand, a device for selecting a message path is provided, which is applied to a target gateway device, including:

获得单元,用于确定接收到基于请求报文返回的响应报文时,获得响应报文对应的多个下一跳网关地址;请求报文和响应报文是不同设备之间通过目标网关设备传输的报文;The obtaining unit is used to determine that when a response message returned based on the request message is received, obtain multiple next-hop gateway addresses corresponding to the response message; the request message and the response message are transmitted between different devices through the target gateway device message;

确定单元,用于确定各下一跳网关地址分别对应设置的第一物理地址;A determining unit, configured to determine the first physical address corresponding to each next-hop gateway address;

获取单元,用于获取请求报文对应的第二物理地址,第二物理地址是根据请求报文对应的上一跳网关设备确定的;An obtaining unit, configured to obtain a second physical address corresponding to the request message, where the second physical address is determined according to the last-hop gateway device corresponding to the request message;

筛选单元,用于根据各第一物理地址以及第二物理地址,从各下一跳网关地址中筛选出用于传输响应报文的下一跳网关设备的目标网关地址。The filtering unit is configured to filter out the target gateway address of the next-hop gateway device for transmitting the response message from the next-hop gateway addresses according to the first physical address and the second physical address.

一种实施方式中,获取单元还用于:In one embodiment, the acquisition unit is also used for:

确定接收到请求报文时,获取发送请求报文的上一跳网关设备;When it is determined that the request message is received, obtain the last-hop gateway device that sends the request message;

获取上一跳网关设备的出接口物理地址;Obtain the physical address of the outgoing interface of the last-hop gateway device;

将出接口物理地址,确定为第二物理地址。The physical address of the outgoing interface is determined as the second physical address.

一种实施方式中,获得单元用于:In one embodiment, the obtaining unit is used for:

获取响应报文的目的网络地址;Obtain the destination network address of the response message;

根据目的网络地址,从路由表中进行路由查询,获得目的网络地址对应的多个下一跳网关地址。According to the destination network address, a routing query is performed from the routing table to obtain multiple next-hop gateway addresses corresponding to the destination network address.

一种实施方式中,确定单元用于:In one embodiment, the determining unit is used for:

获取地址解析协议表;Obtain the address resolution protocol table;

从地址解析协议表中,分别获得每一个下一跳网关地址对应的第一物理地址。From the address resolution protocol table, the first physical address corresponding to each next-hop gateway address is respectively obtained.

一种实施方式中,筛选单元用于:In one embodiment, the screening unit is used for:

针对各第一物理地址中的目标跳转物理地址,将目标跳转物理地址与第二物理地址进行匹配;目标跳转物理地址为各第一物理地址中的任意一个;For the target jump physical address in each first physical address, match the target jump physical address with the second physical address; the target jump physical address is any one of the first physical addresses;

若确定匹配成功,则将目标跳转物理地址对应的下一跳网关地址,确定为目标网关地址。If it is determined that the matching is successful, the next-hop gateway address corresponding to the target jump physical address is determined as the target gateway address.

一方面,提供了一种电子设备,包括处理器以及存储器,存储器存储有计算机可读取指令,当计算机可读取指令由处理器执行时,运行如上述任一种报文路径选择的各种可选实现方式中提供的方法的步骤。In one aspect, an electronic device is provided, including a processor and a memory, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, various message path selection methods such as any one of the above messages are executed. Steps of a method provided in an optional implementation.

一方面,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时运行如上述任一种报文路径选择的各种可选实现方式中提供的方法的步骤。In one aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method provided in any of the above-mentioned optional implementation modes of message path selection are executed. .

一方面,提供了一种计算机程序产品,计算机程序产品在计算机上运行时,使得计算机执行如上述任一种报文路径选择的各种可选实现方式中提供的方法的步骤。In one aspect, a computer program product is provided. When the computer program product runs on a computer, the computer executes the steps of the method provided in any of the above optional implementation manners of message route selection.

本申请实施例提供的报文路径选择的方法、装置、电子设备及介质中,确定接收到基于请求报文返回的响应报文时,获得响应报文对应的多个下一跳网关地址;请求报文和响应报文是不同设备之间通过目标网关设备传输的报文;确定各下一跳网关地址分别对应设置的第一物理地址;获取请求报文对应的第二物理地址,第二物理地址是根据请求报文对应的上一跳网关设备确定的;根据各第一物理地址以及第二物理地址,从各下一跳网关地址中筛选出用于传输响应报文的下一跳网关设备的目标网关地址。这样,提高了报文路径选择的准确度。In the method, device, electronic device, and medium for message path selection provided in the embodiments of the present application, when it is determined that a response message returned based on the request message is received, multiple next-hop gateway addresses corresponding to the response message are obtained; the request The message and the response message are messages transmitted between different devices through the target gateway device; determine that each next-hop gateway address corresponds to the first physical address set; obtain the second physical address corresponding to the request message, and the second physical address The address is determined according to the last-hop gateway device corresponding to the request message; according to each first physical address and second physical address, the next-hop gateway device used to transmit the response message is selected from each next-hop gateway address The destination gateway address for . In this way, the accuracy of message path selection is improved.

本申请的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本申请而了解。本申请的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the application will be set forth in the description which follows, and, in part, will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

附图说明Description of drawings

为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the accompanying drawings that need to be used in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application, so It should not be regarded as a limitation on the scope, and those skilled in the art can also obtain other related drawings according to these drawings without creative work.

图1为本申请实施例提供的一种报文路径选择的方法的流程图;FIG. 1 is a flowchart of a method for selecting a message path provided in an embodiment of the present application;

图2为本申请实施例提供的一种报文路径选择的方法的示例的流程图;FIG. 2 is a flowchart of an example of a method for selecting a message path provided in an embodiment of the present application;

图3为本申请实施例提供的一种报文路径选择的装置的结构框图;FIG. 3 is a structural block diagram of a device for selecting a message path provided in an embodiment of the present application;

图4为本申请实施方式中一种电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device in an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all of them. The components of the embodiments of the application generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of the application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative efforts belong to the scope of protection of the present application.

应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second" and the like are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.

首先对本申请实施例中涉及的部分用语进行说明,以便于本领域技术人员理解。Firstly, some terms involved in the embodiments of the present application will be described to facilitate the understanding of those skilled in the art.

终端设备:可以是移动终端、固定终端或便携式终端,例如移动手机、站点、单元、设备、多媒体计算机、多媒体平板、互联网节点、通信器、台式计算机、膝上型计算机、笔记本计算机、上网本计算机、平板计算机、个人通信系统设备、个人导航设备、个人数字助理、音频/视频播放器、数码相机/摄像机、定位设备、电视接收器、无线电广播接收器、电子书设备、游戏设备或者其任意组合,包括这些设备的配件和外设或者其任意组合。还可预见到的是,终端设备能够支持任意类型的针对用户的接口(例如可穿戴设备)等。Terminal equipment: Can be a mobile terminal, stationary terminal or portable terminal, such as a mobile handset, station, unit, device, multimedia computer, multimedia tablet, Internet node, communicator, desktop computer, laptop computer, notebook computer, netbook computer, Tablet computers, personal communication system devices, personal navigation devices, personal digital assistants, audio/video players, digital cameras/camcorders, pointing devices, television receivers, radio broadcast receivers, e-book devices, gaming devices, or any combination thereof, Includes accessories and peripherals for these devices or any combination thereof. It is also foreseeable that the terminal device can support any type of user-oriented interface (such as a wearable device) or the like.

服务器:可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务以及大数据和人工智能平台等基础云计算服务的云服务器。Server: It can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, Cloud servers for basic cloud computing services such as middleware services, domain name services, security services, and big data and artificial intelligence platforms.

为了在进行报文路径选择时,可以提高报文路径选择的准确度,本申请实施例提供了报文路径选择的方法、装置、电子设备及介质。In order to improve the accuracy of packet path selection when performing packet path selection, the embodiments of the present application provide a packet path selection method, device, electronic equipment, and medium.

本申请实施例中,执行主体可以为包含多径路由的目标网关设备,目标网关设备可以为服务器,也可以为终端设备。In the embodiment of the present application, the execution subject may be a target gateway device including multipath routing, and the target gateway device may be a server or a terminal device.

本申请实施例可以应用于安全网关的路由设计中,一种应用场景中包括第一设备、多个中间网关设备、目标网关设备以及第二设备。目标网关设备的一个网络接口中配置了多个不同网段的互联网协议(Internet Protocol,IP)地址,并针对各IP地址,配置了相应的等价路由。The embodiments of the present application may be applied to routing design of a security gateway, and an application scenario includes a first device, multiple intermediate gateway devices, a target gateway device, and a second device. Multiple Internet Protocol (IP) addresses of different network segments are configured in a network interface of the target gateway device, and corresponding equivalent routes are configured for each IP address.

在请求报文的发送过程中,第一设备依次通过各中间网关设备中的某一中间网关设备以及目标网关设备,向第二设备发送请求报文。则在请求报文的请求路径中,上述某一中间网关设备为目标网关设备的上一跳网关设备。In the process of sending the request message, the first device sends the request message to the second device sequentially through a certain intermediate gateway device and the target gateway device among the intermediate gateway devices. Then, in the request path of the request message, one of the above-mentioned intermediate gateway devices is the last-hop gateway device of the target gateway device.

在响应报文的返回过程中,第二设备将响应报文发送至目标网关设备,若目标网关设备确定存在多径路由,则采用本申请实施例提供的报文路径选择的方法,基于上述上一跳网关设备的物理地址,确定下一跳网关设备的目标网关地址,并基于该目标网关地址,将响应报文发送给第一设备。In the process of returning the response message, the second device sends the response message to the target gateway device. If the target gateway device determines that there is a multi-path route, the method for selecting the message path provided by the embodiment of the present application is adopted, based on the above The physical address of the one-hop gateway device determines the target gateway address of the next-hop gateway device, and sends the response message to the first device based on the target gateway address.

下面结合图1对上述报文路径选择的方法的具体实施流程进行说明。参阅图1所示,为本申请实施例提供的一种报文路径选择的方法的流程图,该方法的具体实施流程如下:The specific implementation process of the method for selecting the packet path above will be described below with reference to FIG. 1 . Referring to Fig. 1, it is a flow chart of a method for message path selection provided by the embodiment of the present application, and the specific implementation process of the method is as follows:

步骤100:确定接收到基于请求报文返回的响应报文时,获得响应报文对应的多个下一跳网关地址;请求报文和响应报文是不同设备之间通过目标网关设备传输的报文;步骤101:确定各下一跳网关地址分别对应设置的第一物理地址;步骤102:获取请求报文对应的第二物理地址,第二物理地址是根据请求报文对应的上一跳网关设备确定的;步骤103:根据各第一物理地址以及第二物理地址,从各下一跳网关地址中筛选出用于传输响应报文的下一跳网关设备的目标网关地址。Step 100: When it is determined that the response message returned based on the request message is received, multiple next-hop gateway addresses corresponding to the response message are obtained; the request message and the response message are messages transmitted between different devices through the target gateway device Text; Step 101: Determine the first physical address corresponding to each next-hop gateway address; Step 102: Obtain the second physical address corresponding to the request message, and the second physical address is based on the previous hop gateway corresponding to the request message Determined by the device; Step 103: According to the first physical address and the second physical address, filter out the target gateway address of the next-hop gateway device for transmitting the response message from the next-hop gateway addresses.

其中,物理地址可以为物理地址(Media Access Control Address,MAC),第一物理地址可以为第一MAC,第二物理地址可以为第二MAC。需要说明的是,物理地址用于在网络中唯一标识一个设备,在网络中具有唯一性。Wherein, the physical address may be a physical address (Media Access Control Address, MAC), the first physical address may be the first MAC, and the second physical address may be the second MAC. It should be noted that the physical address is used to uniquely identify a device in the network and is unique in the network.

为确定响应报文的返回路径是否与请求报文的请求路径一致,则可以在接收到请求报文时,先获取请求报文的第二物理地址,以确定传输该请求报文至目标网关设备的上一个网路设备,进而确定请求路径。In order to determine whether the return path of the response message is consistent with the request path of the request message, the second physical address of the request message can be obtained first when the request message is received, so as to determine whether to transmit the request message to the target gateway device The last network device in the network, and then determine the request path.

一种实施方式中,确定请求报文的第二物理地址时,可以采用以下步骤:确定接收到请求报文时,获取发送请求报文的上一跳网关设备;获取上一跳网关设备的出接口物理地址;将出接口物理地址,确定为第二物理地址。In one embodiment, when determining the second physical address of the request message, the following steps may be used: when determining that the request message is received, obtain the last-hop gateway device that sent the request message; obtain the outgoing address of the last-hop gateway device The physical address of the interface; the physical address of the outbound interface is determined as the second physical address.

作为一个示例,第一设备将请求报文发送至第二设备的过程中,第一设备先将请求报文发送至网关设备A(即目标网关设备的上一跳网关设备)。然后,网关设备A将接收的请求报文转发至目标网关设备。目标网关设备接收到该请求报文后,记录发送该请求报文的网关设备A的出接口物理地址,并将其确定为第二物理地址,以及,将请求报文转发至第二设备。As an example, when the first device sends the request packet to the second device, the first device first sends the request packet to gateway device A (that is, the last-hop gateway device of the target gateway device). Then, gateway device A forwards the received request message to the target gateway device. After receiving the request message, the target gateway device records the outgoing interface physical address of the gateway device A sending the request message, determines it as the second physical address, and forwards the request message to the second device.

进一步的,目标网关设备可以先通过内置的路由模块,检测是否存在多径路由,若是,则主动请求获取多径路由对应的地址解析协议(Address Resolution Protocol,ARP)表,即提前获取目标网关设备的ARP。Further, the target gateway device can first detect whether there is a multi-path route through the built-in routing module, and if so, actively request to obtain the Address Resolution Protocol (Address Resolution Protocol, ARP) table corresponding to the multi-path route, that is, obtain the target gateway device in advance the ARP.

在多径路由的场景中,目标网关设备中同时存在多条等价路由,进而可以在接收到响应报文时,确定多个下一跳网关地址。为确定各下一跳网关地址,步骤100的实现过程可以包括:In the scenario of multi-path routing, multiple equal-cost routes exist in the target gateway device at the same time, and then multiple next-hop gateway addresses can be determined when receiving the response message. In order to determine each next-hop gateway address, the implementation process ofstep 100 may include:

S1001:确定接收到响应报文时,获取响应报文的目的网络地址。S1001: Obtain the destination network address of the response message when it is determined that the response message is received.

具体的,目的网络地址为响应报文被发送的目标设备的网络地址。可选的,网络地址为IP地址。Specifically, the destination network address is the network address of the target device to which the response message is sent. Optionally, the network address is an IP address.

例如,第一设备将响应报文发送至第二设备的过程中,获取响应报文的目的网络地址,即第二设备的网络地址。For example, in the process of sending the response packet to the second device, the first device acquires the destination network address of the response packet, that is, the network address of the second device.

S1002:根据目的网络地址,从路由表中进行路由查询,获得目的网络地址对应的多个下一跳网关地址。进一步的,若确定不存在目的网络地址对应的下一跳网关地址,则表示该响应报文没有对应的路由进行转发,需要对其进行丢包处理,并结束该报文路径选择的流程。S1002: Perform routing query from the routing table according to the destination network address, and obtain multiple next-hop gateway addresses corresponding to the destination network address. Further, if it is determined that there is no next-hop gateway address corresponding to the destination network address, it means that the response message has no corresponding route for forwarding, and it needs to be discarded, and the message path selection process is ended.

具体的,下一跳网关地址为下一跳网关设备的网关IP地址。Specifically, the next-hop gateway address is the gateway IP address of the next-hop gateway device.

需要说明的是,每一网关地址均对应设置有物理地址。为确定下一跳网关地址对应的第一物理地址,步骤101的实现过程可以包括:It should be noted that each gateway address is correspondingly provided with a physical address. In order to determine the first physical address corresponding to the next-hop gateway address, the implementation process ofstep 101 may include:

获取地址映射关系,并根据该地址映射关系,获取各下一跳网关地址分别对应的第一物理地址。The address mapping relationship is obtained, and according to the address mapping relationship, the first physical addresses respectively corresponding to the next-hop gateway addresses are obtained.

其中,地址映射关系为网关地址与物理地址之间的对应关系。可选的,地址映射关系可以为地址解析协议(Address Resolution Protocol,ARP)表。Wherein, the address mapping relationship is a corresponding relationship between a gateway address and a physical address. Optionally, the address mapping relationship may be an Address Resolution Protocol (Address Resolution Protocol, ARP) table.

进一步的,若确定未获取到某一下一跳网关地址对应的第一物理地址,则舍弃该下一跳网关地址。Further, if it is determined that the first physical address corresponding to a certain next-hop gateway address has not been obtained, the next-hop gateway address is discarded.

作为一个示例,获取存储的ARP表;从ARP表中,分别获得每一个下一跳网关地址对应的第一MAC。As an example, the stored ARP table is obtained; from the ARP table, the first MAC corresponding to each next-hop gateway address is respectively obtained.

为获取与请求路径一致的返回路径,则需要准确地确定返回的下一跳网关设备的目标网关地址,为确定目标网关地址,步骤103的实现过程可以包括:In order to obtain a return path consistent with the request path, it is necessary to accurately determine the target gateway address of the returned next-hop gateway device. In order to determine the target gateway address, the implementation process ofstep 103 may include:

S1031:针对各第一物理地址中的目标跳转物理地址,将目标跳转物理地址与第二物理地址进行匹配;目标跳转物理地址为各第一物理地址中的任意一个。S1031: For the target jump physical address in each first physical address, match the target jump physical address with the second physical address; the target jump physical address is any one of the first physical addresses.

一种实施方式中,将目标跳转物理地址中的各字符,按照由前到后的顺序,依次与第二物理地址中的相应字符进行比较,若确定存在不一致的字符,则确定两者不匹配,停止针对目标跳转物理地址的地址匹配流程,若确定两者完全一致,则确定两者匹配。In one embodiment, the characters in the physical address of the target jump are compared with the corresponding characters in the second physical address in sequence from front to back, and if it is determined that there are inconsistent characters, it is determined that the two are not consistent. Matching, stop the address matching process for the physical address of the target jump, and if it is determined that the two are completely consistent, then it is determined that the two match.

S1032:若确定匹配成功,则将目标跳转物理地址对应的下一跳网关地址,确定为目标网关地址。S1032: If it is determined that the matching is successful, determine the next-hop gateway address corresponding to the target jump physical address as the target gateway address.

一种实施方式中,由于各第一物理地址中通常仅存在一个与第二物理地址匹配的第一物理地址,因此,若确定匹配成功,则说明目标跳转物理地址对应的下一跳网关设备为正确的返回路径的网关设备,并确定目标网关地址为目标跳转物理地址对应的下一跳网关地址,并停止匹配流程。若确定匹配失败,则说明目标跳转物理地址对应的下一跳网关设备不为正确的返回路径的网关设备,需要判断下一个第一物理地址对应的下一跳网关设备是否为正确的返回路径的网关设备,并执行S1031-S1032,直至确定匹配成功。In one embodiment, since there is usually only one first physical address that matches the second physical address in each first physical address, if it is determined that the match is successful, it indicates that the next-hop gateway device corresponding to the target jump physical address It is the gateway device of the correct return path, and the target gateway address is determined to be the next-hop gateway address corresponding to the target jump physical address, and the matching process is stopped. If it is determined that the matching fails, it means that the next-hop gateway device corresponding to the target jump physical address is not the correct return path gateway device, and it is necessary to determine whether the next-hop gateway device corresponding to the next first physical address is the correct return path gateway device, and execute S1031-S1032 until it is determined that the matching is successful.

本申请实施例中,可以通过物理地址匹配的方式,在多径路由场景中,选取正确的返回路径的目标网关地址,提高了报文路径选择的准确性,以及在路由选择的过程中,通过ARP表进行路由选择的矫正,进一步的提高了报文路径的准确性。In the embodiment of the present application, in a multi-path routing scenario, the correct target gateway address of the return path can be selected by means of physical address matching, which improves the accuracy of message path selection, and in the routing process, through The ARP table corrects the route selection, further improving the accuracy of the message path.

下面结合图2对上述报文路径选择的方法的具体实施流程进行示例说明。参阅图2所示,为本申请实施例提供的一种报文路径选择的方法的示例的流程图,该方法的具体实施流程如下:The specific implementation process of the method for selecting a packet path above will be illustrated below with reference to FIG. 2 . Referring to FIG. 2, it is a flow chart of an example of a method for selecting a message path provided by an embodiment of the present application. The specific implementation process of the method is as follows:

步骤200:确定接收到响应报文时,获取响应报文的目的网络地址。Step 200: Obtain the destination network address of the response message when it is determined that the response message is received.

步骤201:从路由表中查询目的网络地址对应的下一跳网关地址。Step 201: Query the next-hop gateway address corresponding to the destination network address from the routing table.

步骤202:根据查询结果,判断是否存在下一跳网关地址,若是,则执行步骤203,否则,执行步骤208。Step 202: According to the query result, determine whether there is a next-hop gateway address, if yes, executestep 203, otherwise, executestep 208.

步骤203:通过存储的ARP表,查询某一下一跳网关地址对应的第一物理地址。Step 203: Query the first physical address corresponding to a certain next-hop gateway address through the stored ARP table.

步骤204:根据查询结果,判断是否查询获得第一物理地址,若是,则执行步骤205,否则,执行步骤200。Step 204: According to the query result, determine whether the first physical address is obtained through query, if yes, performstep 205, otherwise, performstep 200.

步骤205:获取获取请求报文对应的上一跳网关设备的第二物理地址。Step 205: Obtain the second physical address of the last-hop gateway device corresponding to the acquisition request message.

步骤206:判断第一物理地址与第二物理地址是否一致,若是,则执行步骤207,否则,执行步骤200。Step 206: Determine whether the first physical address is consistent with the second physical address, if yes, performstep 207, otherwise, performstep 200.

步骤207:将第一物理地址对应的下一跳网关地址,确定为目标网关地址,并通过该目标网关地址转发响应报文。Step 207: Determine the next-hop gateway address corresponding to the first physical address as the target gateway address, and forward the response message through the target gateway address.

步骤208:结束该次报文路径选择流程。Step 208: End the message path selection process.

基于同一发明构思,本申请实施例中还提供了一种报文路径选择的装置,由于上述装置及设备解决问题的原理与一种报文路径选择的方法相似,因此,上述装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present application also provides a device for selecting a message path. Since the problem-solving principle of the above-mentioned device and equipment is similar to a method for selecting a message path, the implementation of the above-mentioned device can be found in The implementation of the method will not be described repeatedly.

如图3所示,其为本申请实施例提供的一种报文路径选择的装置的结构框图,包括:As shown in Figure 3, it is a structural block diagram of a device for selecting a message path provided in the embodiment of the present application, including:

获得单元301,用于确定接收到基于请求报文返回的响应报文时,获得响应报文对应的多个下一跳网关地址;请求报文和响应报文是不同设备之间通过目标网关设备传输的报文;The obtainingunit 301 is configured to determine that when a response message returned based on the request message is received, obtain multiple next-hop gateway addresses corresponding to the response message; the request message and the response message are passed between different devices through the target gateway device transmitted messages;

确定单元302,用于确定各下一跳网关地址分别对应设置的第一物理地址;Adetermination unit 302, configured to determine the first physical address corresponding to each next-hop gateway address;

获取单元303,用于获取请求报文对应的第二物理地址,第二物理地址是根据请求报文对应的上一跳网关设备确定的;An obtainingunit 303, configured to obtain a second physical address corresponding to the request message, where the second physical address is determined according to the last-hop gateway device corresponding to the request message;

筛选单元304,用于根据各第一物理地址以及第二物理地址,从各下一跳网关地址中筛选出用于传输响应报文的下一跳网关设备的目标网关地址。Thefiltering unit 304 is configured to filter out the target gateway address of the next-hop gateway device for transmitting the response message from the next-hop gateway addresses according to the first physical address and the second physical address.

一种实施方式中,获取单元303还用于:In one implementation manner, the obtainingunit 303 is also used to:

确定接收到请求报文时,获取发送请求报文的上一跳网关设备;When it is determined that the request message is received, obtain the last-hop gateway device that sends the request message;

获取上一跳网关设备的出接口物理地址;Obtain the physical address of the outgoing interface of the last-hop gateway device;

将出接口物理地址,确定为第二物理地址。The physical address of the outgoing interface is determined as the second physical address.

一种实施方式中,获得单元301用于:In one embodiment, the obtainingunit 301 is used to:

获取响应报文的目的网络地址;Obtain the destination network address of the response message;

根据目的网络地址,从路由表中进行路由查询,获得目的网络地址对应的多个下一跳网关地址。According to the destination network address, a routing query is performed from the routing table to obtain multiple next-hop gateway addresses corresponding to the destination network address.

一种实施方式中,确定单元302用于:In one implementation manner, the determiningunit 302 is used to:

获取地址解析协议表;Obtain the address resolution protocol table;

从地址解析协议表中,分别获得每一个下一跳网关地址对应的第一物理地址。From the address resolution protocol table, the first physical address corresponding to each next-hop gateway address is respectively obtained.

一种实施方式中,筛选单元304用于:In one embodiment, thescreening unit 304 is used for:

针对各第一物理地址中的目标跳转物理地址,将目标跳转物理地址与第二物理地址进行匹配;目标跳转物理地址为各第一物理地址中的任意一个;For the target jump physical address in each first physical address, match the target jump physical address with the second physical address; the target jump physical address is any one of the first physical addresses;

若确定匹配成功,则将目标跳转物理地址对应的下一跳网关地址,确定为目标网关地址。If it is determined that the matching is successful, the next-hop gateway address corresponding to the target jump physical address is determined as the target gateway address.

本申请实施例提供的报文路径选择的方法、装置、电子设备及介质中,确定接收到基于请求报文返回的响应报文时,获得响应报文对应的多个下一跳网关地址;请求报文和响应报文是不同设备之间通过目标网关设备传输的报文;确定各下一跳网关地址分别对应设置的第一物理地址;获取请求报文对应的第二物理地址,第二物理地址是根据请求报文对应的上一跳网关设备确定的;根据各第一物理地址以及第二物理地址,从各下一跳网关地址中筛选出用于传输响应报文的下一跳网关设备的目标网关地址。这样,提高了报文路径选择的准确度。In the method, device, electronic device, and medium for message path selection provided in the embodiments of the present application, when it is determined that a response message returned based on the request message is received, multiple next-hop gateway addresses corresponding to the response message are obtained; the request The message and the response message are messages transmitted between different devices through the target gateway device; determine that each next-hop gateway address corresponds to the first physical address set; obtain the second physical address corresponding to the request message, and the second physical address The address is determined according to the last-hop gateway device corresponding to the request message; according to each first physical address and second physical address, the next-hop gateway device used to transmit the response message is selected from each next-hop gateway address The destination gateway address for . In this way, the accuracy of message path selection is improved.

图4示出了一种电子设备4000的结构示意图。参阅图4所示,电子设备4000包括:处理器4010以及存储器4020,可选的,还可以包括电源4030、显示单元4040、输入单元4050。FIG. 4 shows a schematic structural diagram of anelectronic device 4000 . Referring to FIG. 4 , theelectronic device 4000 includes: aprocessor 4010 and amemory 4020 , and optionally, apower supply 4030 , adisplay unit 4040 , and aninput unit 4050 .

处理器4010是电子设备4000的控制中心,利用各种接口和线路连接各个部件,通过运行或执行存储在存储器4020内的软件程序和/或数据,执行电子设备4000的各种功能,从而对电子设备4000进行整体监控。Theprocessor 4010 is the control center of theelectronic device 4000. It uses various interfaces and lines to connect various components, and executes various functions of theelectronic device 4000 by running or executing software programs and/or data stored in thememory 4020. Thedevice 4000 performs overall monitoring.

本申请实施例中,处理器4010调用存储器4020中存储的计算机程序时执行上述实施例中的各个步骤。In the embodiment of the present application, when theprocessor 4010 invokes the computer program stored in thememory 4020, various steps in the foregoing embodiments are executed.

可选的,处理器4010可包括一个或多个处理单元;优选的,处理器4010可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器4010中。在一些实施例中,处理器、存储器、可以在单一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。Optionally, theprocessor 4010 may include one or more processing units; preferably, theprocessor 4010 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, applications, etc., The modem processor primarily handles wireless communications. It can be understood that the foregoing modem processor may not be integrated into theprocessor 4010 . In some embodiments, the processor and memory can be implemented on a single chip, and in some embodiments, they can also be implemented on independent chips.

存储器4020可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、各种应用等;存储数据区可存储根据电子设备4000的使用所创建的数据等。此外,存储器4020可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件等。Thememory 4020 can mainly include a program storage area and a data storage area, wherein the program storage area can store operating systems, various applications, etc.; the data storage area can store data created according to the use of theelectronic device 4000 , etc. In addition, thememory 4020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.

电子设备4000还包括给各个部件供电的电源4030(比如电池),电源可以通过电源管理系统与处理器4010逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。Theelectronic device 4000 also includes a power supply 4030 (such as a battery) for supplying power to various components. The power supply can be logically connected to theprocessor 4010 through the power management system, so that functions such as charging, discharging, and power consumption can be managed through the power management system.

显示单元4040可用于显示由用户输入的信息或提供给用户的信息以及电子设备4000的各种菜单等,本发明实施例中主要用于显示电子设备4000中各应用的显示界面以及显示界面中显示的文本、图片等对象。显示单元4040可以包括显示面板4041。显示面板4041可以采用液晶显示屏(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置。Thedisplay unit 4040 can be used to display information input by the user or provided to the user and various menus of theelectronic device 4000, etc., and in the embodiment of the present invention, it is mainly used to display the display interface of each application in theelectronic device 4000 and the display interface. Objects such as text and pictures. Thedisplay unit 4040 may include adisplay panel 4041 . Thedisplay panel 4041 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), and the like.

输入单元4050可用于接收用户输入的数字或字符等信息。输入单元4050可包括触控面板4051以及其他输入设备4052。其中,触控面板4051,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触摸笔等任何适合的物体或附件在触控面板4051上或在触控面板4051附近的操作)。Theinput unit 4050 can be used to receive information such as numbers or characters input by the user. Theinput unit 4050 may include atouch panel 4051 andother input devices 4052 . Wherein, thetouch panel 4051, also referred to as a touch screen, can collect touch operations of the user on or near it (for example, the user uses any suitable object or accessory such as a finger, a touch pen, etc. on thetouch panel 4051 or on thetouch panel 4051 nearby operations).

具体的,触控面板4051可以检测用户的触摸操作,并检测触摸操作带来的信号,将这些信号转换成触点坐标,发送给处理器4010,并接收处理器4010发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板4051。其他输入设备4052可以包括但不限于物理键盘、功能键(比如音量控制按键、开关机按键等)、轨迹球、鼠标、操作杆等中的一种或多种。Specifically, thetouch panel 4051 can detect the user's touch operation, detect the signals brought by the touch operation, convert these signals into contact coordinates, send them to theprocessor 4010, and receive and execute the commands sent by theprocessor 4010 . In addition, thetouch panel 4051 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave.Other input devices 4052 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control buttons, power-on/off buttons, etc.), trackballs, mice, joysticks, and the like.

当然,触控面板4051可覆盖显示面板4041,当触控面板4051检测到在其上或附近的触摸操作后,传送给处理器4010以确定触摸事件的类型,随后处理器4010根据触摸事件的类型在显示面板4041上提供相应的视觉输出。虽然在图4中,触控面板4051与显示面板4041是作为两个独立的部件来实现电子设备4000的输入和输出功能,但是在某些实施例中,可以将触控面板4051与显示面板4041集成而实现电子设备4000的输入和输出功能。Of course, thetouch panel 4051 can cover thedisplay panel 4041. When thetouch panel 4051 detects a touch operation on or near it, it sends it to theprocessor 4010 to determine the type of the touch event. A corresponding visual output is provided on thedisplay panel 4041 . Although in FIG. 4, thetouch panel 4051 and thedisplay panel 4041 are used as two independent components to realize the input and output functions of theelectronic device 4000, but in some embodiments, thetouch panel 4051 and thedisplay panel 4041 can be The input and output functions of theelectronic device 4000 are realized by integration.

电子设备4000还可包括一个或多个传感器,例如压力传感器、重力加速度传感器、接近光传感器等。当然,根据具体应用中的需要,上述电子设备4000还可以包括摄像头等其它部件,由于这些部件不是本申请实施例中重点使用的部件,因此,在图4中没有示出,且不再详述。Theelectronic device 4000 may also include one or more sensors, such as a pressure sensor, an acceleration of gravity sensor, a proximity light sensor, and the like. Of course, according to the needs of specific applications, the above-mentionedelectronic device 4000 may also include other components such as a camera. Since these components are not the key components used in the embodiment of this application, they are not shown in FIG. 4 and will not be described in detail .

本领域技术人员可以理解,图4仅仅是电子设备的举例,并不构成对电子设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件。Those skilled in the art can understand that FIG. 4 is only an example of the electronic device, and does not constitute a limitation to the electronic device. It may include more or less components than those shown in the figure, or combine certain components, or different components.

本申请实施例中,一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时,使得通信设备可以执行上述实施例中的各个步骤。In the embodiment of the present application, a computer-readable storage medium stores a computer program on it, and when the computer program is executed by a processor, the communication device can execute the steps in the foregoing embodiments.

为了描述的方便,以上各部分按照功能划分为各模块(或单元)分别描述。当然,在实施本申请时可以把各模块(或单元)的功能在同一个或多个软件或硬件中实现。For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, the functions of each module (or unit) can be implemented in one or more pieces of software or hardware when implementing the present application.

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While preferred embodiments of the present application have been described, additional changes and modifications to these embodiments can be made by those skilled in the art once the basic inventive concept is appreciated. Therefore, the appended claims are intended to be construed to cover the preferred embodiment and all changes and modifications which fall within the scope of the application.

显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the application without departing from the spirit and scope of the application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims (12)

Translated fromChinese
1.一种报文路径选择的方法,其特征在于,应用于目标网关设备,包括:1. A method for message path selection, characterized in that it is applied to a target gateway device, comprising:确定接收到基于请求报文返回的响应报文时,获得所述响应报文对应的多个下一跳网关地址;所述请求报文和所述响应报文是不同设备之间通过所述目标网关设备传输的报文;When it is determined that a response message returned based on the request message is received, multiple next-hop gateway addresses corresponding to the response message are obtained; the request message and the response message are between different devices through the target Messages transmitted by the gateway device;确定各下一跳网关地址分别对应设置的第一物理地址;Determining that each next-hop gateway address corresponds to the set first physical address;获取所述请求报文对应的第二物理地址,所述第二物理地址是根据所述请求报文对应的上一跳网关设备确定的;Obtain a second physical address corresponding to the request message, where the second physical address is determined according to the last-hop gateway device corresponding to the request message;根据各第一物理地址以及所述第二物理地址,从各下一跳网关地址中筛选出用于传输所述响应报文的下一跳网关设备的目标网关地址。According to each first physical address and the second physical address, the target gateway address of the next-hop gateway device used to transmit the response message is filtered out from each next-hop gateway address.2.如权利要求1所述的方法,其特征在于,在获取所述请求报文对应的第二物理地址之前,所述方法还包括:2. The method according to claim 1, wherein, before obtaining the second physical address corresponding to the request message, the method further comprises:确定接收到所述请求报文时,获取发送所述请求报文的上一跳网关设备;When it is determined that the request message is received, obtain the last-hop gateway device that sends the request message;获取所述上一跳网关设备的出接口物理地址;Obtain the physical address of the outgoing interface of the last-hop gateway device;将所述出接口物理地址,确定为所述第二物理地址。Determine the physical address of the outbound interface as the second physical address.3.如权利要求1或2所述的方法,其特征在于,所述获得所述响应报文对应的多个下一跳网关地址,包括:3. The method according to claim 1 or 2, wherein said obtaining a plurality of next-hop gateway addresses corresponding to said response message comprises:获取所述响应报文的目的网络地址;Obtain the destination network address of the response message;根据所述目的网络地址,从路由表中进行路由查询,获得所述目的网络地址对应的多个下一跳网关地址。According to the destination network address, a routing query is performed from the routing table to obtain multiple next-hop gateway addresses corresponding to the destination network address.4.如权利要求1或2所述的方法,其特征在于,所述确定各下一跳网关地址分别对应设置的第一物理地址,包括:4. The method according to claim 1 or 2, wherein said determining that each next-hop gateway address corresponds to the first physical address set respectively includes:获取地址解析协议表;Obtain the address resolution protocol table;从所述地址解析协议表中,分别获得每一个下一跳网关地址对应的第一物理地址。The first physical address corresponding to each next-hop gateway address is respectively obtained from the address resolution protocol table.5.如权利要求1或2所述的方法,其特征在于,所述根据各第一物理地址以及所述第二物理地址,从各下一跳网关地址中筛选出用于传输所述响应报文的下一跳网关设备的目标网关地址,包括:5. The method according to claim 1 or 2, wherein, according to the first physical address and the second physical address, the next-hop gateway addresses are selected for transmitting the response message. The target gateway address of the next-hop gateway device in the document, including:针对各第一物理地址中的目标跳转物理地址,将所述目标跳转物理地址与所述第二物理地址进行匹配;所述目标跳转物理地址为各第一物理地址中的任意一个;For the target jump physical address in each first physical address, match the target jump physical address with the second physical address; the target jump physical address is any one of the first physical addresses;若确定匹配成功,则将所述目标跳转物理地址对应的下一跳网关地址,确定为所述目标网关地址。If it is determined that the matching is successful, the next-hop gateway address corresponding to the target jump physical address is determined as the target gateway address.6.一种报文路径选择的装置,其特征在于,应用于目标网关设备,包括:6. A device for message path selection, characterized in that it is applied to a target gateway device, comprising:获得单元,用于确定接收到基于请求报文返回的响应报文时,获得所述响应报文对应的多个下一跳网关地址;所述请求报文和所述响应报文是不同设备之间通过所述目标网关设备传输的报文;An obtaining unit, configured to obtain a plurality of next-hop gateway addresses corresponding to the response message when receiving a response message returned based on the request message; the request message and the response message are between different devices messages transmitted through the target gateway device;确定单元,用于确定各下一跳网关地址分别对应设置的第一物理地址;A determining unit, configured to determine the first physical address corresponding to each next-hop gateway address;获取单元,用于获取所述请求报文对应的第二物理地址,所述第二物理地址是根据所述请求报文对应的上一跳网关设备确定的;An obtaining unit, configured to obtain a second physical address corresponding to the request message, where the second physical address is determined according to the last-hop gateway device corresponding to the request message;筛选单元,用于根据各第一物理地址以及所述第二物理地址,从各下一跳网关地址中筛选出用于传输所述响应报文的下一跳网关设备的目标网关地址。The filtering unit is configured to filter out the target gateway address of the next-hop gateway device for transmitting the response message from the next-hop gateway addresses according to the first physical addresses and the second physical addresses.7.如权利要求6所述的装置,其特征在于,所述获取单元还用于:7. The device according to claim 6, wherein the acquiring unit is further used for:确定接收到所述请求报文时,获取发送所述请求报文的上一跳网关设备;When it is determined that the request message is received, obtain the last-hop gateway device that sends the request message;获取所述上一跳网关设备的出接口物理地址;Obtain the physical address of the outgoing interface of the last-hop gateway device;将所述出接口物理地址,确定为所述第二物理地址。Determine the physical address of the outbound interface as the second physical address.8.如权利要求6或7所述的装置,其特征在于,所述获得单元用于:8. The device according to claim 6 or 7, wherein the obtaining unit is used for:获取所述响应报文的目的网络地址;Obtain the destination network address of the response message;根据所述目的网络地址,从路由表中进行路由查询,获得所述目的网络地址对应的多个下一跳网关地址。According to the destination network address, a routing query is performed from the routing table to obtain multiple next-hop gateway addresses corresponding to the destination network address.9.如权利要求6或7所述的装置,其特征在于,所述确定单元用于:9. The device according to claim 6 or 7, wherein the determining unit is used for:获取地址解析协议表;Obtain the address resolution protocol table;从所述地址解析协议表中,分别获得每一个下一跳网关地址对应的第一物理地址。The first physical address corresponding to each next-hop gateway address is respectively obtained from the address resolution protocol table.10.如权利要求6或7所述的装置,其特征在于,所述筛选单元用于:10. The device according to claim 6 or 7, wherein the screening unit is used for:针对各第一物理地址中的目标跳转物理地址,将所述目标跳转物理地址与所述第二物理地址进行匹配;所述目标跳转物理地址为各第一物理地址中的任意一个;For the target jump physical address in each first physical address, match the target jump physical address with the second physical address; the target jump physical address is any one of the first physical addresses;若确定匹配成功,则将所述目标跳转物理地址对应的下一跳网关地址,确定为所述目标网关地址。If it is determined that the matching is successful, the next-hop gateway address corresponding to the target jump physical address is determined as the target gateway address.11.一种电子设备,其特征在于,包括处理器以及存储器,所述存储器存储有计算机可读取指令,当所述计算机可读取指令由所述处理器执行时,运行如权利要求1-5任一所述方法。11. An electronic device, characterized in that it includes a processor and a memory, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the operation as claimed in claim 1- 5 Any of the methods described.12.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时运行如权利要求1-5任一所述方法。12. A computer-readable storage medium, on which a computer program is stored, wherein the computer program executes the method according to any one of claims 1-5 when executed by a processor.
CN202211690426.5A2022-12-272022-12-27Message path selection method, device, electronic equipment and mediumPendingCN116016339A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202211690426.5ACN116016339A (en)2022-12-272022-12-27Message path selection method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202211690426.5ACN116016339A (en)2022-12-272022-12-27Message path selection method, device, electronic equipment and medium

Publications (1)

Publication NumberPublication Date
CN116016339Atrue CN116016339A (en)2023-04-25

Family

ID=86032988

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202211690426.5APendingCN116016339A (en)2022-12-272022-12-27Message path selection method, device, electronic equipment and medium

Country Status (1)

CountryLink
CN (1)CN116016339A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107580079A (en)*2017-08-312018-01-12新华三技术有限公司A kind of message transmitting method and device
CN108512714A (en)*2017-02-282018-09-07华为技术有限公司A kind of message transmitting method, relevant device and system
CN111953804A (en)*2020-07-092020-11-17北京字节跳动网络技术有限公司Network data transmission method, device, medium and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108512714A (en)*2017-02-282018-09-07华为技术有限公司A kind of message transmitting method, relevant device and system
CN107580079A (en)*2017-08-312018-01-12新华三技术有限公司A kind of message transmitting method and device
CN111953804A (en)*2020-07-092020-11-17北京字节跳动网络技术有限公司Network data transmission method, device, medium and electronic equipment

Similar Documents

PublicationPublication DateTitle
US11388220B2 (en)Image distribution method and apparatus, and image obtaining method and apparatus
US10958459B2 (en)Method and apparatus for processing group chat message
US11343233B2 (en)Node control method and related apparatus in distributed system
CN104639672B (en)The method and apparatus for carrying out domain name mapping
US10225356B2 (en)Method and terminal for receiving push information, storage medium
EP3179693B1 (en)Method, apparatus, storage medium and computer program product for establishing a data connection
WO2014206276A1 (en)Domain name resolution method, domain name server, and domain name access method, system and terminal
CN106708554B (en)Program operating method and device
WO2022017107A1 (en)Information processing method and apparatus, computer device and storage medium
CN104142868A (en)Connection establishment method and device
CN106603345B (en)Monitor method, apparatus and terminal that application program uses flow
WO2014183439A1 (en)Method, apparatus and system for switching function mode
US10158896B2 (en)Video channel allocation management method and related device, and communication system
CN105681370B (en)File synchronisation method, server and client
WO2017032211A1 (en)Replacement method, device and apparatus using resource to replace target item
US20140344423A1 (en)Method, apparatus and system for switching function mode
CN116016339A (en)Message path selection method, device, electronic equipment and medium
CN106357522B (en)Data sharing method and device
JP6806410B2 (en) Methods and devices for transferring content between different application programs
CN115913782A (en) Method, device, electronic equipment and medium for message filtering configuration
CN111294275B (en)User information indexing method, device, server and storage medium of IM tool
CN103561119B (en)Obtain method, device and the equipment of Media Access Control address
CN106487649A (en) Group message prompt control method and terminal device
CN109471708B (en)Task processing method, device and system
CN107105312A (en)It is a kind of enter row information displaying method, apparatus and system

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp