Request processing method, data processing method, device, equipment and CDN system
By establishing a matching relationship between the target address and multiple destination addresses in the edge server, only a smaller number of target addresses are monitored, which solves the performance problem caused by the limited capacity of the hash table and improves communication performance and efficiency.
Patent Information
- Application Number
- CN202110064804.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-18
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-01-18
AI Technical Summary
In the existing technology, when the server monitors multiple destination addresses, the hash table capacity is limited, which affects monitoring performance and communication performance and affects communication delay.
By establishing a matching relationship between the target address and multiple destination addresses in the edge server, only a smaller number of target addresses are monitored, and matching target addresses are found in the storage structure to respond to access requests, thereby reducing the number of monitors and improving monitoring performance.
It improves monitoring performance and communication performance, reduces communication delay, and ensures access efficiency. It is unaware of the application layer and client, avoiding performance loss.
Smart Images

Figure CN113301099B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of network communication technology, and in particular to a request processing method, a data processing method, an apparatus, a device, and a CDN system. Background Art
[0002] When two parties communicate over the network, it is implemented based on ports at the transport layer. For example, when a client accesses a server, the IP address bound to the server can provide tens of thousands of ports, and each port of the IP address can provide services for the client to access. Currently, the server responds to the client's access request by listening to the destination address, where the destination address consists of an IP address and a port number. The client initiates an access request based on the IP address and port number requested for access. When the server confirms that the requested access is the listening destination address, it can respond to the access request.
[0003] In actual applications, the server may use multiple ports to provide services, so the number of destination addresses to be monitored will be more. The prior art uses a hash table to manage these destination addresses. When an access request is received, the hash table is searched based on the destination address requested for access. If the destination address exists in the hash table, it is considered that the destination address has been monitored, and the access request is responded to based on the destination address.
[0004] However, the hash table has limited capacity, which affects the monitoring performance and thus the communication performance. Summary of the invention
[0005] The embodiments of the present application provide a request processing method, a data processing method, an apparatus, a device and a system to solve the technical problems affecting communication performance in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a request processing method, including:
[0007] The edge server receives the access request and determines the first destination address requested for access;
[0008] Find a first target address that matches the first destination address;
[0009] Searching a storage structure based on the first target address; the storage structure stores at least one target address; a target address has a matching relationship with multiple destination addresses;
[0010] If the first target address exists in the storage structure, respond to the access request based on the first destination address.
[0011] In a second aspect, an embodiment of the present application provides a request processing method, including:
[0012] Receiving an access request and determining a first destination address requested for access;
[0013] Find a first target address that matches the first destination address;
[0014] Searching a storage structure based on the first target address; the storage structure stores at least one target address; a target address has a matching relationship with multiple destination addresses;
[0015] If the first target address exists in the storage structure, respond to the access request based on the first destination address.
[0016] In a third aspect, an embodiment of the present application provides a data processing method applied in a CDN system, including:
[0017] The edge server determines multiple destination addresses to be monitored;
[0018] Establishing a matching relationship between the multiple destination addresses and at least one target address; wherein one target address matches at least two destination addresses;
[0019] saving the at least one target address to a storage structure;
[0020] Wherein, the storage structure is used to monitor the target address.
[0021] In a fourth aspect, an embodiment of the present application provides a data processing method, including:
[0022] Determine multiple destination addresses to be monitored;
[0023] Establishing a matching relationship between the multiple destination addresses and at least one target address; wherein one target address matches at least two destination addresses;
[0024] saving the at least one target address to a storage structure;
[0025] Wherein, the storage structure is used to monitor the target address.
[0026] In a fifth aspect, an embodiment of the present application provides a request processing method, including:
[0027] Receive a Transmission Control Protocol (TCP) connection establishment request and determine a first destination address of the connection request;
[0028] Find a first target address that matches the first destination address;
[0029] Searching a storage structure based on the first target address; the storage structure stores at least one target address; a target address has a matching relationship with multiple destination addresses;
[0030] If the first target address exists in the storage structure, respond to the TCP connection establishment request based on the first destination address.
[0031] In a sixth aspect, an embodiment of the present application provides a request processing device, including:
[0032] A receiving module, used to receive an access request and determine the first destination address requested for access;
[0033] A search module, used to search for a first target address that matches the first destination address;
[0034] A monitoring module, configured to search a storage structure based on the first target address; the storage structure stores at least one target address; and a target address has a matching relationship with multiple destination addresses;
[0035] A response module is used to respond to the access request based on the first destination address if the first target address exists in the storage structure.
[0036] In a seventh aspect, an embodiment of the present application provides a data processing device, including:
[0037] A determination module, used to determine multiple destination addresses to be monitored;
[0038] A mapping module, used to establish a matching relationship between the multiple destination addresses and at least one target address; wherein one target address matches at least two destination addresses;
[0039] A monitoring establishment module, used for saving the at least one target address into a storage structure;
[0040] Wherein, the storage structure is used to monitor the target address.
[0041] In an eighth aspect, an embodiment of the present application provides a computing device, including a processing component and a storage component;
[0042] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the request processing method as described in the first aspect or the second aspect above.
[0043] In a ninth aspect, an embodiment of the present application provides a computing device, including a processing component and a storage component;
[0044] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the request processing method as described in the third aspect or the fourth aspect above.
[0045] In a tenth aspect, an embodiment of the present application provides a CDN system, including implementing the request processing method as described in the first aspect or the second aspect above.
[0046] In an embodiment of the present application, a matching relationship is established between multiple destination addresses provided by the destination and at least one destination address, so that one destination address can match at least two destination addresses, and the at least one destination address is stored in a storage structure as a monitoring address. When an access request is received, a first destination address that matches the first destination address determined in the access request is searched, and the first destination address is searched in the storage structure. If the first destination address exists, it can be considered that the monitoring of the first destination address is successful, so that the access request can be responded to based on the first destination address. In an embodiment of the present application, only a small number of target addresses need to be monitored, which improves the monitoring performance, thereby improving the communication performance and ensuring the access efficiency.
[0047] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 A flowchart of an embodiment of a request processing method provided by the present application is shown;
[0050] Figure 2 A schematic diagram of a scenario in which an embodiment of the present application is used in a practical application is shown;
[0051] Figure 3 A flow chart showing an embodiment of a data processing method provided by the present application is shown;
[0052] Figure 4 A flowchart of a request processing method in an actual application of an embodiment of the present application is shown;
[0053] Figure 5 A schematic diagram showing the structure of an embodiment of a request processing device provided by the present application is shown;
[0054] Figure 6 A schematic diagram showing the structure of an embodiment of a computing device provided by the present application is shown;
[0055] Figure 7A schematic diagram showing the structure of an embodiment of a data processing device provided by the present application is shown;
[0056] Figure 8 A structural schematic diagram of another embodiment of a computing device provided by the present application is shown. DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0058] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0059] The technical solution of the embodiment of the present application is applied to a transport layer communication scenario, for example, a transport layer communication scenario based on TCP (Transmission Control Protocol).
[0060] The transport layer is one of the key layers in the network architecture. It is responsible for providing data transmission services for the communication between the two communicating processes. Currently, the processes communicate through sockets. The destination address described in this article can refer to the socket address, which is composed of the IP (Internet Protocol) address plus the port number, and can be expressed in the form of IP address: port number. Since IP addresses can provide tens of thousands of ports for use, there are currently a maximum of 65535 ports. Taking the client accessing the server as an example, the server may use multiple ports to provide services, and then start multiple processes to provide services. The server will also listen to multiple destination addresses. In actual applications, the services provided by the server may include login services, download services, upload services, etc.
[0061] Combined with the description of the background technology, it can be known that the destination addresses that need to be monitored are currently managed by using a hash table. The monitoring operation is implemented by searching the hash table to see whether there is a destination address that is requested for access. Due to the limited capacity of the hash table, if the server monitors a large number of destination addresses, especially when the server is bound to multiple IP addresses and tens of thousands of ports of each IP address provide services, the number of monitored addresses may reach hundreds of thousands. As a result, the hash table search operation may be close to linear traversal, which affects the monitoring performance, and then affects the communication performance, resulting in communication delays.
[0062] The inventor found in the process of implementing the present application that if the method of increasing the capacity of the hash table is adopted to solve the problem of monitoring performance, it is necessary to modify the system kernel macro definition and recompile, which is not flexible enough and has poor availability. The inventor thought that if the number of monitoring can be reduced, the problem of monitoring performance can be solved, but it is necessary to ensure that services can be provided normally. Accordingly, the inventor has proposed the technical solution of the embodiment of the present application through a series of creative processes. In the embodiment of the present application, it is only necessary to monitor a small number of target addresses to meet normal access, improve monitoring performance, and then improve communication performance, ensure transmission efficiency, and the application layer and the source end are not perceived, and no performance loss will be caused.
[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0064] Figure 1 This is a flowchart of an embodiment of a request processing method provided by the present application. The method may include the following steps:
[0065] 101: Receive an access request and determine the first destination address requested for access.
[0066] The technical solution of this embodiment is executed by the destination end of the two communicating parties, that is, the request receiving end. In practical applications, the destination end can specifically refer to the server end, and the access request is sent by the source end of the two communicating parties, that is, the request sending end. In practical applications, the source end can refer to the client end. For the sake of ease of understanding and explanation, in one or more embodiments below, the technical solution of this application is mainly described by taking the source end as the client and the destination end as the server end as an example. In addition, in practical applications, the technical solution of this embodiment can be specifically implemented by the system kernel of the server end, and the system kernel can adopt the Linux (an operating system) kernel.
[0067] Based on the IP address and port number in the access request, the first destination address can be determined. From the introduction of the basic concepts in the previous article, it can be seen that the destination address can refer to the socket address, and the process between the client and the server is based on the socket to achieve communication.
[0068] It should be noted that the method in which the client uses the port to initiate an access request is the same as that in the prior art and will not be described in detail here.
[0069] It should be noted that the “first” in the first destination address is only for descriptive distinction and does not represent any other meaning.
[0070] The access request is determined based on different transport layer protocols, taking the currently common TCP and UDP (User Datagram Protocol) as examples:
[0071] For TCP-based communication scenarios, a connection needs to be established between the client and the server first, and data transmission can be performed based on the established request. Therefore, the access request may specifically refer to a connection establishment request initiated by the client to request to establish a TCP connection with the server.
[0072] For UDP-based communication scenarios, there is no need to establish a connection between the client and the server, and the access request can specifically refer to a data transmission request.
[0073] In actual applications, due to the TCP-based communication scenario, a TCP connection needs to be established, and the TCP connection needs to be implemented through a relatively complex three-way handshake. When the server monitors a large number of destination addresses, the impact on the TCP connection establishment efficiency is more prominent. Therefore, when the technical solution of the embodiment of the present application is applied to the TCP communication scenario, it can effectively improve the TCP transmission performance and reduce the TCP transmission delay.
[0074] 102: Find a first target address that matches the first destination address.
[0075] In the embodiment of the present application, there is a matching relationship between a target address and multiple destination addresses. The matching relationship is created in advance and will be described in detail in the following embodiment.
[0076] Based on the pre-created matching relationship, it is possible to find out whether there is a first target address that matches the first target address. It is understandable that the first target address is only one of the target addresses that the first target address matches. In the embodiment of the present application, one target address is mapped to at least two target addresses to establish a matching relationship. In actual applications, all the target addresses opened by the server can be matched with one target address, which can effectively improve the monitoring performance.
[0077] It should be noted that the “first” in the first target address is only for descriptive distinction, so that the first target address represents the target address matched by the first destination address, and has no other meaning.
[0078] 103: Search a storage structure based on the first target address.
[0079] In practical applications, the storage structure may refer to a hash table, and of course may also be other data structures with storage and search functions, which is not limited in this application.
[0080] Among them, at least one target address is stored in the storage structure; the at least one target address is mapped by a large number of destination addresses that actually need to be monitored, so that the server only needs to monitor the target address in the storage structure. Since one target address corresponds to multiple destination addresses, the number of monitoring is greatly reduced.
[0081] In actual applications, the destination address refers to the socket address. When the server opens a port to provide services, the function socket() will create a corresponding socket. The function bind() is used to bind the IP address and port number to the socket to obtain the socket address. After that, the function listen() can be used to store the socket address in the listening storage structure for listening. When an access request is received, the socket address is searched from the storage structure. In this embodiment, multiple socket addresses are mapped to a virtual socket address, so that the monitoring of multiple socket addresses becomes just listening to this virtual socket address, which reduces the number of monitoring and improves the monitoring performance.
[0082] 104: If the first target address exists in the storage structure, respond to the access request based on the first destination address.
[0083] Optionally, the access request may be responded to using a socket of the first destination address.
[0084] Among them, if the first target address exists in the storage structure, it can be considered that the first destination address is successfully monitored, and then the access request is specifically responded to based on the first destination address. In this way, the application layer and the client do not know the first target address, and still use the first destination address for communication, which is convenient for business differentiation and realizes imperceptible monitoring of the application layer and the client, without additional performance losses. This embodiment improves monitoring performance, ensures communication performance, reduces communication delay, and at the same time ensures normal operation of the business.
[0085] If the first target address does not exist in the storage structure, the access request is considered to be an abnormal access and can be discarded without responding.
[0086] Furthermore, in some embodiments, if no target address matching the first destination address is found, a storage structure may be searched based on the first destination address;
[0087] If the first destination address exists in the storage structure, the access request is responded to based on the first destination address.
[0088] In some embodiments, searching for a first target address that matches the first destination address may include:
[0089] Based on the matching conditions in different matching rules, searching for a target matching rule hit by the first destination address;
[0090] According to the execution action configured in the target matching rule, the first destination address is mapped to the first target address configured in the target matching rule.
[0091] Each matching rule is configured with a target address, and the execution action is used to indicate the mapping to the target coordinates. The matching condition defines multiple destination addresses that have a matching relationship with the target address. The specific configuration method of the matching rule will also be described in detail in the following embodiments.
[0092] As can be seen from the foregoing description, the access request may refer to a TCP connection establishment request. In some embodiments, responding to the access request based on the first destination address may include:
[0093] Establishing a network connection with the source end based on the listening socket of the first destination end address;
[0094] Creating a connection socket based on the first destination address;
[0095] Use the connection socket to communicate with the source end over the network.
[0096] The listening socket is used for monitoring and establishing a connection. After the network connection is established, the server can create a connection socket and use the connection socket to communicate with the source end over the network, that is, to transmit data, while the listening socket can continue to perform the monitoring operation without having to be recreated. In actual applications, the accept() function can be used to create a connection socket. In order to ensure transparency to the application layer and unaware of the first target address, the connection socket is created based on the first target address, so that the connection socket can return the first target address to the application layer. The application layer will then believe that the client is accessing the first target address, ensuring that the first target address is completely unaware, and the processing mechanism is the same as the original method.
[0097] In a practical application, the technical solution of the embodiment of the present application can be applied to a communication scenario that uses a CDN (Content Delivery Network) system for dynamic data acceleration. The traditional static data acceleration method is to cache the static data of the real server on the edge node of the CDN system so that users can access it nearby, thereby improving the access speed. As the dynamic data is dynamically generated by the real server, the real-time requirement is high and it cannot be cached at the edge node. A dynamic data acceleration method can be used, that is, by finding the optimal node path among multiple nodes (including edge nodes, intermediate nodes, etc.) in combination with network performance, the client can achieve communication interaction with the real server through the nodes on the optimal node path, such as requesting to obtain data. The CDN system can realize data acceleration for accessing different real servers. The user only needs to provide the domain name corresponding to the IP address of the real server. To use the CDN system for data acceleration, the client first needs to access the edge node of the CDN system. At the edge node, multiple ports will be used for accessing different domain names, and multiple processes will be started. Therefore, a destination address will be monitored for each domain name. When the CDN system accesses more domain names, the more destination addresses will be monitored at the edge node. Therefore, there will be problems with monitoring performance, which will affect communication performance and ultimately access response speed. The technical solution of the embodiment of the present application can solve the problem of monitoring performance. The use of the CDN system for dynamic data acceleration can be applied to multiple fields, such as finance, games, medical care, e-commerce, multimedia, etc., and the edge node can improve the access response speed by using the technical solution of the present application, further improving the access speed.
[0098] exist Figure 2 In the scenario diagram shown, the client 201 can initiate an access request based on the target domain name corresponding to the real server 200 requested for access, and the access request will first map the domain name to the corresponding first destination address via DNS202, so that the access request can be sent to the corresponding edge node 203 based on the first destination address. The edge node 203 can first search for the first destination address corresponding to the first destination address according to the technical solution of this embodiment, and then search for the first destination address in the storage structure. If the first destination address exists in the storage structure, the access request can be responded to based on the first destination address. In the case where the access request is a TCP connection, a three-way handshake method will be used to establish a TCP connection with the client 201. The response packet in the three-way handshake process uses the first destination address, so that the client 201 is not aware of it, ensuring normal access. Among them, the response operation of the edge node 203 to the access request based on the first destination address is the same as the existing method, and will not be repeated here.
[0099] In the actual application, receiving the access request and determining the first destination address may include:
[0100] An access request sent by a source end is received, and a first destination end address is determined; wherein the first destination end address is obtained by mapping a target domain name based on the access request of the source end.
[0101] Mapping the target domain name to the corresponding first destination address may be implemented by a domain name system. After sending an access request, the client may first request the domain name system to search for the first destination address corresponding to the target domain name.
[0102] Figure 3 This is a flowchart of an embodiment of a data processing method provided by the present application. The method may include the following steps:
[0103] 301: Determine multiple destination addresses to be monitored.
[0104] Among them, the multiple destination addresses to be monitored can change according to actual conditions. When the server opens a port to provide services, a destination address to be monitored will be generated accordingly.
[0105] 302: Establish a matching relationship between multiple destination addresses and at least one target address.
[0106] One target address matches at least two destination addresses.
[0107] Optionally, the multiple target end addresses may establish a matching relationship with the same target address.
[0108] Since a server may be bound to multiple IP addresses, for the convenience of management, optionally, a matching relationship may be established between multiple destination addresses of the same IP address and the same target address.
[0109] Of course, the specific matching of a target address with several destination addresses can be set based on actual business conditions.
[0110] 303: Save at least one target address into a storage structure.
[0111] The storage structure is used to monitor the target address. The target address is used to convert the destination address in the access request.
[0112] In this embodiment, by establishing a matching relationship between multiple destination addresses and at least one target address, it is possible to monitor only the target address. After receiving an access request, the target address that matches the destination address in the request is first determined, and the target address is searched from the storage structure. If the target address is monitored successfully, the access request is responded to based on the destination address. Since the number of monitoring can be reduced compared to monitoring the destination address, the monitoring performance can be improved to ensure communication performance.
[0113] The specific monitoring method for the storage structure can be found in the above embodiments and will not be described in detail here.
[0114] In some embodiments, establishing a matching relationship between multiple destination addresses of the same IP address and the same target address may include:
[0115] Set an address set based on the port range to be listened on the same IP address;
[0116] Create a matching rule by using an address set as a matching condition and setting an action based on the target address that the IP address matches.
[0117] The execution action is used to instruct to convert the destination address that meets the matching condition into the target address.
[0118] When the server is implemented using the Linux kernel, IPTABLES can be used to create matching rules. IPTABLES is used to set, maintain and check the IP packet filtering rules of the Linux kernel. The matching rules also refer to the IPTABLES rules. The address set can be implemented using IPSET, where IPSET is an extension of IPTABLES, so that IPSET can create rules that match the entire address set.
[0119] When using IPTABLES and IPSET to create matching rules, suppose that 10,000 ports from 10,000 to 19,999 on the IP address 1.1.1.1 are matched with a target address 127.0.0.1:10000. Then only the following commands are needed to set the matching rules:
[0120] ipset create tcp:1.1.1.1bitmap:port range 1-65535;
[0121] ipset add portSet 10000-19999;
[0122] iptables -t mangle -A PREROUTING -p tcp -d 1.1.1.1-m set --match-set tcp:1.1.1.1dst -j TPROXY--on-ip 127.0.0.1--on-port 10000.
[0123] As can be seen from the foregoing description, the technical solution of the embodiment of the present application can be applied to a communication scenario based on TCP, and the technical solution of the embodiment of the present application can achieve the purpose of TCP acceleration. Therefore, the present application also provides a request processing method, which may include:
[0124] Receive a TCP connection establishment request and determine a first destination address;
[0125] Find a first target address that matches the first destination address;
[0126] Searching a storage structure based on a first target address; the storage structure stores at least one target address; a target address has a matching relationship with multiple destination addresses;
[0127] If the first target address exists in the storage structure, respond to the TCP connection establishment request based on the first destination address.
[0128] For ease of understanding, the technical solution of the present application is introduced below with an example. It is still assumed that the 10,000 ports from 10000 to 19999 on the IP address 1.1.1.1 are matched with a target address 127.0.0.1:10000. It is assumed that the destination address requested by the client is 1.1.1.1:15000. Figure 4 As shown in , the request processing process can be as follows:
[0129] 401: Receive a TCP connection establishment request and determine the first destination address 1.1.1.1:15000.
[0130] Among them, 1.1.1.1 is the IP address and 15000 is the port number
[0131] 402: Search for matching rules based on 1.1.1.1:15000 to determine whether the target matching rules are hit. If so, execute step 403; if not, execute step 407.
[0132] 403: Determine the first target address 127.0.0.1:10000 in the target matching rule.
[0133] 404: Check whether 127.0.0.1:10000 exists in the listening hash table. If yes, go to step 405. If not, end the process.
[0134] 405: Use 1.1.1.1:15000 to respond to the connection request.
[0135] The connection establishment process adopts a three-way handshake mode, and the response packet of the server uses 1.1.1.1:15000. The specific process of the three-way handshake is the same as that of the prior art, and will not be repeated here.
[0136] 406: Connection established, using 1.1.1.1:15000 for data transmission.
[0137] Among them, after the connection is established, a connection socket corresponding to 1.1.1.1:15000 will be created, because the connection socket realizes data transmission.
[0138] 407: Check whether 1.1.1.1:15000 exists in the hash table. If so, execute step 405. If not, end the process.
[0139] When the technical solution of the embodiment of the present application is applied in a TCP communication scenario, TCP acceleration can be achieved, TCP transmission performance can be improved, and transmission delay can be reduced.
[0140] Figure 5 A schematic diagram of a structure of an embodiment of a request processing device provided in an embodiment of the present application, the device may include:
[0141] The receiving module 501 is used to receive an access request and determine the first destination address requested for access;
[0142] A search module 502 is used to search for a first target address that matches the first destination address;
[0143] The monitoring module 503 is used to search the storage structure based on the first target address; the storage structure stores at least one target address; a target address has a matching relationship with multiple destination addresses;
[0144] The response module 504 is configured to respond to the access request based on the first destination address if the first destination address exists in the storage structure.
[0145] In some embodiments, the search module can be specifically used to search for a target matching rule hit by the first destination address based on matching conditions in different matching rules; and map the first destination address to the first target address configured in the target matching rule according to the execution action configured in the target matching rule.
[0146] In some embodiments, the monitoring module may be specifically configured to respond to the access request using a socket of the first destination address if the first destination address exists in the storage structure.
[0147] In some embodiments, the monitoring module is further configured to search the storage structure based on the first destination address if no target address matching the first destination address is found;
[0148] The response module is further configured to respond to the access request based on the first destination address if the first destination address exists in the storage structure.
[0149] In some embodiments, the access request is a TCP connection request; the response module is specifically used to establish a network connection with the source end based on the listening socket of the first destination address; create a connection socket based on the first destination address; and use the connection socket to communicate with the source end over the network.
[0150] In some embodiments, the receiving module may be specifically used to receive an access request sent by a source end and determine a first destination end address; wherein the first destination end address is obtained by mapping a target domain name requested to be accessed by the source end.
[0151] In an actual application, the access request may be a TCP connection establishment request.
[0152] Figure 5 The request processing device can execute Figure 1 The implementation principle and technical effect of the request processing method described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the request processing device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.
[0153] In one possible design, Figure 5 The request processing device of the illustrated embodiment may be configured in a computing device, such as Figure 6 As shown, the computing device may include a storage component 601 and a processing component 602;
[0154] The storage component 601 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 602 to implement the request processing method as described in any of the above embodiments.
[0155] Of course, a computing device may also include other components, such as input / output interfaces, communication components, etc.
[0156] The input / output interface provides an interface between the processing component and the peripheral interface module, and the above-mentioned peripheral interface module can be an output device, an input device, etc.
[0157] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.
[0158] In practical applications, the computing device may be a remote web server, a server, a computer networking device, a chipset, a desktop computer, a notebook computer, a workstation, or any other processing device or equipment. When the computing device is a physical machine, the server mentioned above may be composed of one or more computing devices, and the server schedules the computing device to implement the request processing method described in any of the above embodiments through the load balancing principle.
[0159] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The request processing method of the illustrated embodiment.
[0160] Figure 7 A schematic diagram of a data processing device according to an embodiment of the present application is provided. The device may include:
[0161] A determination module 701 is used to determine multiple destination addresses to be monitored;
[0162] A mapping module 702, configured to establish a matching relationship between multiple destination addresses and at least one target address; wherein one target address matches at least two destination addresses;
[0163] A monitoring establishment module 703, used to save at least one target address into a storage structure;
[0164] Among them, the storage structure is used to monitor the target address.
[0165] In some embodiments, the mapping module is specifically used to establish a matching relationship between multiple destination addresses of the same IP address and the same target address.
[0166] In some embodiments, the mapping module is specifically used to set an address set based on multiple ports of the same IP address; use the address set as a matching condition, and set an execution action based on a target address matched by the IP address to create a matching rule.
[0167] Figure 7 The request processing device can execute Figure 3 The implementation principle and technical effect of the data processing method described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the request processing device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.
[0168] In one possible design, Figure 7 The request processing device of the illustrated embodiment may be configured in a computing device, such as Figure 8As shown, the computing device may include a storage component 801 and a processing component 802;
[0169] The storage component 801 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 802 to implement the data processing method as described in any of the above embodiments.
[0170] Of course, a computing device may also include other components, such as input / output interfaces, communication components, etc.
[0171] The input / output interface provides an interface between the processing component and the peripheral interface module, and the above-mentioned peripheral interface module can be an output device, an input device, etc.
[0172] The communication component is configured to facilitate, among other things, wired or wireless communications between the computing device and other devices.
[0173] In practical applications, the computing device may be a remote web server, a server, a computer networking device, a chipset, a desktop computer, a notebook computer, a workstation, or any other processing device or equipment. Figure 8 The computing device shown is Figure 6 The computing devices shown may be the same device, or may be different devices.
[0174] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 3 The data processing method of the illustrated embodiment.
[0175] In addition, an embodiment of the present application also provides a CDN system, including an edge server that implements the request processing method described in any of the above embodiments or the data processing method described in any of the above embodiments.
[0176] Accordingly, the embodiment of the present application further provides a request processing method applied in a CDN system, including:
[0177] The edge server receives the access request and determines the first destination address requested for access;
[0178] Find a first target address that matches the first destination address;
[0179] Searching a storage structure based on the first target address; the storage structure stores at least one target address; a target address has a matching relationship with multiple destination addresses;
[0180] If the first target address exists in the storage structure, respond to the access request based on the first destination address.
[0181] The access request may be sent by the client, and the edge server may refer to Figure 2 An edge node in the illustrated embodiment.
[0182] In addition, the embodiment of the present application also provides a data processing method applied in a CDN system, including:
[0183] The edge server determines multiple destination addresses to be monitored;
[0184] Establishing a matching relationship between the multiple destination addresses and at least one target address; wherein one target address matches at least two destination addresses;
[0185] saving the at least one target address to a storage structure;
[0186] Wherein, the storage structure is used to monitor the target address.
[0187] The processing components involved in the above corresponding embodiments may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing components can also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0188] The storage component is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0189] In addition, the embodiment of the present application also provides a CDN system, which includes an edge server that implements the request processing method described in any of the above embodiments. The edge server may refer to Figure 2 The edge nodes shown in .
[0190] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0191] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0192] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0193] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A request processing method applied in CDN, characterized in that: include: The edge server receives the access request and determines the first destination address requested for access; Find a first target address that matches the first destination address; searching a storage structure based on the first target address; The storage structure stores at least one target address; A target address has a matching relationship with multiple destination addresses; If the first target address exists in the storage structure, respond to the access request based on the first destination address.
2. A request processing method, characterized in that: include: Receiving an access request and determining a first destination address requested for access; Find a first target address that matches the first destination address; searching a storage structure based on the first target address; The storage structure stores at least one target address; A target address has a matching relationship with multiple destination addresses; If the first target address exists in the storage structure, respond to the access request based on the first destination address.
3. The method according to claim 2, characterized in that The step of searching for a first target address that matches the first destination address includes: Based on the matching conditions in different matching rules, searching for a target matching rule hit by the first destination address; According to the execution action configured in the target matching rule, the first destination address is mapped to the first target address configured in the target matching rule.
4. The method according to claim 2, characterized in that: If the first target address exists in the storage structure, responding to the access request based on the first destination address includes: If the first target address exists in the storage structure, the access request is responded to using the socket of the first destination address.
5. The method according to claim 2, characterized in that: Also includes: If no target address matching the first destination address is found, searching the storage structure based on the first destination address; If the first destination address exists in the storage structure, respond to the access request based on the first destination address.
6. The method according to claim 2, characterized in that The access request is a TCP connection request; and the responding to the access request based on the first destination address includes: Establishing a network connection with the source end based on the listening socket of the first destination end address; Creating a connection socket based on the first destination address; The connection socket is used to perform network communication with the source end.
7. The method according to claim 2, characterized in that The receiving the access request and determining the first destination address includes: Receive an access request sent by a source end, and determine a first destination end address requested for access; wherein the first destination end address is obtained by mapping a target domain name based on the source end request for access.
8. A data processing method applied in a CDN system, characterized in that: include: The edge server determines multiple destination addresses to be monitored; Establishing a matching relationship between the multiple destination addresses and at least one target address; wherein one target address matches at least two destination addresses; saving the at least one target address to a storage structure; Wherein, the storage structure is used to monitor the target address.
9. A data processing method, characterized in that: include: Determine multiple destination addresses to be monitored; Establishing a matching relationship between the multiple destination addresses and at least one target address; wherein one target address matches at least two destination addresses; saving the at least one target address to a storage structure; Wherein, the storage structure is used to monitor the target address.
10. The method according to claim 9, characterized in that The establishing a matching relationship between the multiple destination addresses and at least one target address includes: Establish a matching relationship between multiple destination addresses of the same IP address and the same target address.
11. The method according to claim 10, characterized in that The establishing of a matching relationship between multiple destination addresses of the same IP address and the same target address includes: Set up address sets based on multiple ports on the same IP address; The address set is used as a matching condition, and an execution action is set based on a target address matched by the IP address to create a matching rule.
12. A request processing method, characterized in that: include: Receive a Transmission Control Protocol (TCP) connection establishment request and determine a first destination address of the connection request; Find a first target address that matches the first destination address; searching a storage structure based on the first target address; The storage structure stores at least one target address; A target address has a matching relationship with multiple destination addresses; If the first target address exists in the storage structure, respond to the TCP connection establishment request based on the first destination address.
13. A request processing device, characterized in that: include: A receiving module, used to receive an access request and determine the first destination address requested for access; A search module, used to search for a first target address that matches the first destination address; A monitoring module, configured to search for a storage structure based on the first target address; The storage structure stores at least one target address; A target address has a matching relationship with multiple destination addresses; A response module is used to respond to the access request based on the first destination address if the first target address exists in the storage structure.
14. A data processing device, characterized in that: include: A determination module, used to determine multiple destination addresses to be monitored; A mapping module, used to establish a matching relationship between the multiple destination addresses and at least one target address; wherein one target address matches at least two destination addresses; A monitoring establishment module, used for saving the at least one target address into a storage structure; Wherein, the storage structure is used to monitor the target address.
15. A computing device, characterized in that: including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the request processing method as described in any one of claims 2 to 7.
16. A computing device, characterized in that including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the data processing method as described in any one of claims 9 to 11.
17. A CDN system, comprising an edge server implementing the request processing method according to any one of claims 2 to 7.
