Data processing method, device and system and electronic equipment
By configuring multiple IP addresses for network devices and utilizing tunnel encapsulation and policy routing, software-level data forwarding is achieved, solving the problem of high hardware equipment costs and improving scalability and speed.
Patent Information
- Application Number
- CN202310418361.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-14
- Publication Date
- 2024-10-29
AI Technical Summary
Existing network third-line data processing methods rely on hardware firewalls or routers, resulting in high deployment costs.
By configuring at least two network cards for network devices, each with a different IP address, tunnel encapsulation and policy routing are used to implement data forwarding at the software level, avoiding the use of hardware devices.
It implements a software-based solution for data forwarding, reduces hardware deployment costs, and avoids network devices becoming traffic bottlenecks through the forwarding characteristics of IP tunnel mode, greatly increasing expansion capabilities and speed.
Smart Images

Figure CN118869656A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data processing method, device, system and electronic device. Background Art
[0002] The so-called three network lines refer to the line access of the three major operators, China Telecom, China Unicom and China Mobile. As for the data processing of the three network lines, the commonly used data processing method is usually hardware firewalls or routers to realize the forwarding of three-line data, but the hardware deployment cost of using hardware firewalls or routers is high. Summary of the invention
[0003] In view of this, embodiments of the present application provide a data method, device, system and electronic device to implement data forwarding through software and reduce hardware deployment costs.
[0004] According to a first aspect of an embodiment of the present application, a data processing method is provided, the method being applied to a network device, the network device being configured with at least two network cards, each network card being configured with a corresponding IP address, and different network cards having different IP addresses; the method comprising:
[0005] receiving a first request sent by a user terminal; the first request is sent by the user terminal based on a target service corresponding to a target network card, a source IP address of the first request is an IP address of the user terminal, and a destination IP address is an IP address of the target network card; the target network card is one of the network cards configured in the network device;
[0006] Based on the tunnel between the network device and the target service server corresponding to the target network card in the external network, convert the first request into a second request; the second request carries the first request, and the second request has a tunnel encapsulation header, the source IP address of the tunnel encapsulation header is the IP address of the network device, and the destination IP address is the IP address of the target service server;
[0007] The second request is sent to the target business server through the tunnel, so that the target business server sends a response message to the user terminal through the public network based on the source IP address in the first request carried by the second request and the determined policy routing; the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
[0008] According to a second aspect of an embodiment of the present application, a data processing device is provided, the device being applied to a network device, the network device being configured with at least two network cards, each network card being configured with a corresponding IP address, and different network cards having different IP addresses; the device comprising:
[0009] a first request receiving module, configured to receive a first request sent by a user terminal; the first request is sent by the user terminal based on a target service corresponding to a target network card, a source IP address of the first request is an IP address of the user terminal, and a destination IP address is an IP address of a target network card; the target network card is one of the network cards configured for the network device;
[0010] an encapsulation module, configured to convert the first request into a second request based on a tunnel between the network device and a target service server corresponding to the target network card in an external network; the second request carries the first request, and the second request has a tunnel encapsulation header, the source IP address of the tunnel encapsulation header is the IP address of the network device, and the destination IP address is the IP address of the target service server;
[0011] A response module is used to send the second request to the target business server through the tunnel, so that the target business server sends a response message to the user terminal through the public network based on the source IP address in the first request carried by the second request and the determined policy routing; the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
[0012] According to a third aspect of an embodiment of the present application, there is provided a data processing system, comprising: a user terminal, a network device, and a target service server, wherein the network device is configured with at least two network cards, each network card is configured with a corresponding IP address, and different network cards have different IP addresses;
[0013] The user terminal is used to send a first request to the network device; the first request is sent based on the target service corresponding to the target network card, the source IP address of the first request is the IP address of the user terminal, and the destination IP address is the IP address of the target network card; the target network card is one of the network cards configured in the network device;
[0014] The network device is used to execute the method according to the first aspect;
[0015] The target business server is used to send a response message to the user terminal through the public network based on the determined policy routing and based on the source IP address in the first request carried by the second request when receiving the second request; the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
[0016] According to a fourth aspect of an embodiment of the present application, there is provided an electronic device, the electronic device comprising: a processor and a memory;
[0017] Wherein, the memory is used to store machine executable instructions;
[0018] The processor is used to read and execute the machine executable instructions stored in the memory to implement the method as described in the first aspect.
[0019] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0020] In the embodiment of the present application, by configuring a different IP address for each network card of the network device, when the network device receives the first request sent by the user terminal, the encapsulated second request is sent to the target service server through the tunnel between the network device and the target service server corresponding to the target network card in the external network, so that the target service server sends a response message to the user terminal through the public network based on the source IP address and the destination IP address in the first request carried by the second request, and data forwarding is realized through software through policy routing, without the need for hardware devices such as firewalls or routers, thereby reducing hardware deployment costs;
[0021] Furthermore, the forwarding characteristics of the IP tunnel mode enable the response message returned by the target service server to the user terminal to be directly returned to the user terminal without passing through the network device, thereby realizing the sinking of policy routing to the back-end service server. The network forwarding capacity depends on the number of back-end service servers, which greatly increases the expansion capacity and speed, and avoids the network device becoming a bottleneck for traffic forwarding. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flow chart of a data processing method shown in an embodiment of the present application.
[0023] Figure 2 This is an example diagram of three-line forwarding shown in an embodiment of the present application.
[0024] Figure 3 This is an example diagram of message encapsulation provided in an embodiment of the present application.
[0025] Figure 4 This is an example diagram of the networking of the LVS-Tun mode shown in an embodiment of the present application.
[0026] Figure 5 It is a block diagram of a data processing device shown in an embodiment of the present application.
[0027] Figure 6 It is a block diagram of a data processing system shown in an embodiment of the present application.
[0028] Figure 7 It is an example block diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0029] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0030] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0031] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0032] Next, the embodiments of this specification are described in detail.
[0033] See also Figure 1 , Figure 1 The method is applied to a network device, where the network device is a device with load balancing capability, such as a Linux virtual server LVS device, etc., and the embodiment of the present application does not specifically limit this.
[0034] In this embodiment, the network device is configured with at least two network cards, each of which is configured with a corresponding IP address and different network cards have different IP addresses. For example, for domestic Internet operators China Telecom, China Mobile and China Unicom, each operator has a large number of users, and the operators are not interoperable. Figure 2 As shown, three network cards are configured on the network device (LVS device), namely network card e1, network card e2, and network card e3. Among them, network card e1 is configured as a telecom network card, network card e2 is configured as a Unicom network card, and network card e3 is configured as a mobile network card. Requests sent by telecom user terminals are forwarded through network card e1, requests sent by Unicom user terminals are forwarded through network card e2, and requests sent by mobile user terminals are forwarded through network card e3.
[0035] like Figure 2 As shown, in order to ensure data transmission reliability, in this embodiment, two network devices (LVS devices) are configured. The two LVS devices are master and backup devices for each other, and their information is synchronized.
[0036] In this embodiment, the network device is deployed at the exit of the intranet accessing the extranet. Here, the intranet refers to the local area network where the user terminal is located, and the extranet refers to the public network.
[0037] like Figure 1 As shown, the process may include the following steps:
[0038] S110: receiving a first request sent by a user terminal; the first request is sent by the user terminal based on a target service corresponding to a target network card, where the target network card is one of the network cards configured in the network device.
[0039] Exemplarily, in this embodiment, the user terminal may be a telecommunications user terminal, a mobile user terminal, or a Unicom user terminal, which is not specifically limited in the embodiment of the present application.
[0040] In this embodiment, the above-mentioned first request is used to request business data of the target service. Here, the target service is determined according to the user terminal. When the user terminal is a mobile user terminal, the target service is a mobile service. When the user terminal is a China Unicom user terminal, the target service is a China Unicom service. Correspondingly, the target network card also corresponds to the user terminal. When the user terminal is a China Telecom user terminal, the target network card is a China Telecom network card. When the user terminal is a mobile user terminal, the target network card is a mobile network card. When the user terminal is a China Unicom user terminal, the target network card is a China Unicom network card. That is, the user terminal, the target network card and the target service are corresponding.
[0041] In this embodiment, the source IP address of the first request is the IP address of the user terminal, and the destination IP address is the IP address of the target network card. Here, the IP address of the target network card is obtained by the user terminal by sending a domain name resolution request to the DNS server. Specifically, the user terminal sends a domain name resolution request to the DNS server based on the target network card. When the DNS domain name server receives the domain name resolution request, it resolves it based on its own domain name resolution method, and sends the IP address of the target network card obtained by resolution to the user terminal. After the user terminal receives the IP address of the target network card, it constructs a first request based on the IP address of the user terminal itself and the IP address of the target network card and sends it.
[0042] S120: Based on the tunnel between the network device and the target business server corresponding to the target network card in the external network, convert the first request into a second request; the second request carries the first request, and the second request has a tunnel encapsulation header, the source IP address of the tunnel encapsulation header is the IP address of the network device, and the destination IP address is the IP address of the target business server.
[0043] Exemplarily, in this embodiment, for each target network card, it corresponds to at least one service server in the external network. Here, there can be many types of service servers, such as WEB servers, MATL servers, FTP servers, DNS servers, video servers, etc., which are not specifically limited in the embodiments of the present application.
[0044] In this embodiment, the target service server is one of the service servers corresponding to the target network card. As for how to determine the target service server, the following embodiment provides an example description, which will not be repeated here.
[0045] Exemplarily, in this embodiment, the tunnel between the network device and the target server is an IP tunnel, and converting the first request into the second request is specifically to use the first request as the kernel of the second request, and to add a tunnel encapsulation header to the kernel. Here, the source IP address is the IP address of the network device, and the destination IP address is the IP address of the target business server.
[0046] Figure 3 The figure shows a specific example of message encapsulation. Figure 3 As shown, for the first request, the first request is used as the kernel and encapsulated, that is, a tunnel encapsulation header is added to the first request to obtain the second request, and the source IP address of the tunnel encapsulation header is the IP address of the network device (that is, Figure 3 VIP in the target business server (i.e. Figure 3 The first request with the added source IP address is encapsulated using the Srv VIP in the target business server as the destination IP address to obtain a second request, and the second request is sent to the target business server. After receiving the second request, the target business server decapsulates the second request to obtain the first request.
[0047] S130: Send a second request to the target business server through the tunnel, so that the target business server sends a response message to the user terminal through the public network based on the source IP address in the first request carried in the second request and the determined policy routing; the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
[0048] Exemplarily, in this embodiment, the network device sends a second request to the target business server through the above-mentioned tunnel. After receiving the second request, the target business server parses the second request to obtain the first request, and sends a response message to the user terminal based on the first request. Here, the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
[0049] Due to the characteristics of the IP tunnel mode, the response message sent by the target service server to the user terminal will not pass through the network device, but will be sent directly to the user terminal, thus avoiding the network device from becoming a traffic bottleneck.
[0050] Figure 4 The following is a sample diagram of the VS-Tun mode network: Figure 4 As shown, the user terminal and the network equipment ( Figure 4 The Linux Director in the network is connected to multiple business servers ( Figure 4 Real Server 1, Real Server 2, ... Real Server n), the user terminal sends a first request to the network device ( Figure 4 Request in , when the network device matches the first request to Real Server n, Real Server n directly feeds back the response message to the user terminal without going through the network device.
[0051] So far, completed Figure 1 Description of the process shown.
[0052] pass Figure 1 It can be seen from the process shown that in the embodiment of the present application, by configuring a different IP address for each network card of the network device, when the network device receives the first request sent by the user terminal, the encapsulated second request is sent to the target business server through the tunnel between the network device and the target business server corresponding to the target network card in the external network, so that the target business server sends a response message to the user terminal through the public network based on the source IP address and the destination IP address in the first request carried by the second request, and data forwarding is realized through software through policy routing, without the need for hardware devices such as firewalls or routers, thereby reducing hardware deployment costs;
[0053] Furthermore, the forwarding characteristics of the IP tunnel mode enable the response message returned by the target service server to the user terminal to be directly returned to the user terminal without passing through the network device, thereby realizing the sinking of policy routing to the back-end service server. The network forwarding capacity depends on the number of back-end service servers, which greatly increases the expansion capacity and speed, and avoids the network device becoming a bottleneck for traffic forwarding.
[0054] As an optional implementation of the embodiment of the present application, the second request carries the MAC address of the target network card; sending a response message to the user terminal through the public network based on the determined policy routing includes:
[0055] First, determine the policy route that matches the MAC address of the target network card from the configured policy routes;
[0056] Secondly, based on the matching policy routing, a response message is sent to the user terminal through the public network.
[0057] Exemplarily, in this embodiment, policy routing is configured in advance for requests transmitted from each network card.
[0058] In this embodiment, after obtaining the second request, the second request is parsed to obtain the first request, which carries the MAC address of the target network card. The MAC address of the target network card is used as a keyword, and a policy route that matches the MAC address of the target network card is determined from the configured policy routes, and a response message is sent to the user terminal through the public network through the matched policy route.
[0059] As an embodiment of the present application, after obtaining the MAC address of the target network card, iptables is used to perform routing marking on the first request based on the MAC address, and a policy route matching the marking information is determined from the configured policy routes according to the marking information.
[0060] In this embodiment, when requests transmitted by different network cards are marked differently, when a first request is received, the first request is marked using the routing marking capability of iptables according to the mac address of the source network card of the first request, such as:
[0061] iptables -t mangle -A INPUT -m state --state NEW -m mac --mac-source 18:66:DA:AF:BA:90-j CONNMARK --set-xmark 0x1 / 0xffffffff
[0062] iptables -t mangle -A INPUT -m state --state NEW -m mac --mac-source 18:66:DA:AF:A5:1A-j CONNMARK --set-xmark 0x2 / 0xffffffff
[0063] iptables -t mangle -A INPUT -m state --state NEW -m mac --mac-source 18:66:DA:B1:A5:8F -j CONNMARK --set-xmark 0x3 / 0xffffffff
[0064] Among them, 18:66:DA:AF:BA:90 is the mac address of network card e1, 18:66:DA:AF:A5:1A is the mac address of network card e2, and 18:66:DA:B1:A5:8F is the mac address of network card e3. In other words, the first request coming from the telecom line is marked as 0x1, the first request coming from the Unicom line is marked as 0x2, and the first request coming from the mobile line is marked as 0x3.
[0065] After obtaining the tag information, determine the policy route that matches the tag information from the configured policy routes, such as Figure 2 As shown, for example:
[0066] ip route add default via em1 table 100
[0067] ip route add default via em2 table 200
[0068] ip route add default via em3 table 300
[0069] ip rule add from all fwmark 0x1 lookup 100
[0070] ip rule add from all fwmark 0x2 lookup 200
[0071] ip rule add from all fwmark 0x3 lookup 300
[0072] That is, tag information 0x1 corresponds to port em1, tag information 0x2 corresponds to port em2, and tag information 0x3 corresponds to port em3, so that the traffic coming in from the Unicom line goes out from the Unicom line, the traffic coming in from the Telecom line goes out from the Telecom line, and the traffic coming in from the Mobile line goes out from the Mobile line.
[0073] It should be noted that the above-mentioned marking information 0x1, 0x2, 0x3 and em1, em2, em3 are all described as examples and are not used to limit the present application.
[0074] The following describes how to determine the target service server:
[0075] As an optional implementation of the embodiment of the present application, after receiving the first request sent by the user terminal, the data processing method further includes:
[0076] Depending on the IP address of the user terminal, a service server matching the IP address of the user terminal is searched from an established hash table, and the hash table stores the matching relationship between the IP address of the user terminal and the service server.
[0077] Exemplarily, in this embodiment, the hash table is established in advance, which stores the matching relationship between the IP address of the user terminal and the service server, and the service server is the server corresponding to the target network card.
[0078] In this embodiment, depending on the IP address of the user terminal, the business server that matches the IP address of the user terminal is queried from the established hash table. Specifically, the IP address of the user terminal is used as a keyword, and the established hash table is queried to see whether there is a business server that matches the keyword. If so, the queried business server is determined as the target business server.
[0079] If there is no service server corresponding to the keyword in the hash table, one of the service servers corresponding to the target network card is selected as the target service server, and the determined matching relationship between the target service server and the IP address of the user terminal is stored in the hash table.
[0080] In this embodiment, there is at least one business server corresponding to the target network card. When there are multiple business servers corresponding to the target network card, there are many methods to select one of the business servers corresponding to the target network card as the target business server. For example, randomly select a business server from the business servers corresponding to the target network card as the target business server. For another example, select a business server from the business servers corresponding to the target network card as the target business server according to a load balancing algorithm. The embodiment of the present application does not specifically limit this.
[0081] As an optional implementation of the embodiment of the present application, before querying from the established hash table whether there is a service server corresponding to the IP address of the user terminal sending the first request, the data processing method further includes:
[0082] First, when a service request sent by a user terminal is received, it is determined whether the service request complies with the service defined in the configured LVS rule table.
[0083] Secondly, if the service request matches the service defined in the configured LVS rule table, a target service server is determined from a plurality of service servers corresponding to the transmission line address.
[0084] Exemplarily, in this embodiment, the service request is the same as the transmission network card of the first request, both of which are target network cards, and the service request is used to establish a matching relationship between the user terminal and the service server in advance.
[0085] Exemplarily, in this embodiment, the LVS rule table is configured in advance, and the correspondence between each network card and each business server is stored in the LVS rule table. When a service request is received, if the target service corresponding to the service request exists in the LVS rule table, the target business server is determined from multiple business servers corresponding to the target network card. The specific determination method is described in the above embodiment and will not be repeated here. If the target service corresponding to the service request does not exist in the LVS rule table, the service request will not be processed.
[0086] As an optional implementation of the embodiment of the present application, the data processing method further includes:
[0087] When a request completion event is detected, the matching relationship between the IP address of the user terminal and the target service server recorded in the hash table is deleted.
[0088] Illustratively, in this embodiment, the request completion event at least includes: reaching a specified time or the connection between the user terminal and the target service server is terminated, which is not specifically limited in this embodiment of the present application.
[0089] Exemplarily, in this embodiment, the specified time can be any value, for example, 10 minutes, 15 minutes, and the embodiment of the present application is not specifically limited.
[0090] In this embodiment, the termination of the connection between the user terminal and the target business server means that the target business server has sent all the business data requested by the user terminal to the user terminal. Based on the above description, when the data sending completion information sent by the target business server is received, it is considered that the connection between the user terminal and the target business server is terminated, and the matching relationship between the IP address of the user terminal and the target business server recorded in the hash table is deleted.
[0091] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of an apparatus, a system and a terminal used therein.
[0092] like Figure 5 As shown, Figure 5 : is a block diagram of a data processing device shown in an embodiment of the present application, the data processing device is applied to a network device, the network device is configured with at least two network cards, each network card is configured with a corresponding IP address, and different network cards have different IP addresses; the data processing device includes:
[0093] A first request receiving module, used for receiving a first request sent by a user terminal; the first request is sent by the user terminal based on a target service corresponding to a target network card, the source IP address of the first request is the IP address of the user terminal, and the destination IP address is the IP address of the target network card; the target network card is one of the network cards configured in the network device;
[0094] An encapsulation module, configured to convert the first request into a second request based on a tunnel between the network device and a target service server corresponding to the target network card in the external network; the second request carries the first request, and the second request has a tunnel encapsulation header, the source IP address of the tunnel encapsulation header is the IP address of the network device, and the destination IP address is the IP address of the target service server;
[0095] The response module is used to send a second request to the target business server through the tunnel, so that the target business server sends a response message to the user terminal through the public network based on the source IP address in the first request carried in the second request and the determined policy routing; the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
[0096] As an optional implementation of the embodiment of the present application, the network cards configured in the above-mentioned network device include at least: a mobile network card, a Unicom network card and a Telecom network card.
[0097] As an optional implementation of the embodiment of the present application, the second request carries the MAC address of the target network card; the response module is specifically used for:
[0098] Determine the policy route that matches the MAC address of the target network card from the configured policy routes;
[0099] A response message is sent to the user terminal through the public network based on the matching policy routing.
[0100] As an optional implementation of the embodiment of the present application, the data processing device further includes:
[0101] A query module, used to query a service server matching the IP address of the user terminal from an established hash table depending on the IP address of the user terminal, wherein the hash table stores a matching relationship between the IP address of the user terminal and the service server;
[0102] The target business server determination module is used to determine the queried business server as the target business server if it exists; if it does not exist, select one of the business servers corresponding to the target network card as the target business server, and store the matching relationship between the determined target business server and the IP address of the user terminal in the hash table.
[0103] As an optional implementation of the embodiment of the present application, the data processing device further includes:
[0104] The deletion module is used to delete the matching relationship between the IP address of the user terminal and the target service server recorded in the hash table when a request completion event is detected. The request completion event at least includes: reaching a specified time or the connection between the user terminal and the target service server is terminated.
[0105] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0106] So far, completed Figure 5 Description of the device block diagram shown.
[0107] like Figure 6 As shown, Figure 6 is a block diagram of a data processing system shown in an embodiment of the present application, the data processing system comprising: a user terminal, a network device and a target service server, wherein the network device is configured with at least two network cards, each network card is configured with a corresponding IP address, and different network cards have different IP addresses;
[0108] The user terminal is used to send a first request to the network device; the first request is sent based on the target service corresponding to the target network card, the source IP address of the first request is the IP address of the user terminal, and the destination IP address is the IP address of the target network card; the target network card is one of the network cards configured in the network device.
[0109] The network device is used to execute the process performed by the execution subject as described above.
[0110] The target business server is used to send a response message to the user terminal through the public network based on the determined policy routing and the source IP address in the first request carried in the second request when receiving the second request; the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
[0111] For the specific implementation, please refer to the implementation process of the corresponding steps in the above method, which will not be repeated here.
[0112] So far, completed Figure 6 Description of the device block diagram shown.
[0113] Correspondingly, the embodiment of the present application also provides Figure 5 The hardware structure diagram of the device shown is as follows Figure 7 As shown, the electronic device may be a device for implementing the above method. Figure 7 As shown, the hardware structure includes: a processor and a memory.
[0114] Wherein, the memory is used to store machine executable instructions;
[0115] The processor is used to read and execute the machine executable instructions stored in the memory to implement the corresponding data processing method embodiment shown above.
[0116] As an embodiment, the memory may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the memory may be: a volatile memory, a non-volatile memory or a similar storage medium. Specifically, the memory may be a RAM (Random Access Memory), a flash memory, a storage drive (such as a hard disk drive), a solid state drive, any type of storage disk (such as a CD, a DVD, etc.), or a similar storage medium, or a combination thereof.
[0117] So far, completed Figure 7 Description of the electronic device shown.
[0118] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0119] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention claimed herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not claimed in the specification. The specification and examples are to be considered exemplary only, and the true scope and spirit of the specification are indicated by the following claims.
[0120] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
[0121] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
Claims
1. A data processing method, It is characterized in that The method is applied to a network device, wherein the network device is configured with at least two network cards, each network card is configured with a corresponding IP address, and different network cards have different IP addresses; the method comprises: receiving a first request sent by a user terminal; the first request is sent by the user terminal based on a target service corresponding to a target network card, a source IP address of the first request is an IP address of the user terminal, and a destination IP address is an IP address of the target network card; the target network card is one of the network cards configured in the network device; Based on the tunnel between the network device and the target service server corresponding to the target network card in the external network, convert the first request into a second request; the second request carries the first request, and the second request has a tunnel encapsulation header, the source IP address of the tunnel encapsulation header is the IP address of the network device, and the destination IP address is the IP address of the target service server; The second request is sent to the target business server through the tunnel, so that the target business server sends a response message to the user terminal through the public network based on the source IP address in the first request carried by the second request and the determined policy routing; the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
2. The method according to claim 1, It is characterized in that The network devices are configured with network cards including at least: a mobile network card, a Unicom network card and a Telecom network card.
3. The method according to claim 1, It is characterized in that The second request carries the MAC address of the target network card; and the sending a response message to the user terminal through the public network based on the determined policy routing includes: Determine a policy route that matches the MAC address of the target network card from the configured policy routes; A response message is sent to the user terminal through the public network based on the matched policy routing.
4. The method according to claim 1, It is characterized in that After receiving the first request sent by the user terminal, the method further includes: Depending on the IP address of the user terminal, querying a service server matching the IP address of the user terminal from an established hash table, wherein the hash table stores a matching relationship between the IP address of the user terminal and the service server; If so, the queried service server is determined as the target service server; If not, one of the service servers corresponding to the target network card is selected as the target service server, and the determined matching relationship between the target service server and the IP address of the user terminal is stored in the hash table.
5. The method according to claim 4, It is characterized in that The method further comprises: When a request completion event is detected, the matching relationship between the IP address of the user terminal and the target service server recorded in the hash table is deleted, and the request completion event at least includes: reaching a specified time or the connection between the user terminal and the target service server is terminated.
6. A data processing device, It is characterized in that The device is applied to a network device, the network device is configured with at least two network cards, each network card is configured with a corresponding IP address, and different network cards have different IP addresses; the device comprises: a first request receiving module, configured to receive a first request sent by a user terminal; the first request is sent by the user terminal based on a target service corresponding to a target network card, a source IP address of the first request is an IP address of the user terminal, and a destination IP address is an IP address of a target network card; the target network card is one of the network cards configured for the network device; an encapsulation module, configured to convert the first request into a second request based on a tunnel between the network device and a target service server corresponding to the target network card in an external network; the second request carries the first request, and the second request has a tunnel encapsulation header, the source IP address of the tunnel encapsulation header is the IP address of the network device, and the destination IP address is the IP address of the target service server; A response module is used to send the second request to the target business server through the tunnel, so that the target business server sends a response message to the user terminal through the public network based on the source IP address in the first request carried by the second request and the determined policy routing; the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
7. The device according to claim 6, It is characterized in that The network devices are configured with network cards including at least: a mobile network card, a Unicom network card and a Telecom network card.
8. The device according to claim 6, It is characterized in that The second request carries the MAC address of the target network card; and the response module is specifically used for: Determine a policy route that matches the MAC address of the target network card from the configured policy routes; A response message is sent to the user terminal through the public network based on the matched policy routing.
9. A data processing system, It is characterized in that include: A user terminal, a network device and a target service server, wherein the network device is configured with at least two network cards, each network card is configured with a corresponding IP address, and different network cards have different IP addresses; The user terminal is used to send a first request to the network device; the first request is sent based on the target service corresponding to the target network card, the source IP address of the first request is the IP address of the user terminal, and the destination IP address is the IP address of the target network card; the target network card is one of the network cards configured in the network device; The network device is used to execute the method according to any one of claims 1 to 5; The target business server is used to send a response message to the user terminal through the public network based on the determined policy routing and based on the source IP address in the first request carried by the second request when receiving the second request; the source IP address of the response message is the IP address of the target network card, and the destination IP address is the IP address of the user terminal.
10. An electronic device, It is characterized in that The electronic device includes: a processor and a memory; Wherein, the memory is used to store machine executable instructions; The processor is used to read and execute the machine executable instructions stored in the memory to implement the method according to any one of claims 1 to 5.
