A message forwarding method and device, electronic equipment and medium
Patent Information
- Application Number
- CN202180004368.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2041-12-31
AI Technical Summary
然而,终端可能会发生移动,随着终端的移动,最适合为终端服务的服务器会发生变化,而终端依然会基于缓存的URL与IP地址的对应关系,向该IP地址对应的服务器发送访问请求,导致终端的访问时延较高
[0038]采用上述技术方案,目的IP地址的主机地址段用于表示第一请求报文所请求的服务标识,当接收到第一请求报文后,如果本地服务标识列表中存在与上述主机地址段相同的服务标识,则说明本地服务器能够提供第一请求报文所请求的服务,进而向本地服务器转发第一请求报文。也就是说,无论第一请求报文的目的地址是否为本地服务器的IP地址,只要第一请求报文的目的地址的主机地址段属于本地服务标识列表,就可以由本地服务器处理第一请求报文,如此,就无需继续向其他的路由器转发该第一请求报文,可以提高第一请求报文被响应的速度,降低终端的访问时延。
Smart Images

Figure CN116686273B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a message forwarding method, apparatus, electronic device and medium. Background Technology
[0002] In mobile communication networks, when a terminal needs to access a Uniform Resource Locator (URL), it needs to perform domain name resolution to obtain the destination Internet Protocol (IP) address corresponding to the URL, and then send an access request to the server corresponding to that destination IP address. With the development of technology, for some highly mobile services, a single URL can be provided by multiple servers distributed in multiple locations.
[0003] After a terminal retrieves the IP address corresponding to a URL through a Domain Name Server (DNS) server, it caches the mapping between the URL and the IP address. Subsequent access requests for that URL are sent to the server corresponding to that IP address. However, the terminal may move, and as it moves, the server best suited to serve the terminal may change. The terminal will still rely on the cached URL-IP address mapping to send access requests to the server corresponding to that IP address, resulting in higher access latency. Summary of the Invention
[0004] The purpose of this application is to provide a message forwarding method, apparatus, electronic device, and medium to reduce terminal access latency. The specific technical solution is as follows:
[0005] In a first aspect, embodiments of this application provide a message forwarding method, the method being applied to a router, the method comprising:
[0006] Receive a first request message, wherein the host address segment of the destination IP address of the first request message is used to represent the service identifier of the service requested by the first request message;
[0007] If a service identifier with the same address range as the host exists in the local service identifier list, the first request message is forwarded to the local server; wherein, the local service identifier list includes service identifiers of services that the local server cluster can provide.
[0008] If no service identifier matching the host address range exists in the local service identifier list, the first request message is forwarded to other routers based on the destination IP address of the first request message.
[0009] In one possible implementation, before receiving the first request message, the method further includes:
[0010] Obtain the mapping between the Uniform Resource Locator URLs and public IP addresses of the services that the local server cluster can provide from the name server of the local server cluster;
[0011] Extract the host address of each public IP address from the public IP addresses included in the obtained corresponding relationships;
[0012] The extracted host address is used as the service identifier to generate the local service identifier list.
[0013] In one possible implementation, the step of forwarding the first request message to the local server if a service identifier identical to the host address range exists in the local service identifier list includes:
[0014] If a service identifier with the same address range as the host exists in the local service identifier list, the destination IP address of the first request message is converted to the IP address of the load balancer to obtain a second request message, which is then sent to the local server through the load balancer.
[0015] In one possible implementation, the service identifiers included in the local service identifier list belong to a preset host address network segment, which is an IPv6 address network segment pre-approved for the mobile service, and the preset host address network segment is dedicated to the mobile service.
[0016] In one possible implementation, receiving the first request message includes:
[0017] Receive the first request message sent by the terminal; or,
[0018] Receive the first request message forwarded by the router.
[0019] Secondly, embodiments of this application provide a message forwarding apparatus, which is applied to a router, and the apparatus includes:
[0020] The receiving module is used to receive a first request message, wherein the host address segment of the destination IP address of the first request message is used to represent the service identifier of the service requested by the first request message.
[0021] The first forwarding module is configured to forward the first request message to the local server if a service identifier identical to the host address range exists in the local service identifier list; wherein, the local service identifier list includes service identifiers of services that the local server cluster can provide.
[0022] The second forwarding module is used to forward the first request message to other routers based on the destination IP address of the first request message if there is no service identifier in the local service identifier list that is the same as the host address range.
[0023] In one possible implementation, the device further includes:
[0024] The acquisition module is used to obtain the mapping between the URLs of services that the local server cluster can provide and their public IP addresses from the name server of the local server cluster;
[0025] The extraction module is used to extract the host address of each public IP address from the public IP addresses included in the obtained corresponding relationship;
[0026] The generation module is used to generate the local service identifier list by using the extracted host addresses as service identifiers.
[0027] In one possible implementation, the first forwarding module is specifically used for:
[0028] If a service identifier with the same address range as the host exists in the local service identifier list, the destination IP address of the first request message is converted to the IP address of the load balancer to obtain a second request message, which is then sent to the local server through the load balancer.
[0029] In one possible implementation, the service identifiers included in the local service identifier list belong to a preset host address network segment, which is an IPv6 address network segment pre-approved for the mobile service, and the preset host address network segment is dedicated to the mobile service.
[0030] In one possible implementation, the receiving module is specifically used for:
[0031] Receive the first request message sent by the terminal; or,
[0032] Receive the first request message forwarded by the router.
[0033] Thirdly, embodiments of this application also provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0034] Memory, used to store computer programs;
[0035] When a processor executes a program stored in memory, it implements the steps of the method described in the first aspect above.
[0036] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0037] Fifthly, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in the first aspect above.
[0038] Using the above technical solution, the host address range of the destination IP address is used to represent the service identifier requested by the first request message. Upon receiving the first request message, if a service identifier with the same host address range exists in the local service identifier list, it indicates that the local server can provide the service requested by the first request message, and thus forwards the first request message to the local server. In other words, regardless of whether the destination address of the first request message is the IP address of the local server, as long as the host address range of the destination address of the first request message belongs to the local service identifier list, the local server can process the first request message. Therefore, there is no need to forward the first request message to other routers, which can improve the response speed of the first request message and reduce the access latency of the terminal. Attached Figure Description
[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention and the prior art, the drawings used in the embodiments and the prior art are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 An architecture diagram of a computing power network system provided in this application embodiment;
[0041] Figure 2 An architecture diagram of an edge cloud provided for an embodiment of this application;
[0042] Figure 3 A flowchart of a message forwarding method provided in an embodiment of this application;
[0043] Figure 4 A flowchart illustrating another message forwarding method provided in this application embodiment;
[0044] Figure 5 A flowchart illustrating another message forwarding method provided in this application embodiment;
[0045] Figure 6 This is a schematic diagram of the structure of a message forwarding device provided in an embodiment of this application;
[0046] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0048] The technical solutions of this application can be applied to various communication systems, such as: Long Time Evolution (LTE) Time Division Duplex (TDD) systems, Universal Mobile Telecommunication System (UMTS), Worldwide Interoperability for Microwave Access (WiMAX) systems, Public Land Mobile Network (PLMN) systems, LTE systems, New Radio (NR) systems, 4.5G communication systems, 5G communication systems, and various future wireless communication systems. The network architecture and service scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided in the embodiments of this application. Those skilled in the art will understand that, with the evolution of network architecture and the emergence of new service scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0049] The embodiments of this application can be specifically applied to edge computing scenarios. Edge computing refers to an open platform that integrates network, computing, storage, and application core capabilities on the side of a communication system closer to the data source. This open platform can provide services to terminals nearby.
[0050] like Figure 1 As shown, Figure 1 This is an architecture diagram of a computing power network system provided in an embodiment of this application. The computing power network system includes a central cloud, a city cloud, and an edge cloud. Figure 1 The example shows edge cloud 1, edge cloud 2, and edge cloud 3, but the number of edge clouds in the actual implementation is not limited to these.
[0051] Communication between edge clouds, between edge clouds and city clouds, and between city clouds and central clouds all occur via routers. Each edge cloud, city cloud, and central cloud contains a server cluster. The server cluster can provide services to terminals. Service request packets from terminals are first forwarded to the edge cloud. If the edge cloud cannot process them, they are forwarded to the city cloud for processing. If the city cloud cannot process them, they are forwarded to the central cloud for processing.
[0052] Each edge cloud is connected to a router; for example, edge cloud 1 is connected to router 1, edge cloud 2 is connected to router 2, and edge cloud 3 is connected to router 3.
[0053] Routers are used to support communication between the edge cloud and the outside world. Routers are connected to the User Plane Function (UPF) unit, and the UPF is connected to the base station. For example, router 1 is connected to base station 1 via UPF, router 2 is connected to base station 2 via UPF, and router 3 is connected to base station 3 via UPF.
[0054] This base station can be a distributed base station, which includes a Remote Radio Unit (RRU) and a Base Band Unit (BBU). See [link to relevant documentation]. Figure 1 The UPF is connected to the BBU, the BBU is connected to the RRU, and the terminal device can access the edge cloud through the RRU.
[0055] The base station in this application embodiment can also be an evolved base station (NodeB or eNB or e-NodeB) in an LTE system or Long Termevolution-Advanced (LTE-A), or it can include an evolved Packet Core (EPC), the 5th Generation (5G) communication technology, a next-generation Node B (gNB) in an NR system, or a centralized unit (CU) and a distributed unit (DU) in a Cloud Radio Access Network (Cloud RAN) system. This application embodiment is not limited.
[0056] The terminal in this embodiment is a wireless terminal device. The wireless terminal device can communicate with one or more core networks (CNs) via a radio access network (RAN). The wireless terminal device can be a mobile terminal device, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal device. For example, it can be a portable, pocket-sized, handheld, computer-built-in, or vehicle-mounted mobile device, such as a mobile phone, tablet, laptop, wearable device, etc. They exchange voice and / or data with the radio access network.
[0057] like Figure 2 As shown, Figure 1 The edge cloud can include load balancing devices and local server clusters. The local server cluster includes multiple servers, each of which can provide one or more services.
[0058] The load balancer is connected to the router. After receiving the request message forwarded by the router, the load balancer can select a server from the local server cluster based on the load balancing policy and forward the request message to that server.
[0059] When a terminal needs to obtain network services, it can send a service request to the base station. The base station forwards the service request to the UPF, and then the UPF forwards the service request to the router. If the router recognizes that the destination IP address of the service request message is the IP address of the local server, it forwards the service request message to the server in the local edge cloud. If it recognizes that the destination IP address of the service request message is not the IP address of the local server, it forwards the service request message according to the routing table.
[0060] In light of the above system architecture, and to reduce terminal access latency, this application provides a packet forwarding method applied to a router. The method includes:
[0061] Receive a first request message, the host address range of the destination IP address of the first request message is used to represent the service identifier of the service requested by the first request message;
[0062] If a service identifier with the same host address range exists in the local service identifier list, the first request message is forwarded to the local server; the local service identifier list includes service identifiers of services that the local server cluster can provide.
[0063] If no service identifier matching the host address range exists in the local service identifier list, the first request message is forwarded to other routers based on the destination IP address of the first request message.
[0064] Using this method, the host address range of the destination IP address is used to represent the service identifier requested by the first request message. Upon receiving the first request message, if a service identifier with the same host address range exists in the local service list, it indicates that the local server can provide the service requested by the first request message, and thus forwards the first request message to the local server. In other words, regardless of whether the destination address of the first request message is the local server's IP address, as long as the host address range of the destination address of the first request message belongs to the local service list, the local server can process the first request message. Therefore, there is no need to forward the first request message to other routers, which improves the response speed of the first request message and reduces the access latency of the terminal.
[0065] The message forwarding method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0066] This application provides a message forwarding method, which is applied to a router, such as... Figure 1 Routers connected to the edge cloud, such as Figure 3 As shown, the method includes:
[0067] S301. Receive the first request message. The host address range of the destination IP address of the first request message is used to represent the service identifier of the service requested by the request message.
[0068] The first request message can be a Hypertext Transfer Protocol (HTTP) request message.
[0069] The destination IP address of the first request message is the public IP address of the server providing services to the terminal. The destination IP address includes a network address segment and a host address segment, where the network address segment represents the server's network location, and the host address segment represents the server's service identifier. In this embodiment, the encoding rule for the server's public IP address is "network address: service identifier". As an example, the first 64 bits of a 128-bit public IP address can be the network address segment, and the last 64 bits can be the host address segment.
[0070] In the embodiments of this application, the same service is used for the same service on different servers, that is, a service has a unique identifier.
[0071] For example, if servers A, B, and C, located in different places, can provide the same service, then the IP addresses of these three servers include the same host address range, but different network address ranges.
[0072] S302. If a service identifier with the same address range as the host address exists in the local service identifier list, then forward the first request message to the local server.
[0073] The local service identifier list includes the service identifiers of the services that the local server cluster can provide. For example, if the local service cluster can provide services A, B, and C, and the service identifiers corresponding to services A, B, and C are 1100:0000:0000:0001, 1100:0000:0000:0011, and 1100:0000:0000:0111 respectively, then the local service identifier list includes 1100:0000:0000:0001, 1100:0000:0000:0011, and 1100:0000:0000:0111.
[0074] Optionally, the service identifiers included in the local service identifier list can be service identifiers for mobile services, which are highly mobile services, such as vehicle-to-everything (V2X) services.
[0075] S303. If there is no service identifier in the local service identifier list that is the same as the host address range, then forward the first request message to other routers based on the destination IP address of the first request message.
[0076] If there is no service identifier in the local service identifier list that is the same as the host address range, it means that the local server cluster cannot provide the service identified by that service identifier. In this case, the router can forward the first request packet to other routers based on the routing table.
[0077] The routing table contains multiple forwarding entries. Each forwarding entry includes at least an IP address, an outgoing interface, and a next hop. The router can match the destination IP address of the first request packet with the forwarding entries in the routing table and forward the first request packet based on the outgoing interface and next hop included in the matched forwarding entry.
[0078] For example, if Figure 1 If there is no service identifier in the local service identifier list of router 1 that is the same as the host address range, then the destination IP address of the first request message will be matched against the routing table. If the next hop matched is the IP address of router 2, then router 1 will forward the first request message to router 2.
[0079] Using this method, the host address range of the destination IP address is used to represent the service identifier requested by the first request message. Upon receiving the first request message, if a service identifier with the same host address range exists in the local service identifier list, it indicates that the local server can provide the service requested by the first request message, and thus forwards the first request message to the local server. In other words, regardless of whether the destination address of the first request message is the IP address of the local server, as long as the host address range of the destination address of the first request message belongs to the local service identifier list, the local server can process the first request message. Therefore, there is no need to forward the first request message to other routers, which can improve the response speed of the first request message and reduce the access latency of the terminal.
[0080] In one embodiment of this application, the above-mentioned S301, receiving the first request message, specifically includes the following two implementation methods.
[0081] Method 1: Receive the first request message sent by the client.
[0082] The router receives the first request message sent by the terminal, which means that the edge cloud connected to the router is the edge cloud that is closest to the terminal. After receiving the first request message, the router can obtain the host address range included in the destination IP address of the first request message. If there is a service identifier in the local service identifier list that is the same as the host address range, the local server can process the first request message.
[0083] There are two scenarios where the local service identifier list contains a service identifier that is the same as the host address range.
[0084] The first scenario is when the destination IP address of the first request message is the same as the public IP address of the local server.
[0085] Combination Figure 1 To illustrate the scenario for the first case, assume terminal 1 accesses URL 1 within the coverage area of base station 1. The terminal queries the DNS server and obtains the mapping between URL 1 and IP address 1. This IP address 1 corresponds to server 1 in edge cloud 1. Figure 1 The public IP address of the server (not shown in the image) is then sent by terminal 1. Terminal 1 then sends a first request message, the destination IP address of which is the public IP address of server 1. Router 1 receives this first request message and forwards it to server 1. In this scenario, the destination IP address of the first request message is the same as the public IP address of the local server.
[0086] The second scenario is: the destination IP address of the first request message is different from the public IP address of the local server. Specifically, the network address range of the destination IP address is different from the network address range of the public IP address, but the host address range of the destination IP address is the same as the host address range of the public IP address.
[0087] Combination Figure 1 To illustrate the scenario corresponding to the second case, let's assume that server 2 in edge cloud 2 ( Figure 1 (Not shown in the image) can provide the same service as server 1. When terminal 1 moves from the coverage area of base station 1 to the coverage area of base station 2, the correspondence between URL 1 and IP address 1 is still stored in terminal 1.
[0088] Therefore, the destination address of the first request message sent by terminal 1 is still IP address 1. Since terminal 1 is within the coverage area of base station 2, the first request message will be sent to router 2. After receiving the first request message, router 2 obtains the host address range of IP address 1 included in the first request message, and determines that its local service identifier list includes a service identifier with the same host address range. Then, it forwards the first request message to server 2 without forwarding it to router 1 according to the routing table.
[0089] In this scenario, the public IP addresses of server 1 and server 2 include different network address ranges, but the host address ranges are the same.
[0090] For example, server 1's public IP address is 1:1:1:1:1:0:0:0, and server 2's public IP address is 1:1:1:2:1:0:0:0. It can be seen that the network address range of server 1's public IP address (1:1:1:1) is different from that of server 2's public IP address (1:1:1:2), but the host address range of both server 1 and server 2 is the same, 1:0:0:0.
[0091] Although the destination IP address of the first request message is the public IP address of server 1, the first request message is forwarded to the nearest server 2. This reduces the latency caused by router 2 forwarding the first request message to router 1 and then router 1 forwarding the first message to server 1. This allows the first request message to be responded to more quickly and reduces the access latency of terminal 1.
[0092] Method 2: Receive the first request message sent by the router.
[0093] That is, the first request message was forwarded by another router. For first request messages forwarded by other routers, the same applies as described above. Figure 3 The process of handling [the data].
[0094] In this embodiment of the application, the public IP address of the server can be an IPv6 address. IPv6 addresses have abundant network address resources. The current host address segment length of IPv6 addresses is 64 bits, which can provide a huge address space. Using this address space, service identifiers can be assigned to various services across the entire network.
[0095] Optionally, an IPv6 address segment can be pre-allocated for mobile services, and the allocated IPv6 address segment can be used as a dedicated host address segment for mobile services, that is, the host addresses in this host address segment are specifically used as service identifiers for mobile services.
[0096] The IPv6 address segment applied for for mobile services can be a segment that is not currently in use. For example, the IPv6 address segment is 1100:0000:0000:0000. Of course, it can also be other unused segments. This application embodiment does not limit this.
[0097] By applying for unused IPv6 address segments for mobile services as dedicated host address segments for mobile services, it is possible to avoid affecting currently used segments and thus avoid conflicts with existing IP addresses. Other host address segments can continue to be used by other service applications without being affected by the dedicated host address segments in this application embodiment.
[0098] Accordingly, the service identifiers in the local service identifier list in this application embodiment belong to the preset host address network segment. The preset host address network segment is the IPv6 address network segment that was previously applied for for mobile services. The preset host address network segment is dedicated to mobile services.
[0099] In order to achieve Figure 1 The method shown requires the router to generate a local service identifier list in advance. Prior to S301, such as... Figure 4 As shown, the method also includes the following steps:
[0100] S401. Obtain the mapping between the URLs of the services that the local server cluster can provide and their public IP addresses from the name server of the local server cluster.
[0101] Each edge cloud also includes a name server, which stores the mapping between the URLs and IP addresses of the services provided by the local server cluster. Routers can call the name server's application programming interface (API) to obtain the mapping between the URLs and public IP addresses of the services provided by the local service cluster.
[0102] S402. Extract the host address of each public IP address from the public IP addresses included in the obtained corresponding relationship.
[0103] S403. Use the extracted host address as the service identifier to generate a local service identifier list.
[0104] It is understood that in this embodiment of the application, the host address in the public IP address is the service identifier, so the extracted host address is the service identifier that the local server cluster can provide.
[0105] Using this method, the host address included in the public IP address serves as the service identifier. The router can obtain the mapping relationship between the URL of the local server cluster and the public IP address from the name server of the local server cluster. From the public IP address included in the obtained mapping relationship, the service identifiers of all services that the local server can provide can be extracted, and a service identifier list can be generated. Subsequently, services can be provided to the terminal based on the nearest service identifier list, reducing the access latency of the terminal.
[0106] In another embodiment of this disclosure, in Figure 4 Based on the illustrated embodiments, the embodiments of this application can also update the local service identifier list in real time, such as... Figure 5 As shown, the method includes:
[0107] S501: In real time, obtain the mapping relationship between the URLs of the services that the local server cluster can provide and the public IP addresses from the name server of the local server cluster.
[0108] The services that the local server cluster can provide may change, and the corresponding mapping between URLs and IP addresses will also change. The router can obtain the latest mapping between the URLs and public IP addresses of the services that the local server cluster can provide in real time.
[0109] S502. Extract the host address of each public IP address from the public IP addresses included in the obtained correspondence.
[0110] S503. Update the local service identifier list based on the extracted host addresses of each public IP address.
[0111] If the extracted host addresses include host addresses that do not exist in the local service list, then add the host address to the local service identifier list. If there are host addresses in the local service list other than the host addresses extracted this time, then delete the host address from the local service list.
[0112] This method allows the router to obtain the mapping between URLs and public IP addresses of services provided by the local server cluster from the name server in real time. It also extracts host addresses from the public IP addresses in the obtained mapping and updates the local service identifier list based on the extracted host addresses. In this way, the router can obtain the latest mapping in a timely manner, ensuring that the service identifiers in the local service identifier list are consistent with the services provided by the current local server cluster, thereby improving the accuracy of the router in forwarding packets based on the local service identifier list.
[0113] In one possible implementation, the router can also periodically obtain the mapping between the URLs of services provided by the local server cluster and their public IP addresses from the name server, extract the host addresses of each public IP address, and then update the local service identifier list based on the extracted host addresses. When the services provided by the local service cluster change infrequently, this method can reduce the router's processing overhead and ensure that the service identifiers in the local service identifier list remain consistent with the services currently provided by the local server cluster, thereby improving the accuracy of packet forwarding based on the local service identifier list.
[0114] In another embodiment of this application, S302, if a service identifier with the same address range as the host address exists in the local service identifier list, then the first request message is forwarded to the local server. Specifically, this can be implemented as follows:
[0115] If a service identifier with the same host address range exists in the local service identifier list, the destination IP address of the first request message is converted to the IP address of the load balancer to obtain the second request message, which is then sent to the local server through the load balancer.
[0116] The router can send the second request message to the load balancing device, so that the load balancing device can convert the destination IP address of the second request message to the IP address of the local server based on the load balancing policy, and then forward it to the local server.
[0117] The load balancing strategy can be set based on the actual situation and can adopt load balancing strategies in related technologies. This application embodiment does not limit this.
[0118] The load balancing device can determine the local server to process the second request message based on the load balancing policy, and then convert the destination IP address of the second request message to the private IP address of the local server.
[0119] After processing the received second request message, the local server can generate a response message for the second request message, and the local server can forward the response message to the terminal through the router.
[0120] It should be noted that the local server in this embodiment provides short-connection, stateless services to the terminal. Examples include information query services and data calculation services.
[0121] The first request message sent by the terminal will receive the same response content when processed by different servers.
[0122] Using this method, after receiving the first request message, the router does not forward it directly through the routing table. Instead, it first determines whether the local server can handle the first request message. If it can, the local server handles the first request message without forwarding it to the server corresponding to the destination IP address of the first request message, which can reduce access latency.
[0123] Corresponding to the above method embodiments, this application also provides a message forwarding device, which is applied to a router, such as... Figure 6 As shown, the device includes:
[0124] The receiving module 601 is used to receive a first request message, wherein the host address segment of the destination IP address of the first request message is used to represent the service identifier of the service requested by the first request message.
[0125] The first forwarding module 602 is used to forward the first request message to the local server if there is a service identifier in the local service identifier list that is the same as the host address range; wherein, the local service identifier list includes service identifiers of services that the local server cluster can provide.
[0126] The second forwarding module 603 is used to forward the first request message to other routers based on the destination IP address of the first request message if there is no service identifier in the local service identifier list that is the same as the host address range.
[0127] In another embodiment of this application, the device further includes:
[0128] The acquisition module is used to obtain the mapping between the URLs of services that the local server cluster can provide and their public IP addresses from the name server of the local server.
[0129] The extraction module is used to extract the host address of each public IP address from the public IP addresses included in the obtained corresponding relationship;
[0130] The generation module is used to generate the local service identifier list by using the extracted host addresses as service identifiers.
[0131] In another embodiment of this application, the first forwarding module 602 is specifically used for:
[0132] If a service identifier with the same address range as the host exists in the local service identifier list, the destination IP address of the first request message is converted to the IP address of the load balancer to obtain a second request message, which is then sent to the local server through the load balancer.
[0133] In another embodiment of this application, the service identifiers included in the local service identifier list belong to a preset host address network segment. The preset host address network segment is an IPv6 address network segment pre-approved for mobile services, and the preset host address network segment is dedicated to mobile services.
[0134] In another embodiment of this application, the receiving module 601 is specifically used for:
[0135] Receive the first request message sent by the terminal; or,
[0136] Receive the first request message forwarded by the router.
[0137] This application also provides an electronic device, which can be a router, such as... Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0138] Memory 703 is used to store computer programs;
[0139] When the processor 701 executes the program stored in the memory 703, it implements the method steps in the above method embodiments.
[0140] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0141] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0142] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0143] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0144] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described message forwarding methods.
[0145] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the message forwarding methods described above.
[0146] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0147] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0148] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A message forwarding method, characterized in that, The method is applied to a router, and the method includes: Receive a first request message, wherein the host address segment of the destination IP address of the first request message is used to represent the service identifier of the service requested by the first request message; If a service identifier identical to the host address range exists in the local service identifier list, the first request message is forwarded to the local server; wherein, the local service identifier list includes service identifiers of services that the local server cluster can provide, the service identifiers included in the local service identifier list belong to a preset host address network segment, the preset host address network segment is an IPv6 address network segment pre-approved for mobile services, and the preset host address network segment is dedicated to the mobile services. If no service identifier matching the host address range exists in the local service identifier list, the first request message is forwarded to other routers based on the destination IP address of the first request message.
2. The method according to claim 1, characterized in that, Before receiving the first request message, the method further includes: Obtain the mapping between the Uniform Resource Locator URLs and public IP addresses of the services that the local server cluster can provide from the name server of the local server cluster; Extract the host address of each public IP address from the public IP addresses included in the obtained corresponding relationships; The extracted host address is used as the service identifier to generate the local service identifier list.
3. The method according to claim 1 or 2, characterized in that, If a service identifier with the same address range as the host address range exists in the local service identifier list, then forwarding the first request message to the local server includes: If a service identifier with the same address range as the host exists in the local service identifier list, the destination IP address of the first request message is converted to the IP address of the load balancer to obtain a second request message, which is then sent to the local server through the load balancer.
4. The method according to claim 1, characterized in that, Receiving the first request message includes: Receive the first request message sent by the terminal; or, Receive the first request message forwarded by the router.
5. A message forwarding device, characterized in that, The device is used in a router, and the device includes: The receiving module is used to receive a first request message, wherein the host address segment of the destination IP address of the first request message is used to represent the service identifier of the service requested by the first request message. The first forwarding module is configured to forward the first request message to the local server if a service identifier identical to the host address range exists in the local service identifier list; wherein, the local service identifier list includes service identifiers of services that the local server cluster can provide, the service identifiers included in the local service identifier list belong to a preset host address network segment, the preset host address network segment is an IPv6 address network segment pre-approved for the mobile service, and the preset host address network segment is dedicated to the mobile service; The second forwarding module is used to forward the first request message to other routers based on the destination IP address of the first request message if there is no service identifier in the local service identifier list that is the same as the host address range.
6. The apparatus according to claim 5, characterized in that, The device further includes: The acquisition module is used to obtain the mapping between the URLs of services that the local server cluster can provide and their public IP addresses from the name server of the local server cluster; The extraction module is used to extract the host address of each public IP address from the public IP addresses included in the obtained corresponding relationship; The generation module is used to generate the local service identifier list by using the extracted host addresses as service identifiers.
7. The apparatus according to claim 5 or 6, characterized in that, The first forwarding module is specifically used for: If a service identifier with the same address range as the host exists in the local service identifier list, the destination IP address of the first request message is converted to the IP address of the load balancer to obtain a second request message, which is then sent to the local server through the load balancer.
8. The apparatus according to claim 5, characterized in that, The receiving module is specifically used for: Receive the first request message sent by the terminal; or, Receive the first request message forwarded by the router.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-4.
10. A machine-readable storage medium, characterized in that, The device stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to perform the steps of the method described in any one of claims 1-4.
Citation Information
Patent Citations
Data routing method, apparatus and base station
CN107277882A
Data processing method, and equipment
CN112398801A