A data flow analysis method, device and computer readable storage medium
By setting next-hop information in virtual machine data analysis, cross-network segment and cross-host data transmission and analysis are realized, solving the problem of low efficiency in existing technologies and improving data analysis efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2022-07-28
- Publication Date
- 2026-04-21
AI Technical Summary
Existing virtual machine data analysis technologies cannot perform cross-network segment and cross-host data analysis, resulting in low efficiency.
By acquiring data from the source virtual machine, setting the next-hop information according to the pre-configured virtual machine parameters, and transmitting the data to the destination virtual machine through a preset virtual machine, cross-network segment and cross-host data analysis can be achieved.
It enables virtual machine data analysis across network segments and hosts, improving data analysis efficiency.
Smart Images

Figure CN115202824B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of virtual machine technology, and in particular to a data diversion analysis method, apparatus, and computer-readable storage medium. Background Technology
[0002] As virtualization management systems become more widely used and application scenarios increase, customers' requirements for data processing are also becoming more diverse. Currently, existing virtual machine data analysis technologies mirror data by mirroring virtual machine ports to perform data analysis.
[0003] However, the above method can only perform port mirroring on virtual machines on the same host and the same virtual switch to analyze their data. It is inefficient and cannot perform virtual machine data analysis across network segments or hosts.
[0004] In view of the above problems, designing a data diversion and analysis method is an urgent problem to be solved by technical personnel in this field. Summary of the Invention
[0005] The purpose of this application is to provide a data diversion and analysis method, apparatus and computer-readable storage medium to solve the problem that traditional virtual machine data analysis cannot achieve cross-network segment and cross-host data analysis and has low efficiency.
[0006] To address the aforementioned technical problems, this application provides a data diversion and analysis method, comprising:
[0007] Retrieve data from the source virtual machine;
[0008] Set the next-hop information according to the pre-configured virtual machine parameters;
[0009] The data is transmitted to a preset virtual machine based on the next-hop information;
[0010] The data is transmitted to the destination virtual machine via the preset virtual machine for analysis.
[0011] Preferably, before acquiring the data from the source virtual machine, the method further includes:
[0012] Deploy software-defined networks through a virtualization management system;
[0013] Based on the software-defined network, create distributed routers and distributed router associated subnets;
[0014] The source virtual machine, the preset virtual machine, and the destination virtual machine are virtual machines under the subnet associated with the distributed router.
[0015] Preferably, setting the next-hop information according to pre-configured virtual machine parameters includes:
[0016] Configure source classless inter-domain routes, destination classless inter-domain routes, source ports, destination ports, and communication protocols for the source virtual machine and the destination virtual machine on the distributed router, respectively.
[0017] The IP addresses and priorities of virtual machines in the associated subnet of the distributed router are configured to set the next-hop information.
[0018] Preferably, configuring the source port, the destination port, and the communication protocol includes:
[0019] If the communication protocol is empty, then the source port and the destination port are empty;
[0020] If either the source port or the destination port is not empty, then the communication protocol is not empty.
[0021] Preferably, setting the next-hop information according to pre-configured virtual machine parameters includes:
[0022] The virtual machine parameters are obtained from a pre-generated database to set the next-hop information based on the virtual machine parameters;
[0023] The database contains all the virtual machine parameters.
[0024] Preferably, before setting the next-hop information according to the pre-configured virtual machine parameters, the method further includes:
[0025] Retrieve routing control configuration parameters;
[0026] Determine whether the routing control configuration parameter is a traffic redirection parameter;
[0027] If so, proceed to the step of setting the next-hop information according to the pre-configured virtual machine parameters.
[0028] Preferably, transmitting the data to the destination virtual machine via the preset virtual machine includes:
[0029] When the source virtual machine and the destination virtual machine are in the same distributed router associated subnet, the preset virtual machine transmits the data to the destination virtual machine under the distributed router associated subnet through the PNIC and virtual switch;
[0030] The preset virtual machine is not located in the subnet associated with the distributed router.
[0031] Preferably, transmitting the data to the destination virtual machine via the preset virtual machine includes:
[0032] When the source virtual machine and the destination virtual machine are not in the same distributed router associated subnet, the preset virtual machine transmits the data to the destination virtual machine under the distributed router associated subnet through PNIC and virtual switch;
[0033] The preset virtual machine is located in the same distributed router associated subnet as the source virtual machine or the destination virtual machine.
[0034] Preferably, transmitting the data to the destination virtual machine via the preset virtual machine includes:
[0035] When the source virtual machine and the destination virtual machine are not in the same distributed router associated subnet, the preset virtual machine transmits the data to the destination virtual machine under the distributed router associated subnet through PNIC and virtual switch;
[0036] The preset virtual machine, the source virtual machine, and the destination virtual machine are all located in different distributed router associated subnets.
[0037] Preferably, transmitting the data to the destination virtual machine via the preset virtual machine includes:
[0038] When the source virtual machine and the destination virtual machine are in the same distributed router associated subnet, the preset virtual machine diverts the data to an external device through the PNIC, and transmits the data to the destination virtual machine under the distributed router associated subnet through the external device.
[0039] The external device is located outside the software-defined network.
[0040] Preferably, after analyzing the data, the method further includes:
[0041] Output data analysis results;
[0042] Based on the data analysis results, operation instructions are generated for the source virtual machine to adjust the source virtual machine.
[0043] Preferably, after generating the operation instructions for the source virtual machine based on the data analysis results, the method further includes:
[0044] Determine whether the adjustments made to the source virtual machine meet the preset requirements;
[0045] If so, output a message indicating that the adjustment is complete.
[0046] To address the aforementioned technical problems, this application also provides a data diversion and analysis device, comprising:
[0047] The acquisition module is used to acquire data from the source virtual machine;
[0048] The configuration module is used to set the next-hop information based on pre-configured virtual machine parameters;
[0049] The first transmission module is used to transmit the data to a preset virtual machine according to the next-hop information;
[0050] The second transmission module is used to transmit the data to the destination virtual machine via the preset virtual machine for analysis.
[0051] To address the aforementioned technical problems, this application also provides a data diversion and analysis device, comprising:
[0052] Memory, used to store computer programs;
[0053] A processor is used to implement the steps of the data diversion and analysis method described above when executing the computer program.
[0054] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the data diversion and analysis method described above.
[0055] The data routing and analysis method provided in this application acquires data from a source virtual machine, sets next-hop information based on pre-configured virtual machine parameters, and transmits the data to a preset virtual machine according to the next-hop information. The preset virtual machine then transmits the data to a destination virtual machine for analysis. Therefore, when a customer needs to analyze business data, the above solution first transmits the data to a preset virtual machine, then transmits it to the destination virtual machine. This three-layer routing method allows data to be routed to virtual machines within the same network segment, across network segments, or outside the network for analysis. This enables cross-network segment and cross-host virtual machine data analysis, improving data analysis efficiency.
[0056] In addition, embodiments of this application also provide a data diversion and analysis device and a computer-readable storage medium, with the same effect as above. Attached Figure Description
[0057] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1A flowchart of a data diversion and analysis method provided in this application embodiment;
[0059] Figure 2 A flowchart of another data diversion and analysis method provided in the embodiments of this application;
[0060] Figure 3 A schematic diagram illustrating data diversion within this network segment as provided in an embodiment of this application;
[0061] Figure 4 A schematic diagram illustrating cross-network segment data diversion provided in an embodiment of this application;
[0062] Figure 5 A schematic diagram illustrating another cross-network segment data diversion method provided in this application embodiment;
[0063] Figure 6 A schematic diagram illustrating data diversion to the outside of the SDN network as provided in an embodiment of this application;
[0064] Figure 7 A schematic diagram of a data diversion and analysis device provided in an embodiment of this application;
[0065] Figure 8 A schematic diagram of another data diversion and analysis device provided in the embodiments of this application;
[0066] Figure 9 A flowchart illustrating the data diversion and analysis method provided in this application embodiment in an application scenario. Detailed Implementation
[0067] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0068] The core of this application is to provide a data diversion and analysis method, apparatus, and computer-readable storage medium.
[0069] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0070] Currently, existing virtual machine data analysis techniques mirror data by mirroring virtual machine ports, thereby enabling data analysis. However, this method can only perform port mirroring on virtual machines within the same host and virtual switch, resulting in low efficiency and an inability to analyze virtual machine data across network segments or hosts. Therefore, this application provides a data diversion and analysis method. Figure 1 A flowchart illustrating a data diversion and analysis method provided in an embodiment of this application. Figure 1 As shown, data traffic analysis methods include:
[0071] S10: Obtain data from the source virtual machine.
[0072] S11: Set the next-hop information according to the pre-configured virtual machine parameters.
[0073] S12: Transfer the data to the preset virtual machine based on the next-hop information.
[0074] S13: Transfer data to the destination virtual machine via a preset virtual machine for data analysis.
[0075] It is understandable that, in order to perform data analysis on virtual machines, data needs to be transferred from one virtual machine to another. Therefore, the virtual machine providing the analysis data is the source virtual machine, and the virtual machine receiving and analyzing the data is the destination virtual machine. Furthermore, data is first acquired from the source virtual machine; the specific content of this data is not limited in this embodiment and depends on the specific implementation.
[0076] After obtaining data from the source virtual machine, next-hop information is set according to the pre-configured virtual machine parameters; the data is then transmitted to the preset virtual machine based on this next-hop information. The next hop is the next point in the route. If the router is not directly connected to the destination network, it will have a neighboring router that provides the next-hop route to pass the data to the destination. Simply put, the next hop can be understood literally as the next hop after the router's routing selection. In this embodiment, to overcome the shortcomings of traditional virtual machine data analysis processes that cannot achieve cross-host and cross-network segment analysis, a data transmission channel between the source and destination virtual machines is established by setting next-hop information. Specifically, the source virtual machine transmits data to the preset virtual machine according to the next-hop information, and the preset virtual machine then redirects the data to the destination virtual machine, achieving three-layer redirection functions: same-network segment, cross-network segment, and redirection to the outside network.
[0077] It should be noted that the preset virtual machine is a virtual machine other than the source virtual machine and the destination virtual machine. Its network can be the same as the source virtual machine or the destination virtual machine, or it can be on a different network than both the source and destination virtual machines. This embodiment does not impose any restrictions and depends on the specific implementation. The source virtual machine and the destination virtual machine can be on the same network or different networks. This embodiment does not impose any restrictions and depends on the specific implementation.
[0078] Furthermore, the next-hop information is set through pre-configured virtual machine parameters. These pre-configured virtual machine parameters specifically refer to the parameters of the source virtual machine and the target virtual machine to which the data will be transferred, as well as the communication protocol between them. This information is essential for the source virtual machine to locate the target virtual machine to which it will transmit data and to do so. The specific content of the pre-configured virtual machine parameters is not limited in this embodiment, nor is the specific configuration process limited; it depends on the specific implementation. Finally, after receiving the data from the source virtual machine, the target virtual machine can analyze the data.
[0079] In this embodiment, data is acquired from the source virtual machine, next-hop information is set according to pre-configured virtual machine parameters, and data is transmitted to a preset virtual machine based on the next-hop information. The preset virtual machine then transmits the data to the destination virtual machine for analysis. Therefore, when a customer needs to analyze business data, the above solution first transmits the data to a preset virtual machine, then transmits it to the destination virtual machine. This three-layer routing method allows data to be routed to virtual machines within the same network segment, across network segments, or outside the network for analysis. This enables cross-network segment and cross-host virtual machine data analysis, improving data analysis efficiency.
[0080] Figure 2 A flowchart illustrating another data diversion and analysis method provided in this application embodiment. To achieve flexible control over the networks of the original virtual machine, the preset virtual machine, and the destination virtual machine, such as... Figure 2 As shown, before obtaining data from the source virtual machine, the following steps are also included:
[0081] S14: Deploy software-defined networks through a virtualization management system.
[0082] S15: Create a distributed router and its associated subnet based on software-defined networking. The source virtual machine, the preset virtual machine, and the destination virtual machine are virtual machines within the associated subnet of the distributed router.
[0083] Understandingly, a virtualization management system is a system used for unified management of virtual machines within a network. Software-defined networking (SDN) is a type of network that abstracts different, distinguishable layers of a network, making it agile and flexible. The purpose of SDN is to improve network control by enabling enterprises and service providers to respond quickly to evolving business needs. In SDN, network engineers or administrators can adjust traffic from a central console without interacting with individual switches across the network. Regardless of the specific connections between servers and devices, the centralized SDN controller directs the switches to provide network services wherever needed.
[0084] Therefore, in this embodiment, an SDN network is deployed through a virtualization management system, enabling rapid and flexible distributed network deployment. It provides functions such as SDN ring network integration, security groups, distributed routers, and distributed NAT gateways. Simultaneously, distributed routers and associated subnets are created based on Software-Defined Networking (SDN). Since the source virtual machine, the preset virtual machine, and the destination virtual machine are all virtual machines under the associated subnets of the distributed routers, Layer 3 traffic redirection can be configured based on the distributed routers and their associated subnets.
[0085] In this embodiment, a software-defined network is deployed through a virtualization management system, and a distributed router and its associated subnet are created based on the software-defined network. The source virtual machine, the preset virtual machine, and the destination virtual machine are virtual machines under the associated subnet of the distributed router. This enables flexible control over the networks of the source, preset, and destination virtual machines, facilitating subsequent Layer 3 traffic redirection.
[0086] Based on the above embodiments:
[0087] As a preferred embodiment, setting the next-hop information according to pre-configured virtual machine parameters includes:
[0088] Configure source classless inter-domain routes, destination classless inter-domain routes, source ports, destination ports, and communication protocols for the source virtual machine and the destination virtual machine on the distributed router respectively.
[0089] Configure the IP addresses and priorities of virtual machines in the associated subnet of the distributed router to set the next-hop information.
[0090] In the above embodiments, the specific content of the pre-configured virtual machine parameters is not limited and depends on the specific implementation. As a preferred embodiment, the pre-configured virtual machine parameters specifically include source classless inter-domain routing, destination classless inter-domain routing, source port, destination port, and communication protocol, as well as the IP address and priority of the virtual machine in the distributed router associated subnet.
[0091] Classless Inter-Domain Routing (CIDR) is a method for classifying IP addresses to assign IP addresses to users and efficiently route IP packets across the Internet. During setup, the source CIDR (source virtual machine's source CIDR) and the destination CIDR (destination CIDR) of the destination virtual machine are independent and can be empty, but their formats must be correct. Further, the specific ports for data transmission are determined by setting the source port of the source virtual machine and the destination port of the destination virtual machine; the communication protocol between the source and destination virtual machines is determined by setting the communication protocol. Enter the IP address of the virtual machine in the subnet associated with the distributed router to set the next hop; simultaneously set the priority, which is automatically sorted from high to low, with a default value of 100. The configuration process for virtual machine parameters is as follows:
[0092] "route_policy":"reroute",
[0093] "cidr_src":"1.1.1.0 / 24",
[0094] "cidr_dst":"1.1.1.0 / 32",
[0095] "protocol":"tcp",
[0096] "port_src":5001,
[0097] "port_dst":67,
[0098] "nexthop":"1.2.3.4"
[0099] "priority":100
[0100] Here, `routeId` refers to the router's UUID. When `route_policy` is set to `allow`, it enables routing control; when `route_policy` is set to `reroute`, it enables Layer 3 redirection. `cidr_src` and `cidr_dst` are optional. The `protocol` parameter can be `tcp`, `udp`, or `icmp`, meaning you can choose Transmission Control Protocol (TCP), User Datagram Protocol (UDP), or Internet Control Message Protocol (ICMP). `port_src` and `port_dst` are optional numbers when `protocol` is set to `tcp` or `udp`. `nexthop` is required only when `route_policy` is set to `reroute`, and the IP address must be entered. Enter the priority number. Furthermore, the above parameter configurations can be deleted using the Layer 3 redirection policy ID.
[0101] In this embodiment, by configuring source classless inter-domain routes, destination classless inter-domain routes, source ports, destination ports, and communication protocols for the source virtual machine and the destination virtual machine respectively on the distributed router; and configuring the IP addresses and priorities of the virtual machines in the associated subnet of the distributed router, the next hop settings are realized, and finally, fine-grained traffic redirection is achieved.
[0102] Based on the above embodiments:
[0103] As a preferred embodiment, configuring the source port, destination port, and communication protocol includes:
[0104] If the communication protocol is empty, then the source port and destination port are empty;
[0105] If either the source port or the destination port is not empty, then the communication protocol is not empty.
[0106] It is important to note that during the configuration of the source port, destination port, and communication protocol in the above embodiments, it is necessary to ensure that the port corresponds to the communication protocol. Specifically, the communication protocol can be empty when set; however, when the communication protocol is empty, the source port and destination port must also be empty. Furthermore, either the source port or the destination port can be empty, but if either the source port or the destination port is not empty, the communication protocol cannot be empty to ensure communication transmission between the source virtual machine and the destination virtual machine.
[0107] As a preferred embodiment, setting the next-hop information according to pre-configured virtual machine parameters includes:
[0108] Virtual machine parameters are obtained from a pre-generated database to set the next-hop information based on the virtual machine parameters;
[0109] The database contains all the virtual machine parameters.
[0110] It is understandable that the above embodiments achieve refined traffic redirection by configuring virtual machine parameters. These virtual machine parameters can be obtained from a pre-generated database.
[0111] The pre-generated database contains virtual machine parameter information, specifically including id|router_id|project_id|route_policy|cidr_src|cidr_dst|protocol|port_src|port_dst|nexthop|priority|. The router_id field is a foreign key, corresponding to the router's ID. Therefore, all parameter information from the above configuration process can be retrieved from the database.
[0112] In this embodiment, virtual machine parameters are obtained through a pre-generated database, enabling the setting of next-hop information.
[0113] As a preferred embodiment, such as Figure 2 As shown, before setting the next-hop information according to the pre-configured virtual machine parameters, the following steps are also included:
[0114] S16: Obtain routing control configuration parameters.
[0115] S17: Determine whether the routing control configuration parameter is a traffic redirection parameter; if so, proceed to step S11.
[0116] Understandably, during the configuration of next-hop information, when `route_policy` is set to `allow` or `drop`, it represents route control functionality; when `route_policy` is set to `reroute`, it represents Layer 3 redirection functionality. Therefore, in order to configure subsequent next-hop information, it is necessary to obtain the route control configuration parameters, including `allow`, `drop`, and `reroute`. Specifically, the configuration is based on whether the route control configuration parameter is a redirection parameter, i.e., whether the parameter is `reroute`; if so, the subsequent parameter configuration is then performed.
[0117] In this embodiment, by obtaining the routing control configuration parameters and determining whether the routing control configuration parameters are traffic redirection parameters, the determination of whether to perform Layer 3 traffic redirection is realized, so as to facilitate subsequent parameter configuration.
[0118] To enable those skilled in the art to better understand the technical solution of this application, the following detailed description of this application is provided in conjunction with the accompanying drawings. It mainly describes several scenarios involving data redirection to machines within the same network segment, across network segments, or outside the SDN network.
[0119] (1) Redirect the data to other virtual machines in this network segment:
[0120] When the source virtual machine and the destination virtual machine are in the same distributed router associated subnet, the default virtual machine transmits data to the destination virtual machine in the distributed router associated subnet through the PNIC and virtual switch; wherein, the default virtual machine is not in the distributed router associated subnet.
[0121] Figure 3 This is a schematic diagram illustrating the data diversion for this network segment as provided in an embodiment of this application. For example... Figure 3 As shown, to redirect data from the source virtual machine VM1 to the destination virtual machine VM2 within the same network segment, the default virtual machine VM_N transmits the data to the destination virtual machine under the distributed router's associated subnet via a PNIC and a virtual switch. PNIC stands for Private Data Network Identification Code, and managerNetwork refers to network management. It's important to note that the default virtual machine VM_N is not within the distributed router's associated subnet; that is, it is not in the same subnet as both the source virtual machine VM1 and the destination virtual machine VM2.
[0122] Specifically, to configure reroute for this network segment, with the next hop also being the IP address of this subnet port, the reroute policy is configured so that traffic destined for 10.xx5 (10.3.3.5) is first rerouted to 10.yy100 (10.3.3.100). When adding a Layer 3 redirect on the router, the following command is executed: ovn-nbctl lr-policy-add<router_uuid> The command 400'ip4.dst==10.3.3.5 / 32'reroute10.3.3.100 ultimately achieved Layer 3 traffic redirection for this network segment.
[0123] (2) Redirect data to other virtual machines across network segments:
[0124] When the source virtual machine and the destination virtual machine are not in the same distributed router associated subnet, the default virtual machine transmits data to the destination virtual machine in the distributed router associated subnet through the PNIC and virtual switch; wherein, the default virtual machine is in the same distributed router associated subnet as the source virtual machine or the destination virtual machine.
[0125] Figure 4This is a schematic diagram illustrating cross-network segment data redirection as provided in an embodiment of this application. Figure 4 As shown, in order to redirect data from the source virtual machine VM3 to the destination virtual machine VM1 across network segments, the default virtual machine VM2 transmits the data to the destination virtual machine within the distributed router's associated subnet via a PNIC and a virtual switch. It is important to note that the default virtual machine VM2 and the destination virtual machine VM1 are in the same distributed router's associated subnet, while the source virtual machine VM3 and the destination virtual machine VM1 are not in the same subnet.
[0126] Specifically, to configure cross-segment rerouting, where the next hop is an IP address on a port outside the current subnet, the following command is executed when adding a Layer 3 redirect on the router: ovn-nbctl lr-policy-add<router_uuid> The command `400'ip4.dst==10.3.3.5 / 32'reroute 10.3.3.100` ultimately achieved triple redirection from outside the local subnet.
[0127] (3) Redirect data to other virtual machines across network segments:
[0128] When the source virtual machine and the destination virtual machine are not in the same distributed router associated subnet, the default virtual machine transmits data to the destination virtual machine in the distributed router associated subnet through the PNIC and virtual switch; wherein the default virtual machine, the source virtual machine and the destination virtual machine are all in different distributed router associated subnets.
[0129] Figure 5 This is a schematic diagram illustrating another cross-network segment data diversion method provided in an embodiment of this application. For example... Figure 5 As shown, in order to redirect data from the source virtual machine VM3 to the destination virtual machine VM1 across network segments, the default virtual machine VM2 transmits the data to the destination virtual machine under the distributed router's associated subnet via a PNIC and a virtual switch. It is important to note that the default virtual machine VM2, the source virtual machine VM3, and the destination virtual machine VM1 are located in different distributed router associated subnets.
[0130] Specifically, to configure a forward redirect where the source and destination virtual machines are on different network segments, the reroute configuration needs to be reconfigured. Specifically, when adding a Layer 3 redirect on the router, execute the following command: ovn-nbctl lr-policy-add<router_uuid> 200'ip4.dst==10.9.9.2 / 32&&ip.ttl==63'reroute10.5.5.100, ultimately achieving Layer 3 traffic redirection across network segments.
[0131] (4) Directing data to a redirecting machine outside the SDN network:
[0132] When the source virtual machine and the destination virtual machine are in the same distributed router associated subnet, the default virtual machine diverts data to an external device via the PNIC and transmits data to the destination virtual machine in the distributed router associated subnet via the external device; wherein, the external device is located outside the software-defined network.
[0133] Figure 6 This is a schematic diagram illustrating data diversion to the outside of the SDN network, as provided in an embodiment of this application. Figure 6 As shown, in order to redirect data from the source virtual machine VM1 to the destination virtual machine VM2, the default virtual machine VM_a transmits data to the external device SW via the PNIC, and then the external device SW transmits the data to the destination virtual machine. It is important to note that the default virtual machine VM_a is not in the distributed router's associated subnet, while the source virtual machine VM1 and the destination virtual machine VM2 are in the same subnet.
[0134] Specifically, when adding a Layer 3 redirect on the router, the following execution command is issued:
[0135] ovn-nbctl lr-policy-add xxxxxxx 102'ip4.dst==10.55.22.3 / 32&&ip.ttl==63'
[0136] ovn-nbctl lr-policy-add xxxxxxx 102'ip4.dst==10.55.22.3 / 32&&ip.ttl==63'reroute 10.4.3.11
[0137] 1.Request src_mac:00:16:3e:88:ce:53dst_mac:fa:16:3e:33:88:ec
[0138] reply src_mac:fa:16:3e:33:88:ec dst_mac:00:16:3e:88:ce:53
[0139] 2.Request src_mac:fa:16:3e:43:f3:92(vlan_route_if)dst_mac:00:16:3e:ab:53:ed
[0140] The reply does not go through this point.
[0141] 3.Request src_mac:00:16:3e:ab:53:ed dst_mac:fa:16:3e:43:f3:92
[0142] The reply does not go through this point.
[0143] 4.Request src_mac:fa:16:3e:21:97:60dst_mac:00:16:3e:cc:02:75
[0144] reply src_mac:00:16:3e:cc:02:75dst_mac:fa:16:3e:21:97:60
[0145] The above describes the process of redirecting traffic to the SDN network. The redirecting machine VM_a needs to use the router-interface IP associated with the VLAN network as its own gateway.
[0146] As a preferred embodiment, such as Figure 2 As shown, after analyzing the data, the following steps are also included:
[0147] S18: Output data analysis results.
[0148] S19: Generate operation instructions for the source virtual machine based on the data analysis results, so as to adjust the source virtual machine.
[0149] As demonstrated by the above embodiments, data analysis is achieved by diverting data from the source virtual machine to external networks, such as within the same network segment, across network segments, or the SDN network. Furthermore, to adjust the source virtual machine based on the analysis results, after data analysis, the data analysis results are output, and operation instructions for the source virtual machine are generated based on these results, thereby adjusting the source virtual machine.
[0150] After generating operation instructions for the source virtual machine based on the data analysis results, the process also includes:
[0151] S20: Determine whether the adjustment of the source virtual machine meets the preset requirements; if so, proceed to step S21.
[0152] S21: Output the information that the adjustment is complete.
[0153] Furthermore, after adjusting the source virtual machine, in order to determine whether the adjusted source virtual machine meets the preset requirements, the adjustment is judged; when it is confirmed that the adjustment of the source virtual machine meets the preset requirements, the adjustment completion information is output.
[0154] The data diversion and analysis method has been described in detail in the above embodiments. This application also provides embodiments corresponding to the data diversion and analysis device. It should be noted that this application describes the embodiments of the device from two perspectives: one is based on the functional modules, and the other is based on the hardware structure.
[0155] Figure 7 This is a schematic diagram of a data diversion and analysis device provided in an embodiment of this application. Figure 7 As shown, the data diversion and analysis device includes:
[0156] Module 10 is used to acquire data from the source virtual machine;
[0157] The configuration module 11 is used to set the next-hop information according to the pre-configured virtual machine parameters;
[0158] The first transmission module 12 is used to transmit data to a preset virtual machine according to the next-hop information;
[0159] The second transmission module 13 is used to transmit data to the destination virtual machine via a preset virtual machine for data analysis.
[0160] In this embodiment, the data diversion and analysis device includes an acquisition module, a setting module, a first transmission module, and a second transmission module. By acquiring data from the source virtual machine, setting next-hop information according to pre-configured virtual machine parameters, and transmitting the data to a preset virtual machine based on the next-hop information, the data is then transmitted to the destination virtual machine via the preset virtual machine for data analysis. Therefore, when a customer needs to analyze business data, the above solution first transmits the data to a preset virtual machine, then transmits it to the destination virtual machine via the preset virtual machine. This three-layer diversion method enables data to be diverted to virtual machines within the same network segment, across network segments, or outside the network for further analysis. This achieves cross-network segment and cross-host virtual machine data analysis, improving data analysis efficiency.
[0161] Figure 8 A schematic diagram of another data diversion and analysis device provided in an embodiment of this application. (See attached diagram.) Figure 8 As shown, the data diversion and analysis device includes:
[0162] Memory 20 is used to store computer programs;
[0163] The processor 21 is configured to execute a computer program to implement the steps of the data diversion analysis method mentioned in the above embodiments.
[0164] The data diversion and analysis device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.
[0165] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0166] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the data diversion and analysis method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the data diversion and analysis method.
[0167] In some embodiments, the data diversion and analysis device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0168] Those skilled in the art will understand that Figure 8 The structure shown does not constitute a limitation on the data flow analysis device and may include more or fewer components than illustrated.
[0169] In this embodiment, the data diversion and analysis device includes a memory and a processor. The processor executes a computer program to implement the steps of the data diversion and analysis method mentioned in the above embodiment. By acquiring data from the source virtual machine, setting next-hop information according to pre-configured virtual machine parameters, and transmitting the data to a preset virtual machine based on the next-hop information; then, the data is transmitted from the preset virtual machine to the destination virtual machine for data analysis. Therefore, when a customer needs to analyze business data, the above solution first transmits the data to a preset virtual machine, then transmits the data to the destination virtual machine via the preset virtual machine. This three-layer diversion method enables data to be diverted to virtual machines within the same network segment, across network segments, or outside the network for further analysis. This achieves cross-network segment and cross-host virtual machine data analysis, improving data analysis efficiency.
[0170] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.
[0171] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0172] In this embodiment, a computer program is stored on a computer-readable storage medium. When the computer program is executed by a processor, it implements the steps described in the above method embodiment. By acquiring data from the source virtual machine, setting next-hop information according to pre-configured virtual machine parameters, and transmitting the data to a preset virtual machine based on the next-hop information, the data is then transmitted to the destination virtual machine via the preset virtual machine for data analysis. Therefore, when a customer needs to analyze business data, the above solution first transmits the data to a preset virtual machine, then transmits the data to the destination virtual machine via the preset virtual machine. This three-layer routing method allows data to be routed to virtual machines within the same network segment, across network segments, or outside the network for further analysis. This achieves cross-network segment and cross-host virtual machine data analysis, improving data analysis efficiency.
[0173] To enable those skilled in the art to better understand the technical solution of this application, the following description is provided in conjunction with the appendix. Figure 9 This application will now provide a more detailed description of the above. Figure 9 A flowchart illustrating the data diversion and analysis method provided in this application embodiment in an application scenario. For example... Figure 9 As shown, the method includes:
[0174] S30: Deploy SDN;
[0175] S31: Create a distributed router and a distributed router associated subnet;
[0176] S32: Configure Layer 3 routing on the distributed router;
[0177] S33: Direct data to a specified virtual machine or a specified device outside the SDN;
[0178] S34: Draw data to the destination virtual machine via a specified virtual machine or a specified device outside the SDN.
[0179] The specific application scenario is as follows: Distributed network deployment is completed by deploying SDN, distributed routers and associated subnets are created based on SDN, and Layer 3 traffic redirection is configured on the distributed routers; the next hop is set to redirect data traffic to a virtual machine in a specified virtualization system or a specified device outside the virtualization management system, and then to the destination virtual machine.
[0180] First, SDN is deployed through a virtualization management system to complete the distributed deployment of the network, providing functions such as SDN plus ring network, security groups, distributed routers, and distributed NAT gateways. Based on SDN, distributed routers and associated subnets are created, and Layer 3 traffic redirection is configured on the distributed routers, specifically setting source CIDR, destination CIDR, source port, destination port, and protocol, achieving fine-grained traffic redirection. By configuring the next hop, data traffic is redirected to a specified virtual machine within the virtualization system or a specified device outside the virtualization management system, and then reaches the destination address. Layer 3 traffic redirection functions can be implemented within the same network segment, across network segments, and to external SDN networks.
[0181] The data diversion and analysis method, apparatus, and computer-readable storage medium provided in this application have been described in detail above. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0182] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A data diversion and analysis method, characterized in that, include: Retrieve data from the source virtual machine; Set the next-hop information according to the pre-configured virtual machine parameters; The data is transmitted to a preset virtual machine based on the next-hop information; The data is transmitted to the destination virtual machine via the preset virtual machine for analysis. Before obtaining the data from the source virtual machine, the following is also included: Deploy software-defined networks through a virtualization management system; Based on the software-defined network, create distributed routers and distributed router associated subnets; Wherein, the source virtual machine, the preset virtual machine, and the destination virtual machine are virtual machines under the subnet associated with the distributed router; The step of setting the next-hop information according to the pre-configured virtual machine parameters includes: Configure source classless inter-domain routes, destination classless inter-domain routes, source ports, destination ports, and communication protocols for the source virtual machine and the destination virtual machine on the distributed router; wherein route_policy is reroute; The IP addresses and priorities of the virtual machines in the associated subnet of the distributed router are configured to set the next-hop information; The step of transmitting the data to the destination virtual machine via the preset virtual machine includes: When the source virtual machine and the destination virtual machine are in the same distributed router associated subnet, the preset virtual machine transmits the data to the destination virtual machine under the distributed router associated subnet through a PNIC and a virtual switch; wherein, the preset virtual machine is not in the distributed router associated subnet; When the source virtual machine and the destination virtual machine are not in the same distributed router associated subnet, the preset virtual machine transmits the data to the destination virtual machine in the distributed router associated subnet through a PNIC and a virtual switch; wherein, the preset virtual machine is in the same distributed router associated subnet as the source virtual machine or the destination virtual machine. When the source virtual machine and the destination virtual machine are not in the same distributed router association subnet, the preset virtual machine transmits the data to the destination virtual machine under the distributed router association subnet through PNIC and virtual switch; wherein, the preset virtual machine, the source virtual machine and the destination virtual machine are all in different distributed router association subnets; When the source virtual machine and the destination virtual machine are in the same distributed router associated subnet, the preset virtual machine diverts the data to an external device via a PNIC, and transmits the data to the destination virtual machine under the distributed router associated subnet via the external device; wherein, the external device is located outside the software-defined network.
2. The data diversion and analysis method according to claim 1, characterized in that, Configuring the source port, the destination port, and the communication protocol includes: If the communication protocol is empty, then the source port and the destination port are empty; If either the source port or the destination port is not empty, then the communication protocol is not empty.
3. The data diversion and analysis method according to claim 1, characterized in that, The step of setting the next-hop information according to the pre-configured virtual machine parameters includes: The virtual machine parameters are obtained from a pre-generated database to set the next-hop information based on the virtual machine parameters; The database contains all the virtual machine parameters.
4. The data diversion and analysis method according to claim 1, characterized in that, Before setting the next-hop information according to the pre-configured virtual machine parameters, the following is also included: Retrieve routing control configuration parameters; Determine whether the routing control configuration parameter is a traffic redirection parameter; If so, proceed to the step of setting the next-hop information according to the pre-configured virtual machine parameters.
5. The data diversion and analysis method according to any one of claims 1 to 4, characterized in that, After analyzing the data, the process further includes: Output data analysis results; Based on the data analysis results, operation instructions are generated for the source virtual machine to adjust the source virtual machine.
6. The data diversion and analysis method according to claim 5, characterized in that, After generating the operation instructions for the source virtual machine based on the data analysis results, the method further includes: Determine whether the adjustments made to the source virtual machine meet the preset requirements; If so, output a message indicating that the adjustment is complete.
7. A data diversion and analysis device, characterized in that, include: The acquisition module is used to acquire data from the source virtual machine; The configuration module is used to set the next-hop information based on pre-configured virtual machine parameters; The first transmission module is used to transmit the data to a preset virtual machine according to the next-hop information; The second transmission module is used to transmit the data to the destination virtual machine through the preset virtual machine for analysis. Before obtaining the data from the source virtual machine, the following is also included: Deploy software-defined networks through a virtualization management system; Based on the software-defined network, create distributed routers and distributed router associated subnets; Wherein, the source virtual machine, the preset virtual machine, and the destination virtual machine are virtual machines under the subnet associated with the distributed router; The step of setting the next-hop information according to the pre-configured virtual machine parameters includes: Configure source classless inter-domain routes, destination classless inter-domain routes, source ports, destination ports, and communication protocols for the source virtual machine and the destination virtual machine on the distributed router; wherein route_policy is reroute; The IP addresses and priorities of the virtual machines in the associated subnet of the distributed router are configured to set the next-hop information; The step of transmitting the data to the destination virtual machine via the preset virtual machine includes: When the source virtual machine and the destination virtual machine are in the same distributed router associated subnet, the preset virtual machine transmits the data to the destination virtual machine under the distributed router associated subnet through a PNIC and a virtual switch; wherein, the preset virtual machine is not in the distributed router associated subnet; When the source virtual machine and the destination virtual machine are not in the same distributed router associated subnet, the preset virtual machine transmits the data to the destination virtual machine in the distributed router associated subnet through a PNIC and a virtual switch; wherein, the preset virtual machine is in the same distributed router associated subnet as the source virtual machine or the destination virtual machine. When the source virtual machine and the destination virtual machine are not in the same distributed router association subnet, the preset virtual machine transmits the data to the destination virtual machine under the distributed router association subnet through PNIC and virtual switch; wherein, the preset virtual machine, the source virtual machine and the destination virtual machine are all in different distributed router association subnets; When the source virtual machine and the destination virtual machine are in the same distributed router associated subnet, the preset virtual machine diverts the data to an external device via a PNIC, and transmits the data to the destination virtual machine under the distributed router associated subnet via the external device; wherein, the external device is located outside the software-defined network.
8. A data diversion and analysis device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the data diversion analysis method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data diversion and analysis method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Network drainage method and device, electronic equipment and storage medium
CN113630315A