Network request routing method and device
By analyzing the address information in network requests and processing routing records, and using dynamic allocation to optimize routing processing, it solves the problems of excessive resource consumption and network congestion caused by traditional routing methods, and achieves efficient packet transmission and communication quality assurance.
Patent Information
- Application Number
- CN202411160018.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-12-10
AI Technical Summary
When faced with large amounts of data transmission and dense network interaction, traditional routing methods lead to excessive consumption and congestion of network resources, reducing response speed, and it is difficult to optimize resource usage while ensuring communication quality.
By receiving network requests, the sending and destination address information in the data packet is parsed, the routing record information is processed, and the dynamic request allocation method is adopted, such as routing record processing and packet transmission is carried out based on network element information, domain name resolution or URL list, so as to Realize efficient allocation of resources and load balancing.
Under dynamically changing network conditions, the processing efficiency of network requests is improved, delay is reduced, and the optimal utilization of resources and communication quality are ensured.
Smart Images

Figure CN119109856A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of communications, and more particularly to a method and apparatus for routing network requests. Background Art
[0002] With the continuous development of communication technology, the expansion of communication service coverage and the surge in the number of users, it is becoming increasingly important to effectively cope with large-scale concurrent operations to achieve low latency.
[0003] At present, in the field of calls, routing technology is widely used to uniformly manage network entrances, request forwarding and traffic control to ensure user experience and service quality. However, in an environment with relatively mild data volume, the routing method with fixed rules can effectively manage and guide network traffic and ensure the quality of communication. However, in the face of surging data volume and intensive network interaction, traditional routing methods will not only lead to excessive consumption of network resources, but also cause network congestion due to frequent request processing, reducing response speed. Therefore, how to ensure communication quality and take into account resource optimization in large-scale data transmission has become an urgent problem to be solved. Summary of the invention
[0004] An object of an embodiment of the present specification is to provide a method and apparatus for routing network requests, so as to implement routing processing of network requests under dynamically changing network conditions.
[0005] To solve the above technical problems, an embodiment of this specification is implemented as follows:
[0006] In a first aspect, an embodiment of the present specification provides a method for routing a network request, including:
[0007] Receiving a network request; the network request is allocated and obtained according to a request allocation method corresponding to the network environment;
[0008] Parsing the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node;
[0009] Processing routing record information according to at least one of the sending address information and the destination address information to obtain a routing record;
[0010] The data packet is sent according to the routing record.
[0011] In a second aspect, another embodiment of the present specification provides a network request routing device, including:
[0012] A request receiving module is configured to receive a network request; the network request is allocated and obtained according to a request allocation method corresponding to the network environment;
[0013] A parsing module is configured to parse the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node;
[0014] a processing module, configured to process routing record information according to at least one of the sending address information and the destination address information to obtain a routing record;
[0015] The sending module is configured to perform sending processing of the data packet according to the routing record.
[0016] In a third aspect, another embodiment of the present specification provides a network request routing device, comprising: a memory, a processor, and computer executable instructions stored on the memory and executable on the processor, wherein the computer executable instructions, when executed by the processor, implement the steps of the network request routing method as described in the first aspect above.
[0017] In a fourth aspect, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the method for routing network requests as described in the first aspect above are implemented.
[0018] In a fifth aspect, another embodiment of the present specification provides a computer program product, wherein the computer program product includes a routing program for network requests, and the routing program for network requests is executed by a processor to implement the steps of the routing method for network requests as described in the first aspect above.
[0019] The routing method for network requests provided in this embodiment first receives a network request, then parses a data packet carried in the network request, obtains the sending address information of the sending node and the destination address information of the destination node, then processes the routing record information according to at least one of the sending address information and the destination address information to obtain the routing record, and finally performs the sending processing of the data packet according to the routing record to realize the routing processing of the network request under dynamically changing network conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in one or more embodiments of the present specification, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0021] Figure 1 A routing flow chart of a network request provided by one embodiment of this specification;
[0022] Figure 2 A processing flow chart of a routing method for network requests applied to a data packet forwarding scenario provided by one embodiment of this specification;
[0023] Figure 3 A schematic diagram of a network architecture provided for an embodiment of this specification;
[0024] Figure 4 A schematic diagram of a network request routing processing device provided by one embodiment of the present specification;
[0025] Figure 5 A schematic diagram of the structure of a network request routing processing device provided in one embodiment of the present specification. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the following will be combined with the drawings in one or more embodiments of this specification to clearly and completely describe the technical solutions in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this document.
[0027] This specification provides a method for routing network requests:
[0028] Reference Figure 1 , which shows a processing flow chart of a network request routing method provided in this embodiment. The network request routing method provided in this embodiment specifically includes the following steps S102 to S108.
[0029] Step S102, receiving a network request.
[0030] The network request refers to a communication request sent by a server, client or other network device to another server, client or other network device in a network environment. The communication request includes a data packet, and the data packet carries the sending address information of the request initiator and the destination address information of the request receiver, so as to transmit data, request services or obtain resources, etc. Optionally, the network request is intercepted and stored by an interceptor.
[0031] Among them, an interceptor refers to a component used to process network requests. The interceptor is located on the processing path of network requests and is responsible for intercepting network requests and executing specific processing logic. For example, the interceptor can decide how to allocate and route the network request based on the network environment so that the network request can be correctly sent to the target server or network node.
[0032] During the specific execution process, when a network request arrives at a specific gateway, the interceptor will capture the network request, prevent the network request from reaching the destination directly, and then decide whether to send the network request directly to the destination or store it for later processing based on the current load and network conditions. For example, during peak hours, in order to prevent server overload, the interceptor may temporarily store some requests and process them after the load is reduced. By intercepting and storing network requests, batch processing of network requests can be achieved, thereby reducing frequent access to resources, reducing latency, and improving overall response speed. At the same time, the interceptor can also perform load balancing based on real-time network conditions and load to ensure efficient use of resources and avoid single-point overload.
[0033] In specific implementation, due to the complex and changeable network environment, in order to ensure that network requests can be efficiently and evenly allocated to the most appropriate processing node, an adaptive request allocation method can be selected according to the characteristics and requirements of different network environments to achieve effective resource allocation and efficient processing of network requests. Optionally, the network request is allocated according to the request allocation method corresponding to the network environment.
[0034] Optionally, the request allocation method includes at least one of the following: allocating network requests based on weight values included in network element information, allocating network requests based on domain name resolution, or allocating network requests based on a URL list.
[0035] The following describes the allocation and processing of network requests based on three request allocation methods:
[0036] (1) Allocate network requests based on the weight values contained in the network element information
[0037] Specifically, in an optional implementation manner provided by this embodiment, the network request allocation is performed based on the weight value included in the network element information, including:
[0038] Sort the network element information based on the weight values included in the network element information to generate a network element information list;
[0039] The network element information is selected in the network element information list according to the weight value, and the network request to be allocated is allocated to the server corresponding to the network element to which the selected network element information belongs.
[0040] Among them, the network element information includes the weight, type, location, connection information, etc. of the network element, so as to realize the management and control of each network element. Specifically, the weight of the network element can be used to measure the priority or importance of the network element in the routing decision. The network element with a higher weight is generally considered to be a more reliable, more stable or higher performance option; the type of the network element is the specific type or role of the network element, such as a router, a server, etc. Different types of network elements have different functions and tasks; the location of the network element is mainly the physical location or logical location of the network element. The physical location includes identifiers such as longitude, latitude, and computer room number, while the logical location can be represented by an IP address (Internet Protocol Address) or a node name, etc.; the connection information of the network element can record the connection mode and parameters of the network element, including the connection type (wired, wireless), connection port, physical link bandwidth, etc.
[0041] In actual applications, network element information can be configured in a static manner, that is, network element information is pre-set in the initialization phase, and a series of data is entered in the network element information configuration table so that each network element can be quickly and accurately identified and configured in the subsequent process; specifically, network element information expected to participate in network communication can be pre-set in the network element information configuration table. Such network element information includes but is not limited to the weight, type, location, connection information, etc. of the network element. By pre-setting the network element data, the network element information can be accessed immediately after startup to identify each network element without waiting for real-time updates or queries, thereby speeding up the establishment of communication between network elements; at the same time, by statically configuring network element information, it is also possible to respond based on known information under high load conditions, thereby reducing configuration delays and improving response speed.
[0042] In addition, network element information can also be configured dynamically, that is, using the publish-subscribe model, so that the network element can publish and update its own status information in real time according to changes in the network status, so as to quickly respond to dynamic changes in the network environment; specifically, the network element calls the service subscription interface to register and subscribe based on the publish-subscribe model. In this process, the network element plays the role of publisher and publishes its own information, while other services act as subscribers and accept updates of this information. When the network element joins or leaves the network, or its status changes, such as load increase, fault recovery, etc., the service subscription interface can be called to register or update the network element information. Accordingly, the changed network element information can be synchronized to all platform services that have subscribed to the network element information, so as to make more accurate decisions, such as routing selection and load balancing.
[0043] The weight value refers to a numerical indicator assigned to each network element in the network, which is used to measure and reflect the relative priority, importance or performance level of the network element in routing decisions. Network elements with higher weights will be given priority in route selection, that is, data packets are more likely to be transmitted through the servers corresponding to these network elements.
[0044] During the specific execution process, a weight pool is first created, and all network element information is put into the weight pool according to its configured weight value, that is, a network element information list is generated, and the network element information is sorted from large to small according to the weight in the network element information list. When it is necessary to determine the route, the network element to which the network element information belongs will be selected from the weight pool in order from large to small, that is, the network element with a high weight will be given priority for data transmission; the weight value of the network element is not fixed, but will be dynamically adjusted according to the actual load of the network element and the network status. For example, when the load of a network element is low, its weight value can be increased to attract more traffic; on the contrary, when the load of the network element is high, its weight value can be reduced to reduce the new requests allocated to the corresponding server of the network element, so as to achieve the effect of load balancing.
[0045] (2) Allocate network requests based on domain name resolution
[0046] Specifically, in an optional implementation manner provided by this embodiment, network request allocation based on domain name resolution includes:
[0047] Parsing the network request to be allocated to obtain the domain name of the network request to be allocated;
[0048] According to the network element information mapped to the domain name, the network request to be allocated is allocated to a server corresponding to the network element to which the network element information belongs.
[0049] In this embodiment, the network request to be allocated can be parsed through a custom domain name resolution controller. The custom domain name resolution controller can have a built-in predefined domain name mapping table. The domain name mapping table associates a specific domain name with preset network element information. When a network request containing a domain name is received, the domain name resolution controller can search for the corresponding mapping rule based on the domain name information in the network request, and then allocate the network request to the server or server cluster corresponding to the network element to which the network element information belongs based on the network element information specified in the mapping rule; the custom domain name resolution controller can automatically update the mapping rules based on real-time network conditions, server load, and changes in business needs, so as to achieve effective resource allocation and efficient service efficiency.
[0050] During the specific execution process, when a network request carrying a specific domain name arrives at the call platform, the custom domain name resolution controller will resolve the domain name information in the network request. Then, the domain name resolution controller can match the domain name in the network request with the specific network element information according to the pre-configured domain name mapping table. When the matching network element information is found, the network request will be directed to the server corresponding to the network element to which the network element information belongs for further processing. The network request allocation method based on domain name resolution ensures that the network request can be directly directed to the server that handles specific services, thereby improving the speed and accuracy of request processing. At the same time, by directing the network request to a specific server cluster, it can avoid overloading of a single server and achieve effective resource utilization and load balancing.
[0051] (3) Allocate network requests based on URL list
[0052] Specifically, in an optional implementation manner provided by this embodiment, network request allocation is performed based on a URL list, including:
[0053] The URLs in the URL list apply for connection establishment with each server to obtain the server to establish the connection;
[0054] The network request to be allocated is allocated to the server for establishing the connection.
[0055] During the specific execution process, a preset URL (Uniform Resource Locator) list is first obtained, which contains the URL addresses of multiple servers for the allocation of network requests. Secondly, a random algorithm is used to exchange the elements at each position in the list to randomize the order of the URLs in the list. Each time a network request is processed, an attempt will be made from a randomized URL list. In the reordered URL list, each URL will try to establish a connection with each server in turn. If the attempt fails, the preset retry strategy can be followed to wait for a certain period of time before applying for connection establishment again until the request succeeds or the maximum number of retries is reached. The number of retries and the interval time can be set according to the network environment and business needs to balance the success rate of the request and resource consumption.
[0056] In specific implementation, when a network request is initiated, the interceptor will intercept the upcoming network request and select an appropriate request allocation method based on the network environment. For example, network request allocation is based on the weight value contained in the network element information, network request allocation is based on domain name resolution, or network request allocation is based on a URL list. Here, the network request allocated by the interceptor is accepted and subsequent operations are performed.
[0057] Step S104, parsing the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node.
[0058] The sending address information, that is, the address information of the initiator of the network request, includes but is not limited to the IP address and port number of the network node that sends the data packet, and is used to identify the source of the network request; the destination address information, that is, the address information of the target of the network request, includes but is not limited to the IP address and port number of the network node that receives the data packet, and is used to identify the target of the network request.
[0059] In specific implementation, when a network request (such as a video call request) arrives, the data packet of the network request is first captured, and then the header information of the data packet is read to extract the sending address information of the sending node (such as the source IP address and source port number, etc.) and the destination address information of the destination node (such as the destination IP address and destination port number, etc.), thereby determining the source and destination of the network request for subsequent routing and processing.
[0060] For example, a video call request is sent from a user terminal (sending node) with an IP address of 192.168.1.10 and a port number of 50001. The target is a video server (destination node) located in a data center with an IP address of 10.0.0.1 and a port number of 8080. When the request reaches the routing server of the call platform, the server will parse the data packet, extract the source IP address 192.168.1.10, source port number 50001, destination IP address 10.0.0.1 and destination port number 8080, etc. Based on this information, the source and destination of the request are determined, and then the correct routing decision is made to forward the request to the correct video server to ensure the smooth progress of the video call.
[0061] Optionally, the sending node is a controllable node in the inner domain, and the destination node is an uncontrollable node in the outer domain;
[0062] The controllable nodes include a server and a gateway with an interceptor deployed thereon; and the uncontrollable nodes include a user terminal that submits the network request.
[0063] In this embodiment, a controllable node refers to a node that can be directly managed and controlled, such as a server, a gateway deployed with an interceptor, etc. A controllable node is usually located in an internal domain and can participate in intercepting and processing requests; an uncontrollable node refers to a node that is located in an external domain or cannot be directly controlled relative to a controllable node, such as a user terminal device (such as a mobile phone, a computer, etc.); an uncontrollable node can initiate a network request, but its behavior is not directly managed; the communication between controllable nodes and uncontrollable nodes can be coordinated and managed through a routing server so that data packets can accurately reach their destination.
[0064] During the specific execution process, when a controllable node communicates with an uncontrollable node, a gateway deployed with an interceptor intercepts incoming and outgoing network requests between the controllable node and the uncontrollable node. The interceptor parses the request content and executes processing logic, such as load balancing and routing selection, according to preset rules. When a controllable node (such as a server) receives a request from an uncontrollable node (user terminal), it makes a routing decision based on the destination address information of the request and the internal routing record information, and forwards the request to the correct next-hop node or destination. After the request is processed, the processing result of the request, such as a successful response or an error code, can be fed back to the uncontrollable node so that the user terminal can understand the status of its request.
[0065] Step S106: Process the routing record information according to at least one of the sending address information and the destination address information to obtain a routing record.
[0066] After receiving the network request and parsing the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node, in this step, routing record information is processed according to at least one of the sending address information and the destination address information to obtain a routing record.
[0067] In practical applications, processing can be performed based on the sending address information, that is, focusing on the sender of the network request to quickly identify the source of the network request, so as to perform operations such as load balancing and service positioning; processing can also be performed based on the sending address information and the destination address information at the same time, so as to build a more accurate routing path, so that the data packet can be efficiently and accurately transmitted from the sender to the destination; specifically, routing record information processing is performed based on the sending address information or in combination with the sending address information and the destination address information, and the processing strategy can be selected according to the specific network environment, business needs and current network load conditions to achieve effective routing.
[0068] In specific implementation, when the positions and connection relationships of the nodes in the network are relatively fixed, the destination address information obtained by parsing the data packet can be queried in the routing table, and subsequent processing can be performed. In an optional implementation provided by this embodiment, the routing record information is processed according to at least one of the sending address information and the destination address information, including:
[0069] Based on the destination address information, searching the first routing record table for matching routing record information;
[0070] If found, the found route record information will be used as the route record.
[0071] The first routing record table uses the network address of the uncontrollable node as a keyword for indexing, and establishes a one-to-one correspondence between the uncontrollable node and the controllable node, so as to quickly find and determine how the data packet should be forwarded; the routing records in the first routing record table contain routing information related to the uncontrollable node, which includes but is not limited to the address information of the uncontrollable node, the address information of the controlled node that directly communicates with the uncontrollable node, the port number on the controllable node used to communicate with the uncontrollable node, the connection status of the current routing path and other communication parameters, etc. When a data packet needs to be forwarded to a certain uncontrollable node, the routing information of the node can be found in the first routing record table without traversing the entire database.
[0072] During the specific execution process, after receiving a network request and parsing the destination address information, the first routing record table is first queried to find the routing record information that matches the destination address information. If the routing record information that matches the destination address information is found in the first routing record table, the information is used as a routing record to guide the subsequent data packet sending, that is, the data packet will be forwarded to the next hop or directly delivered to the destination according to the information in the record; if no matching routing record information is found in the first routing record table, the subsequent processing logic will be executed; through the pre-established first routing record table, the routing information related to the destination address can be quickly located, thereby reducing the time for routing decisions and improving the processing speed of network requests.
[0073] In addition, in some cases, such as when no routing record matching the destination address information is found in the first routing record table, or when the forwarding of the data packet may depend not only on the destination address but also on the source address (i.e., the sending address), it is necessary to combine the source address information and the destination address information obtained by parsing the data packet, query in the routing table, and perform subsequent processing. In an optional implementation manner provided by this embodiment, routing record information processing is performed according to at least one of the sending address information and the destination address information, including:
[0074] Searching the first routing record table for routing record information matching the destination address information;
[0075] If not found, searching the second routing record table for incomplete routing record information matching the sending address information, and updating the routing table according to the found incomplete routing record information;
[0076] The updated routing record information is queried in the routing table, and the queried updated routing record information is used as the routing record.
[0077] In this embodiment, the second routing record table is indexed by using the network address of the controllable node as a keyword to establish a one-to-many correspondence between the controllable node and the uncontrollable node.
[0078] The incomplete routing record information refers to routing information that has not been fully formed or needs to be further updated to match the current network status during the routing process. The incomplete routing record information may contain some details about the communication between the controllable node and the uncontrollable node, but may lack all the necessary parameters required to complete a successful data packet forwarding; the incomplete routing record information may appear due to the following situations, such as the addition, deletion or status change of nodes in the network causing the original routing information to no longer be applicable, and the need to update or supplement new information; for example, when the controllable node attempts to establish a connection with the uncontrollable node for the first time, there may not be a complete routing information record, and the initial routing record needs to be constructed at this time; for example, since the update of routing information is not completed immediately, some outdated routing records may be held at a certain point in time.
[0079] During the specific execution process, if no routing record information matching the destination address information is found in the first routing record table, a query will be further performed in the second routing record table based on the sending address information to find incomplete routing record information matching the controllable node network address. When incomplete routing record information matching the sending address information and the controllable node network address is found in the second routing record table, updated routing record information will be created and added to the first routing record table. At the same time, the routing table will be updated to reflect the latest network status and routing strategy.
[0080] For example, a controllable node (router) receives a network request with a destination address of 192.168.1.100, but does not find routing record information matching the destination address in the first routing record table. At this time, the sending address information is combined to query the second routing record table for incomplete routing record information matching the controllable node network address (such as 10.0.0.1). After finding a match, the routing record information is updated and added to the first routing record table. Then, based on the updated routing record information, the optimal path is selected to forward the data packet.
[0081] In a specific implementation, when incomplete routing record information matching the sending address information is queried in the second routing record table, since the incomplete routing record information may contain partial information about the communication between the controllable node and the uncontrollable node, but may lack all necessary parameters required to complete a successful data packet forwarding, the routing table may be updated based on the incomplete routing record information to perform subsequent operations. In an optional implementation manner provided by this embodiment, updating the routing table according to the queried incomplete routing record information includes:
[0082] Extracting information related to the sending address information from the incomplete routing record information, and creating the updated routing record information based on the information and the destination address information;
[0083] Update the incomplete routing record information according to the updated routing record information, and add the updated routing record information to the first routing record table;
[0084] The routing table is updated according to the updated first routing record table and the second routing record table.
[0085] During the specific execution process, when a complete routing record matching the destination address information is not found in the first routing record table, the second routing record table will be turned to, and the incomplete routing record information related to the sending address information will be searched in the second routing record table. In the incomplete routing record information, information fragments related to the sending address information, such as the next hop address or related parameters, etc., are extracted, and the extracted information is combined with the destination address information to generate updated routing record information. The updated routing record information includes a complete path description from the sending address to the destination address, which is used to modify the incomplete routing record information in the second routing record table so that the incomplete routing record information becomes a complete routing entry, and then the updated routing record information is added to the first routing record table to update the routing information directly available in the first routing record table. Finally, the routing table is updated according to the updated first routing record table and the second routing record table to ensure the consistency and validity of all routing information.
[0086] For example, a device is trying to forward a data packet to a new destination, but there is no relevant record in the first routing record table. Then, an incomplete record is found in the second routing record table, indicating that the next hop address is router B. By combining it with the destination address information, the complete path is calculated to be A->B->C->D, where D is the destination. This path information is recorded as updated routing record information and added to the first routing record table. At the same time, the incomplete record in the second routing record table is updated. Based on this, subsequent data packets sent to D can be forwarded directly according to the complete path in the first routing record table without the need for complex routing calculations again.
[0087] In addition, after processing the routing record information according to the sending address information and the destination address information and obtaining a valid routing record, in order to ensure that the data packet can reach the destination along the selected path, it is also necessary to verify whether the routing record is in an operable enabled state to avoid data transmission failure due to expired or invalid routing information. In an optional implementation manner provided by this embodiment, the routing record information is processed according to at least one of the sending address information and the destination address information, after obtaining the routing record, and before the data packet is sent according to the routing record, it also includes:
[0088] Detecting a status of an identifier of the routing record;
[0089] If the flag is in an enabled state, executing a step of sending the data packet according to the routing record;
[0090] If the flag is in a non-enabled state, the flag is converted from the non-enabled state to the enabled state, the routing record information is updated, and the updated routing record information is written into the routing table, and the updated routing record is extracted from the updated routing record information to perform the sending process of the data packet.
[0091] The identifier refers to a connection enablement status identifier, specifically a key mark used to describe the network connection status to indicate whether the connection in the routing record is available or activated, thereby determining whether the data packet can be forwarded through the connection; if the connection enablement status identifier is in an "enabled" or "enabled" state, it indicates that the connection in the routing record is available and the data packet can be forwarded normally along this path; conversely, if the identifier is in a "disabled" or "disabled" state, then the path is deemed unavailable and the data packet cannot be transmitted through the path; the connection enablement status identifier is not static and may be dynamically updated according to network conditions, changes in connection status or management policies. For example, when the network is congested, a link fails or a policy changes, the connection enablement status identifier may change from an enabled state to a disabled state, and vice versa.
[0092] During the specific execution process, when a data packet is ready to be sent, the status mark in the routing record is first checked to determine whether it is in an enabled state. If the mark shows an enabled state, this routing record is directly used to guide the sending and processing of the data packet, that is, the data packet is forwarded according to the next hop address and other relevant information in the routing record; if the mark shows an unenabled state, the mark state is first converted from an unenabled state to an enabled state, and then the routing record information is updated to reflect the latest network status, and the updated routing record information is written into the routing table to replace the original record, and the latest information is extracted from the updated routing record for the sending and processing of the data packet; by dynamically detecting and updating the routing record status to adapt to network changes in real time, it is ensured that the data packet is always transmitted through the best path, reducing transmission delays, and improving data packet delivery rates, while reducing the risk of network congestion caused by improper static routing configuration.
[0093] It should be noted that when the routing record information matching the destination address information is queried in the first routing record table, there may be two situations where the network address information of the controllable node specified in the routing record information is the same as or different from the network address of the current node:
[0094] (1) When the network address information of the controllable node recorded in the routing record information is the same as the network address of the current node, it means that the current node is the controllable node specified in the routing record, that is, the next direct forwarding point of the data packet. At this time, it is necessary to check and update the relevant routing information to ensure that the data packet can be forwarded correctly, that is, to check the status of the identification of the routing record so that the data packet can be forwarded smoothly along the correct path, thereby achieving the continuity and reliability of network communication.
[0095] (2) When the network address information of the controllable node recorded in the routing record information is different from the network address of the current node, it means that the current node is not the controllable node specified in the routing record. In this case, in order to enable the data packet to be forwarded along the optimal path, the following operations can be performed: first, all records that are identical to the network address information of the controllable node recorded in the found matching routing record information and the network address information of the destination uncontrollable node are removed from the second routing record table, because these records may no longer be valid or point to an incorrect path. Secondly, all records that are identical to the network address information of the destination uncontrollable node recorded in the found matching routing record information are deleted from the first routing record table to clear the possibly outdated routing information and create space for new and more accurate information. Subsequently, based on the network address information of the current node, the second routing record table is searched for matching incomplete routing record information. Finally, the routing table is updated based on the incomplete routing record information to obtain the routing record for forwarding the data packet.
[0096] Step S108: performing sending processing of the data packet according to the routing record.
[0097] The above-mentioned receiving network request, parsing the data packet carried in the network request, obtaining the sending address information of the sending node and the destination address information of the destination node, and performing routing record information processing based on at least one of the sending address information and the destination address information. After obtaining the routing record, in this step, the sending processing of the data packet is performed according to the routing record.
[0098] In specific implementation, after determining the routing record, the data packet can be sent and processed, that is, the next hop address information in the routing record is checked. If the next hop is a controllable node, the data packet is sent to the controllable node. After the controllable node receives the data packet, it will make forwarding decisions again based on its own routing table until the data packet reaches the final destination; if the next hop is a directly reachable destination node, the data packet is sent directly to the destination node.
[0099] To summarize, the routing method for network requests provided in this embodiment first receives a network request, then parses the data packet carried in the network request, obtains the sending address information of the sending node and the destination address information of the destination node, then processes the routing record information according to at least one of the sending address information and the destination address information, obtains the routing record, and finally performs the sending processing of the data packet according to the routing record, so as to realize the routing processing of the network request under dynamically changing network conditions.
[0100] The following combination Figure 2 and attached Figure 3 , taking the application of the network request routing method provided by this embodiment in the data packet forwarding scenario as an example, the network request routing method provided by this embodiment is further described. Figure 2 and Figure 3 The routing method of network request applied to the data packet forwarding scenario specifically includes steps S202 to S226.
[0101] Step S202, receiving the network request assigned by the interceptor.
[0102] Step S204, parsing the data packet carried in the network request.
[0103] Step S206, based on the destination address information, query whether there is matching routing record information in the first routing record table, if not, execute step S208; if yes, execute step S218.
[0104] Step S208: Search the second routing record table for incomplete routing record information that matches the sending address information.
[0105] Step S210: Create and update routing record information based on the information related to the sending address information and the destination address information queried in the incomplete routing record information.
[0106] Step S212: update the incomplete routing record information according to the updated routing record information, and add the updated routing record information to the first routing record table.
[0107] Step S214: updating the routing table according to the updated first routing record table and the second routing record table.
[0108] Step S216, querying the updated routing record information in the routing table, and using the queried updated routing record information as the routing record.
[0109] Step S218: taking the queried routing record information as a routing record.
[0110] Step S220, detecting whether the flag of the routing record is in an enabled state, if not, executing step S222; if so, executing step S226.
[0111] Step S222, converting the flag from a non-enabled state to an enabled state.
[0112] Step S224, updating the routing record information, writing the updated routing record information into the routing table, and extracting the updated routing record from the updated routing record information as the routing record.
[0113] Step S226, performing data packet sending processing according to the routing record.
[0114] The routing method for network requests provided in this embodiment first receives a network request, then parses a data packet carried in the network request, obtains the sending address information of the sending node and the destination address information of the destination node, then processes the routing record information according to at least one of the sending address information and the destination address information to obtain the routing record, and finally performs the sending processing of the data packet according to the routing record to realize the routing processing of the network request under dynamically changing network conditions.
[0115] Figure 4 A schematic diagram of a network request routing device provided by an embodiment of the present invention, such as Figure 4 Said device comprises:
[0116] The request receiving module 402 is configured to receive a network request; the network request is allocated and obtained according to a request allocation method corresponding to the network environment;
[0117] The parsing module 404 is configured to parse the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node;
[0118] The processing module 406 is configured to process the routing record information according to at least one of the sending address information and the destination address information to obtain a routing record;
[0119] The sending module 408 is configured to perform sending processing of the data packet according to the routing record.
[0120] The cloud storage space management device provided in this embodiment first runs the request acceptance module 402 to receive the network request, and then runs the parsing module 404 to parse the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node, and then runs the processing module 406 to process the routing record information according to at least one of the sending address information and the destination address information to obtain the routing record, and finally runs the sending module 408 to perform the sending processing of the data packet according to the routing record, so as to realize the routing processing of the network request under dynamically changing network conditions.
[0121] A network request routing device provided in one embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0122] Furthermore, an embodiment of the present specification also provides a network request routing device, Figure 5 A schematic diagram of a network request routing device provided in one embodiment of the present specification, such as Figure 5 As shown, the device includes: a memory 501, a processor 502, a bus 503 and a communication interface 504. The memory 501, the processor 502 and the communication interface 504 communicate through the bus 503, and the communication interface 504 may include an input and output interface, which includes but is not limited to a keyboard, a mouse, a display, a microphone, a loudspeaker, etc.
[0123] Figure 5 In the embodiment, the memory 501 stores computer executable instructions that can be run on the processor 502. When the computer executable instructions are executed by the processor 502, the following process is implemented:
[0124] Receiving a network request; the network request is allocated and obtained according to a request allocation method corresponding to the network environment;
[0125] Parsing the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node;
[0126] Processing routing record information according to at least one of the sending address information and the destination address information to obtain a routing record;
[0127] The data packet is sent according to the routing record.
[0128] The network request routing device provided in this embodiment, through the cooperation of the memory 501, the processor 502, the bus 503 and the communication interface 504, first receives the network request, then parses the data packet carried in the network request, obtains the sending address information of the sending node and the destination address information of the destination node, then processes the routing record information according to at least one of the sending address information and the destination address information, obtains the routing record, and finally processes the sending of the data packet according to the routing record.
[0129] A network request routing device provided in one embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0130] Furthermore, another embodiment of the present specification provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented:
[0131] Receiving a network request; the network request is allocated and obtained according to a request allocation method corresponding to the network environment;
[0132] Parsing the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node;
[0133] Processing routing record information according to at least one of the sending address information and the destination address information to obtain a routing record;
[0134] The data packet is sent according to the routing record.
[0135] The computer-readable storage medium provided in this embodiment first receives a network request, then parses a data packet carried in the network request, obtains the sending address information of the sending node and the destination address information of the destination node, then processes the routing record information according to at least one of the sending address information and the destination address information, obtains the routing record, and finally processes the sending of the data packet according to the routing record.
[0136] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0137] The computer-readable storage medium provided in one embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0138] Furthermore, another embodiment of the present specification also provides a computer program product, which implements the following process when executed by a processor:
[0139] Receiving a network request; the network request is allocated and obtained according to a request allocation method corresponding to the network environment;
[0140] Parsing the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node;
[0141] Processing routing record information according to at least one of the sending address information and the destination address information to obtain a routing record;
[0142] The data packet is sent according to the routing record.
[0143] The computer program product provided in this embodiment first receives a network request, then parses the data packet carried in the network request, obtains the sending address information of the sending node and the destination address information of the destination node, then processes the routing record information according to at least one of the sending address information and the destination address information, obtains the routing record, and finally performs the sending processing of the data packet according to the routing record, so as to realize the routing processing of the network request under dynamically changing network conditions.
[0144] The computer program product provided in one embodiment of this specification can implement each process in the aforementioned method embodiment and achieve the same functions and effects, which will not be repeated here.
[0145] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0146] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0147] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0148] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0149] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0150] Memory may include non-permanent storage in a computer-readable storage medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable storage medium.
[0151] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable storage media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0152] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0153] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0154] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for routing network requests, It is characterized in that The method comprises: Receiving a network request; the network request is allocated and obtained according to a request allocation method corresponding to the network environment; Parsing the data packet carried in the network request to obtain the sending address information of the sending node and the destination address information of the destination node; Processing routing record information according to at least one of the sending address information and the destination address information to obtain a routing record; The data packet is sent according to the routing record.
2. The method for routing network requests according to claim 1, It is characterized in that The request allocation method includes at least one of the following: The network requests are allocated based on the weight values included in the network element information, based on the domain name resolution, or based on the URL list.
3. The method for routing network requests according to claim 2, It is characterized in that The allocating network requests based on the weight values included in the network element information includes: Sort the network element information based on the weight values included in the network element information to generate a network element information list; The network element information is selected in the network element information list according to the weight value, and the network request to be allocated is allocated to the server corresponding to the network element to which the selected network element information belongs.
4. The method for routing network requests according to claim 2, It is characterized in that The network request allocation based on domain name resolution includes: Parsing the network request to be allocated to obtain the domain name of the network request to be allocated; According to the network element information mapped to the domain name, the network request to be allocated is allocated to a server corresponding to the network element to which the network element information belongs.
5. The method for routing network requests according to claim 2, It is characterized in that The network request allocation based on the URL list includes: The URLs in the URL list apply for connection establishment with each server to obtain the server to establish the connection; The network request to be allocated is allocated to the server for establishing the connection.
6. The method for routing network requests according to claim 1, It is characterized in that The processing of routing record information according to at least one of the sending address information and the destination address information includes: Based on the destination address information, searching the first routing record table for matching routing record information; If found, the found route record information is used as the route record.
7. The method for routing network requests according to claim 1, It is characterized in that The processing of routing record information according to at least one of the sending address information and the destination address information includes: Searching the first routing record table for routing record information matching the destination address information; If not found, searching the second routing record table for incomplete routing record information matching the sending address information, and updating the routing table according to the found incomplete routing record information; The updated routing record information is queried in the routing table, and the queried updated routing record information is used as the routing record.
8. The method for routing network requests according to claim 7, It is characterized in that The updating of the routing table according to the incomplete routing record information obtained includes: Extracting information related to the sending address information from the incomplete routing record information, and creating the updated routing record information based on the information and the destination address information; Update the incomplete routing record information according to the updated routing record information, and add the updated routing record information to the first routing record table; The routing table is updated according to the updated first routing record table and the second routing record table.
9. The method for routing network requests according to claim 1, It is characterized in that The processing of the routing record information according to at least one of the sending address information and the destination address information, after the step of obtaining the routing record is executed, and before the step of sending the data packet according to the routing record is executed, includes: Detecting a status of an identifier of the routing record; If the flag is in an enabled state, executing a step of sending the data packet according to the routing record; If the flag is in a non-enabled state, the flag is converted from the non-enabled state to the enabled state, the routing record information is updated, and the updated routing record information is written into the routing table, and the updated routing record is extracted from the updated routing record information to perform the sending process of the data packet.
10. The method for routing network requests according to claim 1, It is characterized in that The sending node is a controllable node in the inner domain, and the destination node is an uncontrollable node in the outer domain; The controllable nodes include a server and a gateway with an interceptor deployed; the network request is intercepted and stored by the interceptor; The uncontrollable node includes a user terminal that submits the network request.
Citation Information
Patent Citations
Method for processing uplink message, device and system thereof
CN101527681A
Dynamic routing method, routing server and system for heterogeneous network
CN103428090A
Route transmission method for power line carrier communication
CN103973563A
Method and terminal for access control of network service
US20130022033A1
