Data forwarding method and device, electronic equipment and storage medium
By obtaining the health status information of the proxy device and dynamically selecting the target proxy device, the complex and costly problem of manual modification of applications in the prior art is solved, and the efficiency and reliability of data forwarding are improved.
Patent Information
- Application Number
- CN202510121173.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, when an exception occurs when an agent device configured with a fixed configuration of an application occurs, it is necessary to manually modify the application to realize data forwarding. The process is complex and costly, and the efficiency and reliability of data forwarding are low.
By receiving the target data sent by the client, obtain the health status information of each proxy device in the data forwarding flow table of the target application, including availability, load and delay information, and dynamically select the target proxy device for data forwarding without modifying the application.
It realizes dynamic routing proxy devices based on health status information, improves the efficiency and reliability of data forwarding, and reduces the complexity and cost of manually modifying applications.
Smart Images

Figure CN119906684A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data forwarding method, device, electronic device and storage medium. Background Art
[0002] In the network architecture, the process of data forwarding is: the application deployed on the client sends data to the switch device, the switch device forwards the data to the proxy device, and the proxy device sends the data to the target device. In the prior art, the application deployed on the client generally has a fixed configuration of the client source IP, proxy device IP, and target device IP, and the proxy and forwarding of data are realized through the fixed configuration proxy device.
[0003] The problem with the existing technology is that when an abnormality occurs in the proxy device with fixed configuration of the application, the application needs to be manually modified to continue data forwarding. On the one hand, the modification process is complicated and costly, and on the other hand, the reliability of manual modification cannot be guaranteed, which will reduce the efficiency and reliability of data forwarding. Summary of the invention
[0004] The present application provides a data forwarding method, device, electronic device and storage medium to solve the problems of low data forwarding efficiency and reliability in the prior art.
[0005] In a first aspect, the present application provides a data forwarding method, the method comprising:
[0006] Receive target data sent by a client deployed with a target application, and obtain health status information of each proxy device currently recorded in a data forwarding flow table corresponding to the target application; wherein the health status information includes at least one of availability information, load information and latency information;
[0007] Determine a target proxy device according to the health status information of each proxy device; forward the target data to the target proxy device; and the target proxy device forwards the target data to the target device.
[0008] The above technical solution has the following advantages or beneficial effects:
[0009] In the present application, after receiving the target data sent by the target application deployed in the client, the health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application is first obtained, and then the target proxy device for forwarding the target data is selected based on the health status information of each proxy device. When forwarding the target data at different times, if the health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application is different, the target proxy device determined to forward the target data may also be different. Thereby, a dynamic routing proxy device based on health status information is realized. The target data is forwarded to the target proxy device; the target proxy device forwards the target data to the target device. The data forwarding method provided by the present application does not require modification of the application program, which solves the problem of complex and high cost of manually modifying the application program, and the present application determines the target proxy device for data forwarding based on the health status information of each proxy device, thereby improving the efficiency and reliability of data forwarding.
[0010] The data forwarding method provided in the present application is applied to a switch device. Optionally, the switch device may be a programmable switch device. The proxy device may be a proxy server. The target device may be a target server.
[0011] Furthermore, the method further comprises:
[0012] The health status information of each proxy device is monitored according to a preset period, and the health status information of each proxy device recorded in the data forwarding flow table is updated; wherein, the health status information of each proxy device is monitored by sending a test message to each proxy device.
[0013] Further, if the health status information includes availability information, load information, and latency information, monitoring the health status information of each proxy device by sending a test message to each proxy device includes:
[0014] For each of the proxy devices, the test message is sent to the proxy device; if a response message from the proxy device is received within a preset time, the availability information of the proxy device is determined to be available; otherwise, the availability information of the proxy device is determined to be unavailable; the delay information of the proxy device is determined based on the time difference between a first time of sending the test message and a second time of receiving the response message; and the load information of the proxy device carried in the response message is obtained, wherein the proxy device determines its own load information after receiving the test message and carries the load information in the response message.
[0015] Further, if the health status information includes availability information, load information, and latency information, determining the target proxy device according to the health status information of each proxy device includes:
[0016] taking the proxy device with availability information being available as a candidate proxy device;
[0017] For each candidate proxy device, determine a first score of the candidate proxy device according to the latency information of the candidate proxy device; determine a second score of the candidate proxy device according to the load information of the candidate proxy device; wherein, the smaller the latency information, the higher the first score; and the smaller the load information, the higher the second score; determine a target score of the candidate proxy device according to the first score and the second score of the candidate proxy device;
[0018] The candidate proxy device with the largest target score is determined as the target proxy device.
[0019] Further, determining a target score of the candidate proxy device according to the first score and the second score of the candidate proxy device includes:
[0020] According to a first weight value corresponding to the preset delay information, a second weight value corresponding to the load information, and the first score and the second score of the candidate proxy device, the first score and the second score are weightedly summed to obtain a target score of the candidate proxy device.
[0021] Furthermore, after receiving the target data sent by the client where the target application is deployed, before obtaining the health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application, the method further includes:
[0022] Obtaining the first destination IP carried in the target data and each pre-saved second destination IP; wherein each second destination IP is used to characterize that the data has a proxy requirement;
[0023] If the first destination IP exists among the second destination IPs, a step is performed to obtain health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application.
[0024] In a second aspect, the present application provides a data forwarding device, the device comprising:
[0025] A monitoring module, configured to receive target data sent by a client on which a target application is deployed, and obtain health status information of each proxy device currently recorded in a data forwarding flow table corresponding to the target application; wherein the health status information includes at least one of availability information, load information, and latency information;
[0026] The forwarding module is used to determine the target proxy device according to the health status information of each proxy device; forward the target data to the target proxy device; and the target proxy device forwards the target data to the target device.
[0027] In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0028] Memory, used to store computer programs;
[0029] The processor is used to implement the method when executing the program stored in the memory.
[0030] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the described method is implemented.
[0031] In a fifth aspect, the present application provides a computer program product, wherein the computer program product comprises an executable program, and the executable program is executed by a processor to implement the described method. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 A schematic diagram of the first data forwarding process provided for this application;
[0034] Figure 2 A schematic diagram of the process of monitoring the health status information of each proxy device provided for this application;
[0035] Figure 3 A schematic diagram of the first process of determining a target proxy device provided by the present application;
[0036] Figure 4 A schematic diagram of the second process of determining a target proxy device provided by the present application;
[0037] Figure 5 A schematic diagram of the second data forwarding process provided by this application;
[0038] Figure 6 Data forwarding flow chart provided for this application;
[0039] Figure 7 A schematic diagram of the structure of the data forwarding device provided in this application;
[0040] Figure 8 This is a schematic diagram of the electronic device structure provided in this application. DETAILED DESCRIPTION
[0041] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0042] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their ordinary and common meanings.
[0043] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0044] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0045] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0046] 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0047] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
[0048] In the prior art, applications usually implement data proxy and forwarding by fixedly configuring proxy servers. This method requires special development and configuration of the application to support the use of the proxy server.
[0049] Proxy device configuration: During application development, the address and port of the proxy device need to be pre-configured. Data forwarding: The application sends data to the configured proxy device, which then forwards the data to the target device. Fixed configuration: The configuration of the proxy device is usually fixed and difficult to dynamically adjust according to real-time conditions.
[0050] In addition to the commonly used methods mentioned above, other unconventional methods can also be used, usually the following two:
[0051] Policy routing: Determines the forwarding path of data packets based on predefined policies (such as source IP, destination IP). Configured in static mode.
[0052] Load balancing iRules: Provides dynamic load balancing function to achieve dynamic routing of traffic.
[0053] The existing technologies have the following main deficiencies in application data proxy and forwarding:
[0054] High development cost: Additional development and modification of the application is required to support the configuration and use of proxy devices, which increases the development cost of the system.
[0055] Poor configuration flexibility: The configuration of proxy devices is usually fixed, and it is difficult to dynamically adjust according to the network conditions and the load of the proxy devices, which can easily cause single point failures and performance bottlenecks. For example, policy routing requires the maintenance of complex policy tables and relies on manual intervention, resulting in low operation and maintenance efficiency.
[0056] Poor real-time performance: Routing policies are usually statically configured, and forwarding paths cannot be adjusted dynamically. There is a lack of real-time monitoring of proxy device status (such as IP address and health status).
[0057] Monitoring limitations: Existing solutions can only monitor the load status of the traffic layer and cannot detect the health status and real-time availability of proxy devices in a fine-grained manner, affecting the accuracy of forwarding decisions.
[0058] Complex maintenance: The configuration of proxy devices needs to be manually maintained and updated, which increases the complexity of system management and the workload of operation and maintenance. For example, configuring iRules for load balancing devices requires professional knowledge, has high technical barriers and is complex to manage.
[0059] High cost: It is necessary to purchase expensive load balancing hardware equipment, which has high initial investment and maintenance costs, increasing the overall deployment cost.
[0060] In summary, existing technologies have certain deficiencies in development, configuration, maintenance, dynamic adaptability, and cost control, and a more efficient, flexible, and low-cost solution is urgently needed to solve these problems.
[0061] In the existing network architecture, many applications need to be modified to adapt to proxy devices. This modification usually involves modification, redeployment and testing of the application code, which is a complex and costly process. In addition, traditional methods make it difficult to obtain the health status information of the proxy device in real time, resulting in a lack of flexibility and reliability in the data forwarding process. In order to solve these problems, the present application proposes a method and system for forwarding application data to a target proxy device using a programmable switch device. By reusing the switches at the network layer, application data is captured and forwarded to the target proxy device, while realizing real-time monitoring of the IP address and availability information, load information, and latency information of each proxy device, thereby reducing the need for modification of existing applications, reducing system modification costs, and improving the efficiency and reliability of data forwarding.
[0062] Figure 1 The first data forwarding process diagram provided for this application includes the following steps:
[0063] S101: Receive target data sent by a target application deployed in a client, and obtain health status information of each proxy device currently recorded in a data forwarding flow table corresponding to the target application; wherein the health status information includes at least one of availability information, load information, and latency information;
[0064] S102: Determine a target proxy device according to the health status information of each proxy device; forward the target data to the target proxy device; and the target proxy device forwards the target data to the target device.
[0065] The data forwarding method provided in the present application is applied to an electronic device, and the electronic device may be a switch device, and optionally, the switch device may be a programmable switch device. The proxy device may be a proxy server. The target device may be a target server.
[0066] In the present application, corresponding data forwarding flow tables are saved for different applications, and the health status information of each proxy device is recorded in the data forwarding flow table; wherein the health status information includes at least one of availability information, load information and delay information. Preferably, the health status information includes availability information, load information and delay information. Availability information includes available or unavailable; load information refers to the load value of the proxy device; delay information refers to the delay value of the proxy device. Optionally, the electronic device monitors the health status information of each proxy device according to a preset period, and updates the health status information of each proxy device recorded in the data forwarding flow table.
[0067] After the electronic device receives the target data sent by the target application deployed in the client, it determines the target proxy device according to the health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application. Optionally, the proxy device with the best performance is determined as the target proxy device based on the health status information of each proxy device. For example, the proxy device with availability information as available, the smallest load and the smallest delay is determined as the target proxy device. The target data is then forwarded to the target proxy device; the target proxy device forwards the target data to the target device. Optionally, the target data carries a source IP and a destination IP, the source IP is the IP of the client that deploys the target application, and the destination IP refers to the IP of the target device. After the target proxy device receives the target data forwarded by the electronic device, it obtains the destination IP carried in the target device and forwards the target data to the target device according to the destination IP.
[0068] In the present application, after receiving the target data sent by the target application deployed in the client, the health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application is first obtained, and then the target proxy device for forwarding the target data is selected based on the health status information of each proxy device. When forwarding the target data at different times, if the health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application is different, the target proxy device determined to forward the target data may also be different. Thereby, a dynamic routing proxy device based on health status information is realized. The target data is forwarded to the target proxy device; the target proxy device forwards the target data to the target device. The data forwarding method provided by the present application does not require modification of the application program, which solves the problem of complex and high cost of manually modifying the application program, and the present application determines the target proxy device for data forwarding based on the health status information of each proxy device, thereby improving the efficiency and reliability of data forwarding.
[0069] In this application, the method further includes:
[0070] The health status information of each proxy device is monitored according to a preset period, and the health status information of each proxy device recorded in the data forwarding flow table is updated; wherein, the health status information of each proxy device is monitored by sending a test message to each proxy device.
[0071] The preset period can be a shorter time period or a longer time period, and the present application does not limit the preset period. An initial time point is set, and the time point for monitoring the health status information of each proxy device can be determined based on the initial time point and the preset period. When the time point for monitoring the health status information of each proxy device is reached, the health status information of each proxy device is monitored, and the health status information of each proxy device recorded in the data forwarding flow table is updated based on the health status information of each proxy device currently monitored. Optionally, the health status information of each proxy device is monitored by sending a test message to each proxy device.
[0072] Figure 2 The process diagram for monitoring the health status information of each proxy device provided for this application includes the following steps:
[0073] S201: For each of the proxy devices, sending the test message to the proxy device;
[0074] S202: If a response message of the proxy device is received within a preset time, determining that the availability information of the proxy device is available, otherwise determining that the availability information of the proxy device is unavailable;
[0075] S203: Determine the delay information of the proxy device according to a time difference between a first time of sending the test message and a second time of receiving the response message;
[0076] S204: Acquire the load information of the proxy device carried in the response message, wherein the proxy device determines its own load information after receiving the test message, and carries the load information in the response message.
[0077] In the present application, by sending a test message to each proxy device and monitoring the health status information of each proxy device, the availability information of each proxy device is first determined. That is, for each proxy device, a test message is sent to the proxy device. If a response message from the proxy device is received within a preset time, the availability information of the proxy device is determined to be available, otherwise the availability information of the proxy device is determined to be unavailable. The present application does not limit the length of the preset time. If the availability information of the proxy device is determined to be unavailable, there is no need to monitor the load information and delay information of the proxy device.
[0078] For proxy devices whose availability information is available, monitor the load information and delay information of the proxy devices. Optionally, record the first time of sending the test message and the second time of receiving the response message, and then determine the time difference between the first time and the second time, and determine the time difference as the delay information of the proxy device. The process of monitoring the load information of the proxy device is to obtain the load information of the proxy device carried by the response message. For the proxy device, after receiving the test message, it determines its own load information, and then carries the load information in the response message, and then transmits the response message to the electronic device. In the present application, the proxy device can use a known method for determining the load to determine its own load information, and the present application does not elaborate on the process of determining the load information.
[0079] Figure 3 The first process diagram for determining a target proxy device provided in this application includes the following steps:
[0080] S301: taking a proxy device with availability information of available as a candidate proxy device;
[0081] S302: for each candidate proxy device, determine a first score of the candidate proxy device according to the latency information of the candidate proxy device; determine a second score of the candidate proxy device according to the load information of the candidate proxy device; wherein, the smaller the latency information, the higher the first score; the smaller the load information, the higher the second score; determine a target score of the candidate proxy device according to the first score and the second score of the candidate proxy device;
[0082] S303: Determine the candidate proxy device with the largest target score as the target proxy device.
[0083] In the present application, when determining the target proxy device, first, based on the availability information of each proxy device, the proxy device with available availability information is used as a candidate proxy device. If there is only one candidate proxy device, the candidate proxy device is directly determined as the target proxy device. If there are at least two candidate proxy devices, for each candidate proxy device, the first score of the candidate proxy device is determined based on the delay information of the candidate proxy device. Optionally, the correspondence between different delay information and the first score can be pre-saved, and the smaller the delay information, the higher the first score. The correspondence between different delay information ranges and the first score can also be pre-saved, in which case one delay information range corresponds to one first score, and the delay information range containing smaller delay information corresponds to a larger first score.
[0084] If there are at least two candidate proxy devices, for each candidate proxy device, the second score of the candidate proxy device is determined according to the load information of the candidate proxy device. Optionally, the correspondence between different load information and the second score can be saved in advance, and the smaller the load information, the higher the second score. The correspondence between different load information ranges and the second score can also be saved in advance, in which case one load information range corresponds to one second score, and the load information range containing smaller load information corresponds to a larger second score.
[0085] After determining the first score and the second score of each candidate proxy device, determine the target score of the candidate proxy device according to the first score and the second score. Optionally, the sum of the first score and the second score is determined as the target score. The candidate proxy device with the largest target score is determined as the target proxy device.
[0086] Figure 4 The second process diagram for determining the target proxy device provided by the present application includes the following steps:
[0087] S401: taking a proxy device with availability information of available as a candidate proxy device;
[0088] S402: for each candidate proxy device, determine a first score of the candidate proxy device according to the latency information of the candidate proxy device; determine a second score of the candidate proxy device according to the load information of the candidate proxy device; wherein, the smaller the latency information, the higher the first score; the smaller the load information, the higher the second score; according to a preset first weight value corresponding to the latency information, a second weight value corresponding to the load information, the first score and the second score of the candidate proxy device, perform weighted summation on the first score and the second score to obtain a target score of the candidate proxy device;
[0089] S403: Determine the candidate proxy device with the largest target score as the target proxy device.
[0090] In the present application, according to the first weight value corresponding to the preset delay information, the second weight value corresponding to the load information, the first score and the second score of the candidate proxy device, the first score and the second score are weighted and summed to obtain the target score of the candidate proxy device. Optionally, a first product of the first score and the first weight value, a second product of the second score and the second weight value are determined, and then the sum of the first product and the second product is determined as the target score.
[0091] In this application, different weight values can be set for different scenarios. For example, in a certain scenario, the user considers latency as the first priority and load as the second priority. In this case, the first weight value can be set to be greater than the second weight value. In another scenario, the user considers load as the first priority and latency as the second priority. In this case, the first weight value can be set to be less than the second weight value.
[0092] Figure 5 The second data forwarding process diagram provided for this application includes the following steps:
[0093] S501: Receive target data sent by a target application deployed in a client, obtain a first destination IP carried in the target data, and each second destination IP saved in advance; wherein each second destination IP is used to indicate that the data has a proxy requirement; if the first destination IP exists among each second destination IP, obtain health status information of each proxy device currently recorded in a data forwarding flow table corresponding to the target application; wherein the health status information includes at least one of availability information, load information, and latency information;
[0094] S502: Determine a target proxy device according to the health status information of each proxy device; forward the target data to the target proxy device; and the target proxy device forwards the target data to the target device.
[0095] The data sent by the target application is divided into data with proxy requirements and data without proxy requirements. The proxy requirements proposed in advance by the application party stipulate the data with proxy requirements and data without proxy requirements. Specifically, the second destination IPs are saved in advance; wherein each second destination IP is used to characterize that the data has proxy requirements. Data carrying other destination IPs except each second destination IP is data without proxy requirements.
[0096] After receiving the target data sent by the client deployed with the target application, first obtain the first destination IP carried in the target data, and then determine whether the first destination IP exists in each second destination IP. If so, it means that the target data is data with proxy requirements. At this time, obtain the health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application; determine the target proxy device based on the health status information of each proxy device; forward the target data to the target proxy device; and the target proxy device forwards the target data to the target device. If the first destination IP does not exist in each second destination IP, it means that the target data is data without proxy requirements. At this time, there is no need to determine the target proxy device, and the target data can be directly forwarded to the target device corresponding to the first destination IP.
[0097] The present application provides a centralized proxy data forwarding method, which has the following beneficial effects:
[0098] Reduce development costs: This application uses a programmable switch to capture and forward data, which reduces the need to modify and adapt the application and significantly reduces the development cost of the system.
[0099] Improve system reliability: By obtaining the IP address and availability status of the proxy device in real time, the programmable switch can dynamically adjust the data forwarding path to ensure the reliability and efficiency of data forwarding.
[0100] Reduce maintenance complexity: Automated IP address and status monitoring mechanisms reduce the need for agent device configuration and maintenance, simplifying system management.
[0101] Ensure data security: Establish a secure data transmission channel between the switch and the proxy device to ensure the security of data during transmission.
[0102] This application uses a programmable switch to achieve efficient and dynamic data forwarding and monitoring, and divides the entire system into a monitoring module and a forwarding module, including:
[0103] Monitoring module:
[0104] The IP address and health status of the proxy device are obtained in real time through the programmable switch, and the dynamic update mechanism of the flow table is adopted to build an accurate status monitoring system. With the help of the programmable ability of the switch, the simulation monitoring logic is written, and the health status and response capability of the proxy device are dynamically detected by simulating the load changes and abnormal conditions in the data forwarding process to ensure that the status of the proxy device is consistent with the flow table configuration. Fine-grained device health monitoring is achieved to avoid the limitation of traditional solutions that can only monitor the status of the traffic layer.
[0105] Forwarding module:
[0106] Programmable switches control data forwarding paths through flow table rules, without relying on application layer modification, reducing development costs. Dynamically adjust forwarding paths based on the real-time status of proxy devices to achieve flexible and efficient data distribution. Support data compression and secure transmission protocols to further optimize transmission efficiency and data security.
[0107] In this application, the system is divided into a monitoring module and a forwarding module, with clear responsibilities and independent optimization of each module, which improves the scalability and maintainability of the system. The programmable switch dynamically updates the flow table according to the real-time status of the proxy device, replacing the static routing and load balancing devices, and improving the system response speed and adaptability. Compared with the traditional solution that only monitors the traffic load status, this application uses the programmable capabilities of the switch to write simulation monitoring logic, deeply detect the health status of the proxy device, and provide a more accurate basis for forwarding decisions. Functional replacement is achieved by using existing network switching equipment, reducing dependence on expensive load balancing equipment, and saving hardware investment and maintenance costs. This application combines the collaboration of the monitoring module and the forwarding module, and significantly improves the flexibility, reliability and cost-effectiveness of the system by optimizing the proxy device monitoring and data forwarding paths, which is clearly distinguished from the prior art.
[0108] This application realizes the synchronization of forwarding rules, real-time monitoring and dynamic data forwarding of proxy devices through the collaboration of monitoring module and forwarding module, so as to improve system efficiency, reliability and flexibility. The following is a detailed technical solution:
[0109] The system is divided into two modules:
[0110] Monitoring module: The main function is to realize real-time monitoring of the health status, IP address and availability status of the proxy device, and provide a reliable decision-making basis for the forwarding module.
[0111] Key components:
[0112] Status monitor: The status of the proxy device is detected through the programmable switch, including heartbeat monitoring, Ping test, flow table matching and other functions.
[0113] Simulation module: Use the programmable capabilities of the switch to write simulation monitoring logic and detect the performance and health status of the proxy device by simulating different network loads and fault scenarios.
[0114] State Synchronizer: Synchronizes the detected proxy device status to the flow table configuration of the forwarding module in real time.
[0115] Forwarding module: The main function is to dynamically adjust the data forwarding path according to the proxy device status provided by the monitoring module to achieve efficient and flexible traffic management.
[0116] Key components:
[0117] Forwarding rule synchronizer: Receives flow table or policy information from the management system or control platform through an external interface, dynamically updates local forwarding rules, and ensures system flexibility and scalability.
[0118] Traffic Capture: Monitors and captures application data packets transmitted in the network as input for forwarding.
[0119] Path optimizer: selects the optimal proxy device path for data forwarding based on the status information provided by the monitoring module.
[0120] Forwarding executor: forwards data packets to the target proxy device based on flow table rules and supports dynamic update of rules.
[0121] The data flow process is as follows:
[0122] Monitoring module operation:
[0123] Status detection: The status monitor obtains the IP address and availability status of the proxy device in real time. Use the simulation module to simulate the data forwarding load and abnormal conditions inside the switch to conduct in-depth detection of the health status of the proxy device.
[0124] State synchronization: The detection results are used to dynamically update the flow table rules of the forwarding module through the state synchronizer to ensure that the health status of the proxy device is consistent with the flow table configuration.
[0125] Operation of the forwarding module:
[0126] Data capture: The traffic capturer monitors the data traffic in the network and captures all data packets. Path selection: The path optimizer selects the optimal path according to the real-time status of the proxy device and dynamically updates the flow table rules. Data forwarding: The forwarding executor forwards the data packet to the target proxy device according to the flow table rules.
[0127] Monitoring and forwarding collaboration:
[0128] The monitoring module and forwarding module collaborate through dynamic state synchronization and flow table rule updates: When the monitoring module detects a change in the state of the proxy device, it immediately notifies the forwarding module to adjust the traffic path. The forwarding module quickly switches the data forwarding path according to the latest flow table rules to ensure the reliability and efficiency of data transmission.
[0129] In the data center, the application system accesses the external network. An application system needs to access an external cooperative organization through the Internet to ensure the normal operation of the application system. In order to achieve this goal, the application needs to forward the data traffic to the security proxy device for analysis and processing.
[0130] Figure 6 The data forwarding flow chart provided for this application is as follows: Figure 6As shown in the figure, the application submits a proxy request to the proxy management system. The application party applies for the need to forward certain external traffic to the proxy device for network proxy when it detects it during operation. After approval, the policy is synchronized to the proxy management system to provide query function for the programmable switch. Synchronize forwarding rules. The programmable switch periodically uses the forwarding rule synchronizer to query the proxy management system for flow table or policy information and dynamically updates local forwarding rules. Synchronize monitoring status. With the help of the simulation capability of the monitoring module, the performance and health status of the proxy device are detected. The above information is synchronized to the forwarding module. Data forwarding. According to the status information provided by the monitoring module, the optimal proxy device path is selected for the application for data forwarding, and the data packet is forwarded to the target proxy device based on the flow table rules, and dynamic update of rules is supported.
[0131] This application achieves efficient data processing and management by optimizing data forwarding paths and real-time monitoring of proxy device status, reduces the need for modification of existing applications, reduces modification costs, and improves the efficiency and reliability of data forwarding.
[0132] Figure 7 The data forwarding device provided in this application includes:
[0133] The monitoring module 21 is used to receive target data sent by a client that deploys a target application, and obtain health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application; wherein the health status information includes at least one of availability information, load information and latency information;
[0134] The forwarding module 22 is used to determine a target proxy device according to the health status information of each proxy device; forward the target data to the target proxy device; and the target proxy device forwards the target data to the target device.
[0135] The monitoring module 21 is also used to monitor the health status information of each proxy device according to a preset period, and update the health status information of each proxy device recorded in the data forwarding flow table; wherein, the health status information of each proxy device is monitored by sending a test message to each proxy device.
[0136] The monitoring module 21 is specifically used to send the test message to each proxy device, and if a response message from the proxy device is received within a preset time, determine the availability information of the proxy device as available, otherwise determine the availability information of the proxy device as unavailable; determine the delay information of the proxy device according to the time difference between the first time of sending the test message and the second time of receiving the response message; obtain the load information of the proxy device carried in the response message, wherein the proxy device determines its own load information after receiving the test message, and carries the load information in the response message.
[0137] The forwarding module 22 is specifically configured to use a proxy device whose availability information is available as a candidate proxy device; for each candidate proxy device, determine a first score of the candidate proxy device according to the latency information of the candidate proxy device; determine a second score of the candidate proxy device according to the load information of the candidate proxy device; wherein, the smaller the latency information, the higher the first score; and the smaller the load information, the higher the second score; determine a target score of the candidate proxy device according to the first score and the second score of the candidate proxy device; and determine the candidate proxy device with the largest target score as the target proxy device.
[0138] The forwarding module 22 is specifically used to perform weighted summation on the first score and the second score of the candidate proxy device according to a first weight value corresponding to the preset delay information, a second weight value corresponding to the load information, and the first score and the second score of the candidate proxy device to obtain a target score of the candidate proxy device.
[0139] The device also includes:
[0140] The judgment module 23 is used to obtain the first destination IP carried in the target data and each pre-saved second destination IP; wherein each second destination IP is used to characterize that the data has a proxy requirement; if the first destination IP exists in each second destination IP, the monitoring module 21 is triggered.
[0141] The present application also provides an electronic device, such as Figure 8 As shown, it includes: a processor 31, a communication interface 32, a memory 33 and a communication bus 34, wherein the processor 31, the communication interface 32, and the memory 33 communicate with each other through the communication bus 34;
[0142] The memory 33 stores a computer program, and when the program is executed by the processor 31, the processor 31 executes any one of the above method steps.
[0143] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0144] The communication interface 32 is used for communication between the above electronic device and other devices.
[0145] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0146] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0147] The present application also provides a computer storage readable storage medium, wherein the computer readable storage medium stores a computer program executable by an electronic device, and when the program runs on the electronic device, the electronic device implements any of the above method steps when executing.
[0148] The present application provides a computer program product, wherein the computer program product comprises an executable program, and when the executable program is executed by a processor, the method described above is implemented.
[0149] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0150] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data forwarding method, characterized in that: The method comprises: Receive target data sent by a target application deployed in the client, and obtain health status information of each proxy device currently recorded in a data forwarding flow table corresponding to the target application; wherein the health status information includes at least one of availability information, load information, and latency information; According to the health status information of each proxy device, a target proxy device is determined; the target data is forwarded to the target proxy device; and the target proxy device forwards the target data to the target device.
2. The method according to claim 1, characterized in that The method further comprises: The health status information of each proxy device is monitored according to a preset period, and the health status information of each proxy device recorded in the data forwarding flow table is updated; wherein, the health status information of each proxy device is monitored by sending a test message to each proxy device.
3. The method according to claim 2, characterized in that If the health status information includes availability information, load information, and latency information, monitoring the health status information of each proxy device by sending a test message to each proxy device includes: For each of the proxy devices, the test message is sent to the proxy device; if a response message from the proxy device is received within a preset time, the availability information of the proxy device is determined to be available; otherwise, the availability information of the proxy device is determined to be unavailable; the delay information of the proxy device is determined based on the time difference between a first time of sending the test message and a second time of receiving the response message; and the load information of the proxy device carried in the response message is obtained, wherein the proxy device determines its own load information after receiving the test message and carries the load information in the response message.
4. The method according to claim 1, characterized in that If the health status information includes availability information, load information, and latency information, determining the target proxy device according to the health status information of each proxy device includes: taking the proxy device with availability information being available as a candidate proxy device; For each candidate proxy device, determine a first score of the candidate proxy device according to the latency information of the candidate proxy device; determine a second score of the candidate proxy device according to the load information of the candidate proxy device; wherein, the smaller the latency information, the higher the first score; and the smaller the load information, the higher the second score; determine a target score of the candidate proxy device according to the first score and the second score of the candidate proxy device; The candidate proxy device with the largest target score is determined as the target proxy device.
5. The method according to claim 4, characterized in that Determining a target score of the candidate proxy device according to the first score and the second score of the candidate proxy device includes: According to a first weight value corresponding to the preset delay information, a second weight value corresponding to the load information, and the first score and the second score of the candidate proxy device, the first score and the second score are weightedly summed to obtain a target score of the candidate proxy device.
6. The method according to claim 1, characterized in that After receiving target data sent by a client on which a target application is deployed, and before obtaining health status information of each proxy device currently recorded in a data forwarding flow table corresponding to the target application, the method further includes: Obtaining the first destination IP carried in the target data and each pre-saved second destination IP; wherein each second destination IP is used to characterize that the data has a proxy requirement; If the first destination IP exists among the second destination IPs, a step is performed to obtain health status information of each proxy device currently recorded in the data forwarding flow table corresponding to the target application.
7. A data forwarding device, characterized in that: The device comprises: A monitoring module, configured to receive target data sent by a client on which a target application is deployed, and obtain health status information of each proxy device currently recorded in a data forwarding flow table corresponding to the target application; wherein the health status information includes at least one of availability information, load information, and latency information; The forwarding module is used to determine the target proxy device according to the health status information of each proxy device; forward the target data to the target proxy device; and the target proxy device forwards the target data to the target device.
8. The device according to claim 7, characterized in that The monitoring module is also used to monitor the health status information of each proxy device according to a preset period, and update the health status information of each proxy device recorded in the data forwarding flow table; wherein, the health status information of each proxy device is monitored by sending a test message to each proxy device.
9. The device according to claim 8, characterized in that The monitoring module is specifically configured to send the test message to each proxy device, and if a response message of the proxy device is received within a preset time, determine that the availability information of the proxy device is available, otherwise determine that the availability information of the proxy device is unavailable; determine the delay information of the proxy device according to the time difference between the first time of sending the test message and the second time of receiving the response message; The load information of the proxy device carried in the response message is obtained, wherein the proxy device determines its own load information after receiving the test message, and carries the load information in the response message.
10. The device according to claim 7, characterized in that The forwarding module is specifically used to use a proxy device with availability information as a candidate proxy device; for each candidate proxy device, determine a first score of the candidate proxy device according to the delay information of the candidate proxy device; determine a second score of the candidate proxy device according to the load information of the candidate proxy device; wherein, the smaller the delay information, the higher the first score; the smaller the load information, the higher the second score; determine a target score of the candidate proxy device according to the first score and the second score of the candidate proxy device; and determine the candidate proxy device with the largest target score as the target proxy device.
11. The device according to claim 10, characterized in that The forwarding module is specifically used to perform weighted summation of the first score and the second score of the candidate proxy device according to a first weight value corresponding to the preset delay information, a second weight value corresponding to the load information, and the first score and the second score of the candidate proxy device to obtain a target score of the candidate proxy device.
12. The device according to claim 7, characterized in that The device also includes: A judgment module is used to obtain the first destination IP carried in the target data and each pre-saved second destination IP; wherein each second destination IP is used to characterize that the data has a proxy requirement; if the first destination IP exists in each second destination IP, the monitoring module is triggered.
13. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method according to any one of claims 1 to 6 when executing a program stored in a memory.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
15. A computer program product, characterized in that The computer program product comprises an executable program, which is executed by a processor to implement the method according to any one of claims 1 to 6.