Network communication system and method

By setting up a correspondence between virtual network nodes in the slave device and physical network nodes in the master device, and combining this with the address mapping module filtering mechanism, the problem of data packet obfuscation in embedded devices is solved. This enables accurate data distribution across multiple network nodes on a single physical network card, meeting the dynamic resource allocation requirements of hardware devices.

CN120602453BActive Publication Date: 2025-12-26ZHIZHU COMMUNICATION TECHNOLOGY (CHENGDU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511014435.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-23
Publication Date
2025-12-26
Estimated Expiration
2045-07-23

AI Technical Summary

Technical Problem

In embedded devices, when existing technologies virtualize multiple IP addresses through a single physical Ethernet port, the address mapping of data packets may become chaotic due to the data relay module, causing data packets to be transmitted in a confused manner between peer communication nodes, which cannot meet the dynamic resource allocation requirements of hardware devices.

Method used

By setting up a mapping between virtual network nodes in the slave device and physical network nodes in the master device, combined with the address mapping module filtering mechanism, the directional transmission of data is ensured.

Benefits of technology

It enables accurate data distribution of virtualized multiple network nodes on a single physical network card, solves the problem of packet scrambling, meets the dynamic resource allocation requirements of hardware devices, and balances cost control and communication reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602453B_ABST
    Figure CN120602453B_ABST
Patent Text Reader

Abstract

The application discloses a network communication system and method, and belongs to the technical field of network communication. The system comprises a master device, a data transfer module and a slave device. The master device comprises a plurality of physical network nodes, which are in communication connection with the data transfer module; the slave device is provided with virtual network nodes corresponding to the physical network nodes one by one, and the virtual network nodes are in communication connection with the data transfer module through physical network cards of the slave device. The slave device is used for acquiring first service data containing a target logical address, determining a corresponding target physical network node, and processing the service data by a corresponding source virtual network node, and sending the processed data to the data transfer module through the physical network card, wherein the processed data contains a source physical address of the source virtual network node. The data transfer module determines the corresponding target physical network node according to the source physical address, and forwards the first service data to the node. The application effectively solves the problem of confused transmission of data packets between peer communication nodes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network communication, and particularly relates to a network communication system and method. BACKGROUND

[0002] In the field of embedded devices, in order to support multiple IP address configurations, two methods are usually adopted. The first method is to virtualize multiple IP addresses (Internet Protocol Address) and MAC addresses (Media Access Control Address) through software technology on the basis of a single physical Ethernet port, so that these addresses share the same physical interface. The second method is to increase an additional physical network interface module, for example, to connect W5500 (Ethernet controller) or ESP8266 / ESP32 (integrated Wi-Fi function microcontroller chip set) through SPI (Serial Peripheral Interface) / UART (Universal Asynchronous Receiver / Transmitter), so as to expand the number of wired or wireless communication ports.

[0003] In actual application scenarios, there is a specific requirement: the hardware device needs to dynamically allocate resources according to different application scenarios. For example, in scenario one, the device is used and configured as a single network node; and in scenario two, the resources of the device are divided and mapped into multiple groups, each group operating as an independent network node. This situation is particularly common in communication base station products, such as Remote Radio Unit (RRU) devices, which have multiple transceiver channels. When the number of users in the deployment area is small but the service bandwidth requirement is high, all the resources of the RRU will be allocated to a single small area (cell), at which time the RRU corresponds to a network node. Conversely, if the number of users is large but the service bandwidth requirement is low, the radio frequency resources of the RRU can be divided into multiple groups, each group corresponding to a cell, so that the RRU contains multiple network nodes.

[0004] Considering the cost factor, the RRU device does not support multiple network nodes (i.e. multiple IP addresses) by increasing the physical network interface. Therefore, it is necessary to virtualize multiple network nodes by a software method based on a single physical Ethernet port to support multiple IP addresses. In order to realize the dynamic configuration of the network nodes of the RRU device, a data transfer module for data aggregation and distribution is added between the RRU and the upper layer baseband unit (BBU) and is implemented by FPGA (Field-Programmable Gate Array). Traditionally, the method of binding multiple IPs to a single physical network card by modifying the ARP layer protocol (Address Resolution Protocol) can select the corresponding MAC address network node according to the target IP address, so as to realize the correct shunting of communication data. However, due to the existence of the newly added data transfer module, problems such as confused transmission of data packets between peer communication nodes may occur. SUMMARY

[0005] In order to solve the problems of the prior art, the embodiments of the present application provide a network communication system and method. The technical solution is as follows:

[0006] On the one hand, a network communication system is provided, which comprises a master device, a data transfer module and a slave device. The master device comprises at least one physical network node, and the at least one physical network node is respectively connected in communication with the data transfer module. The slave device comprises a virtual network node corresponding to the at least one physical network node, and the virtual network node is connected in communication with the data transfer module through a physical network card of the slave device.

[0007] The slave device is configured to obtain first service data to be sent. The first service data comprises a target logical address, and the target logical address indicates a target physical network node in the at least one physical network node which receives the first service data.

[0008] The slave device is further configured to determine a source virtual network node in the at least one virtual network node which corresponds to the target physical network node, process the first service data based on the source virtual network node, and send the processed first service data to the data transfer module through the physical network card. The processed first service data comprises a source physical address indicating the source virtual network node.

[0009] The data transfer module is configured to determine the target physical network node in the at least one physical network node which corresponds to the source virtual network node based on the source physical address, and send the first service data to the target physical network node.

[0010] In an example embodiment, the master device is configured to send second service data to the slave device via the data relay module; the second service data comprises a target physical address, the target physical address indicating a target virtual network node in the at least one virtual network node to process the second service data;

[0011] The slave device is further configured to receive the second service data via the physical network card, process the second service data based on the target virtual network node indicated by the target physical address, determine a source physical network node corresponding to the target virtual network node in the at least one physical network node based on the target physical address, and dispatch the processed second service data to a logical module for processing services corresponding to the target virtual network node.

[0012] In an example embodiment, the slave device further comprises a first address mapping module, the first address mapping module being configured to maintain first address mapping information, the first address mapping information being used to store mapping relationship between logical addresses and physical addresses of the at least one physical network node; the first address mapping module is configured to:

[0013] check whether the target logical address exists in the first address mapping information;

[0014] in a case where the target logical address does not exist in the first address mapping information, send a network address request for the target logical address to the master device, so that the master device returns a network address reply, the network address reply indicating a target physical address corresponding to the target logical address;

[0015] update the first address mapping information based on the target logical address and the corresponding target physical address.

[0016] In an example embodiment, the first address mapping module is further configured to:

[0017] parse the second service data to obtain a source logical address and a source physical address in the second service data;

[0018] determine whether the source logical address in the second service data or the source physical address in the second service data exists in the first address mapping information;

[0019] in a case where the source logical address in the second service data does not exist in the first address mapping information and the source physical address in the second service data does not exist in the first address mapping information, update the first address mapping information based on the source logical address and the source physical address in the second service data.

[0020] In an exemplary embodiment, the slave device is further configured to:

[0021] In the case of processing the address resolution data packet, the address resolution data packet is resolved to obtain a verification logical address in the address resolution data packet;

[0022] In the case that the verification logical address indicates any of the virtual network nodes, it is verified whether the verification logical address verifies that the current virtual network node matches; the current virtual network node and processing of the address resolution data packet belong to the same data transmission process.

[0023] In an exemplary embodiment, the slave device is further configured to, in the case that the verification logical address indicates any of the physical network addresses, verify, based on preset node mapping information, whether a correspondence between the physical network node indicated by the verification logical address and the current virtual network node is established; the preset node mapping information indicates a one-to-one correspondence between the physical network nodes of the master device and the virtual network nodes of the slave device.

[0024] In an exemplary embodiment, the master device further comprises a second address mapping module, configured to maintain second address mapping information, the second address mapping information being used to store a mapping relationship between a logical address and a physical address of at least one of the virtual network nodes.

[0025] In an exemplary embodiment, the slave device comprises physical resources shared by the virtual network nodes, and logical resources corresponding to each of the virtual network nodes;

[0026] For each of the virtual network nodes, the virtual network node is configured to, in the case that the physical resources are occupied, occupy the logical resources corresponding to the virtual network node, and until the physical resources are released, preempt the physical resources and release the logical resources.

[0027] In an exemplary embodiment, the slave device is further configured to initialize the virtual network nodes;

[0028] For each of the virtual network nodes, the physical resources and the logical resources corresponding to the virtual network nodes are configured to, in the case that initialization of the virtual network nodes is completed, open the virtual network nodes.

[0029] In another aspect, a network communication method based on the network communication system according to any one of the preceding embodiments is provided. The system includes a master device, a data relay module, and a slave device. The master device includes at least one physical network node, which is communicatively connected to the data relay module. The slave device includes a virtual network node corresponding to the at least one physical network node, which is communicatively connected to the data relay module through a physical network card of the slave device. The method includes:

[0030] The slave device obtains first service data to be sent. The first service data includes a target logical address, which indicates a target physical network node in the at least one physical network node that receives the first service data.

[0031] The slave device determines a source virtual network node in the at least one virtual network node that corresponds to the target physical network node. The slave device processes the first service data based on the source virtual network node and sends the processed first service data to the data relay module through the physical network card. The processed first service data includes a source physical address that indicates the source virtual network node.

[0032] The data relay module determines the target physical network node in the at least one physical network node that corresponds to the source virtual network node based on the source physical address and sends the first service data to the target physical network node.

[0033] In another aspect, an electronic device is provided. The electronic device includes a processor and a memory. The memory stores at least one instruction or at least one program. The at least one instruction or the at least one program is loaded and executed by the processor to implement the network communication method according to any one of the preceding aspects.

[0034] In another aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores at least one instruction or at least one program. The at least one instruction or the at least one program is loaded and executed by a processor to implement the network communication method according to any one of the preceding aspects.

[0035] In another aspect, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium. The processor executes the computer instructions to cause the electronic device to perform the network communication method according to any one of the preceding aspects.

[0036] The embodiment of the present application provides a network communication system, by setting the slave device virtual network node corresponding to the master device physical network node, when the slave device obtains the first service data to be sent, the corresponding target physical network node is determined according to the target logical address, and the data is processed through the corresponding source virtual network node, the explicit source physical address identification is added to the data packet, and then the corresponding target physical network node is directly determined based on the source physical address by the data transfer module and the data is sent, so that the address mapping confusion problem caused by the data transfer module in the traditional dependence ARP protocol is bypassed, the data packet can be accurately distributed to the target physical network node through the data transfer module based on the virtualization of the single physical network card, the problem of confused transmission of the data packet between the peer communication nodes is effectively solved, the demand of dynamic allocation of resources of the hardware device is met, and cost control and communication reliability are considered. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0038] Figure 1 It is a structural block diagram of a network communication system provided by the embodiment of the present application.

[0039] Figure 2 It is a flowchart of a data sending method provided by the embodiment of the present application.

[0040] Figure 3 It is a flowchart of a data receiving method provided by the embodiment of the present application.

[0041] Figure 4 It is a flowchart of an address resolution data packet sending method provided by the embodiment of the present application.

[0042] Figure 5 It is a flowchart of a method for maintaining address mapping information provided by the embodiment of the present application.

[0043] Figure 6 It is a flowchart of an address resolution data packet receiving method provided by the embodiment of the present application.

[0044] Figure 7 It is a flowchart of an Ethernet driver initialization method provided by the embodiment of the present application. DETAILED DESCRIPTION

[0045] With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of the present application.

[0046] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or server including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product, or device.

[0047] It can be understood that in the specific embodiments of the present application, data related to user information and the like is involved, and when the above embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of related data need to comply with relevant laws, regulations, and standards of countries and regions.

[0048] Considering the cost factor, the embedded slave device supports multiple IP addresses based on a single physical Ethernet port by virtualizing multiple network nodes using software methods and adding a data relay module between the slave device and the master device. However, due to the existence of the newly added data relay module, it may cause problems such as confused transmission of data packets between peer communication nodes. This is because the data relay module is responsible for processing data packets from different logical network nodes and forwarding them to the corresponding physical network interface. However, this mechanism may cause the source and destination address information of the data packets to become ambiguous during the aggregation and redistribution process, especially when multiple logical network nodes share the same physical interface, increasing the risk of incorrect routing or repeated sending of data packets. In addition, since the ARP protocol relies on MAC addresses to determine the next hop address, the data relay module may not be able to accurately maintain the MAC address table of each logical network node, further exacerbating the possibility of data packet confusion.

[0049] In view of this, the embodiments of the present application bind the correspondence between the virtual network nodes of the slave device and the physical network nodes of the master device, and combine the address mapping module filtering mechanism to ensure directional transmission of data.

[0050] Referring to Figure 1 , which is a structural block diagram of a network communication system provided by an embodiment of the present application. Specifically, as Figure 1 indicated, the system can include a master device, a data relay module, and a slave device, the master device includes at least one physical network node, the at least one physical network node is respectively in communication connection with the data relay module, the slave device includes virtual network nodes corresponding to the at least one physical network node, and the virtual network nodes are in communication connection with the data relay module through a physical network card of the slave device. Specifically, Figure 1 a typical application scenario of the network communication system of the present application is shown, in which the slave device is an embedded device supporting a multi-logical address configuration, and the master device realizes communication with the slave device through the data relay module. The master device includes at least one physical network node, two physical network nodes are taken as an example in the figure, denoted as eth0 and eth1, and each physical network node establishes a communication connection with the data relay module through an independent physical communication channel (such as an optical fiber or a network cable); the slave device is configured with virtual network nodes corresponding to the physical network nodes one by one, denoted as e0 and e1 in the figure, and the virtual network nodes realize data interaction with the data relay module through the physical network card of the slave device, forming a corresponding communication link of “physical network node-data relay module-virtual network node”.

[0051] Among them, the master device is a device (such as a baseband unit BBU) including at least one physical network node, the physical network node refers to a hardware module (such as an Ethernet interface unit) having an independent network communication function and being capable of independently receiving and transmitting data; the slave device is a device (such as a remote radio unit RRU) that needs to communicate with the master device, and its virtual network node is a logical communication unit virtualized on a single physical network card through software technology, and has a preset one-to-one correspondence relationship (such as a physical node eth0 corresponding to a virtual node e0) with the physical network node of the master device, thereby ensuring the directionality of the communication link.

[0052] In a specific implementation, the slave device runs on an RT-Thread RTOS (Real-Time Operating System) and uses an lwIP-2.0.2 (Lightweight IP version 2.0.2) protocol stack. The slave device virtually creates a virtual network node based on a physical network card through software, and the physical network node of the master device communicates with the virtual network node of the slave device through a transmission channel, so as to Figure 1 For example, the eth0 node communicates with the e0 node, and the eth1 node communicates with the e1 node. Point-to-point communication between the physical network node and the virtual network node is realized in logic.

[0053] The slave device is configured to acquire first service data to be sent; the first service data comprises a target logical address, and the target logical address indicates a target physical network node in the at least one physical network node which receives the first service data. Specifically, the first service data is service data sent by the slave device to the master device, and the target logical address (such as an IP address) contained in the first service data explicitly indicates a target physical network node in the master device which receives the data; the slave device processes the data by determining a source virtual network node corresponding to the target physical network node, and causes the processed data to carry a source physical address (such as a MAC address), which uniquely identifies the source virtual network node.

[0054] The slave device is further configured to determine a source virtual network node in the at least one virtual network node corresponding to the target physical network node, process the first service data based on the source virtual network node, and send the processed first service data to the data relay module through the physical network card; the processed first service data comprises a source physical address indicating the source virtual network node.

[0055] The data relay module is configured to determine a target physical network node in the at least one physical network node corresponding to the source virtual network node based on the source physical address, and send the first service data to the target physical network node.

[0056] Specifically, the bottom layer driver of the slave device associates the virtual network node with the physical network card through a software mechanism. Specifically, in the bottom layer driver processing function of the physical network card interface, although each virtual network node is not directly distinguished, when the bottom layer Ethernet communication transceiver process calls a transceiver function, the network interface data structure pointer of the corresponding virtual network node is transmitted according to the trigger message, so that the to-be-transceived data is bound to the corresponding virtual network node data structure, and it is ensured that the processed service data can accurately carry the source physical address of the source virtual network node.

[0057] Please refer to Figure 2 which shows a flowchart of a data sending method provided by an embodiment of the present application. It should be noted that the present specification provides method operation steps such as embodiments or flowcharts, but more or fewer operation steps can be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one of the many execution orders, and does not represent the only execution order. In actual system or product execution, the method order shown in the embodiments or the drawings can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment). Figure 2The driving layer data sending process is shown in detail. The rt_stm32_eth_tx function is called from the device to initiate the sending operation, the corresponding source virtual network node (such as e0 or e1) is identified through the dev parameter, and the structure of the virtual network node is deduced through the _rt_seek_eth function. When the DMA descriptor is available, the first service data containing the target logical address is copied to the DMA sending buffer (the data is split when the data is processed), and finally the HAL_ETH_TransmitFrame () function is called to start transmission, while processing underflow and other sending errors. Since the virtual network nodes share the data transfer channel (i.e. physical resources) of the physical network card, only one virtual network node is allowed to occupy the physical resources to send data at the same time, ensuring that the processed first service data carries a unique source physical address. Before calling rt_stm32_eth_tx, the source virtual network node's to-be-sent data has been copied to the pbuf buffer, ensuring the binding relationship between the data and the source virtual network node.

[0058] As can be seen from the above technical solutions of the embodiments of the present application, by setting the slave device virtual network node corresponding to the master device physical network node, when the slave device obtains the to-be-sent first service data, the corresponding target physical network node is determined according to the target logical address, and the data is processed through the source virtual network node corresponding thereto, and a clear source physical address identifier is added to the data packet, and then the data transfer module directly determines the corresponding target physical network node based on the source physical address and sends the data, thereby bypassing the address mapping confusion problem caused by the traditional dependence on the ARP protocol due to the existence of the data transfer module, and ensuring that the data packet can be accurately distributed to the target physical network node through the data transfer module based on the virtualization of a single physical network card, effectively solving the problem of confused transmission of data packets between peer communication nodes, while meeting the demand for dynamic allocation of resources of hardware devices, and taking into account cost control and communication reliability. When the slave device works in the single logical address mode, the physical network card is bound to a network node, and the ping packet average communication time between the master device and the slave device is low. When switched to the multi-logical address mode, the virtual network node is implemented through software virtualization, and the average time of the same type of ping packet is slightly increased, but the system makes the increase very small, and the influence of software processing on actual application can be ignored.

[0059] In an exemplary embodiment, the master device is configured to send second service data to the slave device via the data relay module; the second service data comprises a target physical address, which indicates a target virtual network node in the at least one virtual network node that processes the second service data. The second service data is service data sent by the master device to the slave device, and the target physical address (such as the MAC address of the virtual network node e0) contained in the second service data directly indicates the target virtual network node in the slave device that processes the data, thereby ensuring that the data is directed to the corresponding logical unit.

[0060] The slave device is further configured to receive the second service data via the physical network card, process the second service data based on the target virtual network node indicated by the target physical address, determine a source physical network node corresponding to the target virtual network node in the at least one physical network node based on the target physical address, and assign the processed second service data to a logical module for processing services corresponding to the target virtual network node. Specifically, after the physical network card of the slave device receives the second service data, the target virtual network node is determined by analyzing the target physical address, and the data is processed based on the logical resource dedicated to the node; at the same time, the source physical network node (such as e0 corresponding to eth0) in the master device that sends the data is determined based on the reverse mapping of the target physical address, thereby ensuring that the data processing result can be correctly associated with the sending node of the master device. The slave device assigns the data to a logical module for processing services corresponding to the target virtual network node, which is an application layer unit (such as a process for processing eth0 service corresponding to e0) bound to the target virtual network node, thereby realizing accurate matching of service data and application scenarios.

[0061] Specifically, the physical network nodes of the master device and the virtual network nodes of the slave device have a preset one-to-one correspondence (such as eth0 corresponding to e0 and eth1 corresponding to e1), and when the master device sends the second service data to the slave device via the data relay module, the data contains a target physical address, which is used to indicate the target virtual network node (such as e0 or e1) that processes the data. After the slave device receives the second service data, the corresponding target virtual network node can be determined according to the source logical address (corresponding to the logical address of the physical network node) of the master device in the communication data packet: when receiving the address resolution data packet, the target virtual network node (e0 or e1) is determined based on the source logical address (such as the IP address of eth0 or eth1); when sending data, the corresponding source virtual network node is selected based on the target logical address (the IP address of eth0 or eth1), thereby ensuring that the address mapping table of the physical network node of the master device stores the logical address and the physical address of the corresponding virtual network node of the slave device, and ensuring the communication directivity.

[0062] Since the master device only communicates with the slave device through one physical network node at the same time, the upper-layer UDP / TCP protocol adopts a single processing process, and the process internally determines the corresponding slave device virtual network node according to the logical address of the master device communication gateway, thereby ensuring point-to-point communication of the upper-layer data.

[0063] Referring to Figure 3 Fig. 1 is a flowchart of a data receiving method according to an embodiment of the present application. Figure 3 The data receiving process of the driver layer is shown. After the Ethernet data arrives, the ETH_IRQHandler interrupt is triggered, the HAL_ETH_IRQHandler interrupt processing is called, and after the interrupt processing is completed, the subsequent operation is continued through the HAL_ETH_RxCpltCallback callback function. The target physical address (MAC address) in the data is parsed through the _rt_determine_eth () function, the corresponding target virtual network node (such as e0 or e1) is determined, and then the eth_device_ready () function is called to notify the target virtual network node that data has arrived. The data reading is completed through the rt_stm32_eth_rx () function, the data is copied from the DMA buffer to the pbuf buffer of the target virtual network node in the function, and finally the DMA descriptor is released to prepare for the next reception. The upper-layer application parses the data in the pbuf buffer and dispatches it to the corresponding logical module of the service.

[0064] In the Ethernet driver layer, the identification of the virtual network node is realized through the __rt_determine_eth () function based on the physical address (MAC address). In the callback function, the target virtual network node is accurately matched according to the target physical address carried by the ETH_HandleTypeDef parameter, thereby ensuring that the second service data is correctly processed and dispatched.

[0065] As can be seen from the above technical solutions of the embodiments of the present application, the embodiments of the present application form a closed loop with the forward mechanism when data is sent through reverse address mapping and node binding, thereby ensuring the accuracy of bidirectional communication. The target physical address carried by the second service data directly points to the target virtual network node that processes the data, thereby ensuring that the data is directed to the corresponding logical unit. The slave device reversely maps the source physical network node based on the target physical address and dispatches the processing result, thereby ensuring the correct association of the service data and the sending node of the master device. This mechanism solves the problem of ambiguous reverse transmission address caused by the data transfer module, ensures that the upper-layer UDP / TCP protocol can realize point-to-point communication based on the node correspondence, and improves the accuracy and integrity of bidirectional communication.

[0066] The first address mapping module of the slave device is responsible for maintaining the first address mapping information, which stores the correspondence between the logical address (such as IP address) and the physical address (such as MAC address) of the master device physical network node. Since the communication between the master device physical network node (such as eth0, eth1) and the slave device virtual network node (such as e0, e1) needs to pass through the data transfer module implemented by the FPGA, the address resolution data packet (such as ARP packet) received by the slave device may confuse the logical address and the physical address of the physical network node, and therefore the first address mapping module is needed to analyze and filter the received master device address resolution data packet, so as to ensure that the logical address and the physical address of the physical network node in the first address mapping information correspond to each other.

[0067] In an exemplary embodiment, the slave device further comprises a first address mapping module, which is configured to maintain the first address mapping information, and the first address mapping information is configured to store the mapping relationship between the logical address and the physical address of at least one physical network node. Specifically, the first address mapping information is a table (such as ARP table) storing the correspondence between the logical address (such as IP address) and the physical address (such as MAC address) of the master device physical network node, and is a key basis for the slave device to analyze the target node.

[0068] The first address mapping module is configured to check whether the target logical address exists in the first address mapping information, send a network address request for the target logical address to the master device in the case that the target logical address does not exist in the first address mapping information, so that the master device returns a network address reply indicating the target physical address corresponding to the target logical address, and update the first address mapping information based on the target logical address and the corresponding target physical address. Specifically, when the slave device processes the first service data, the first address mapping module first checks whether the target logical address contained in the data exists in the mapping information: if not, the module sends a network address request (such as ARP request packet) to the master device, and the request carries the target logical address to be queried; the master device returns a network address reply (such as ARP response packet) after receiving the request, which explicitly indicates the target physical address corresponding to the target logical address; and the slave device updates the first address mapping information based on the reply, so as to ensure that the subsequent data can correctly analyze the target node.

[0069] Please refer to Figure 4 which shows a flowchart of an address resolution data packet sending method provided by an embodiment of the application. Figure 4The sending process flow of the address resolution data packet is shown. Specifically, the validity of input parameters is checked, including a virtual network node identifier (netif), a data buffer (q), and a target logical address (ipaddr). If a multi-IP mode is supported, a GetCorrNetif () function is called to determine the corresponding source virtual network node according to the target logical address (i.e., the logical address of the target physical network node of the master device). The process continues only when the slave device is initialized (allowed to respond). Otherwise, the original process flow is executed. According to the target address type (fixed as unicast in this scenario), the target physical address corresponding to the target logical address is queried from the first address mapping information. The data packet is sent through the etharp_output_to_arp_index or etharp_query function. If the target logical address does not exist in the first address mapping information, the first address mapping module sends a network address request to the master device for the target logical address. After the master device returns a network address reply containing the target physical address, the first address mapping information is updated based on the target logical address and the target physical address, ensuring the accuracy of subsequent data transmission.

[0070] As can be seen from the above technical solutions of the embodiments of the present application, the first address mapping module dynamically maintains the logical address and physical address mapping relationship of the physical network node of the master device, solving the problem of address information missing or being out of date caused by the data relay module. When the target logical address does not exist, the module actively requests and updates the mapping information, ensuring that the slave device always holds the correct address correspondence relationship, avoiding the first business data transmission failure caused by unknown addresses. This mechanism realizes the real-time and accuracy of address mapping, provides a reliable address resolution basis for the slave device to send data to the master device, and improves the stability of communication.

[0071] In one exemplary embodiment, the first address mapping module is further configured to: analyze the second business data to obtain a source logical address and a source physical address in the second business data; determine whether the first address mapping information contains the source logical address in the second business data or the source physical address in the second business data; and update the first address mapping information based on the source logical address and the source physical address in the second business data, in a case where the first address mapping information does not contain the source logical address in the second business data and the first address mapping information does not contain the source physical address in the second business data.

[0072] Specifically, after receiving the second service data from the device, the first address mapping module parses the data, extracts the source logical address (such as the IP address of eth0) and the source physical address (such as the MAC address of eth0) of the source physical network node of the master device, and the two addresses jointly identify the sending node of the master device. The module then determines whether the source logical address or the source physical address exists in the first address mapping information: only when neither of them exists, the mapping information is updated based on the parsing result (a new address corresponding relationship is added); if either address exists, it is not updated to avoid address conflict (such as the same IP corresponding to different MACs).

[0073] Specifically, the first address mapping module is also responsible for dynamically improving the first address mapping information by parsing the second service data received from the device. Specifically, the first address mapping module parses the second service data, extracts the source logical address (i.e. the logical address of the source physical network node of the master device) and the source physical address (i.e. the physical address of the physical network node), and determines whether the source logical address or the source physical address exists in the first address mapping information: if neither of them exists, it means that the corresponding relationship is a new entry, and the module will update the first address mapping information based on the source logical address and the source physical address obtained by parsing; if either address exists, it is not updated to avoid conflict.

[0074] Please refer to Figure 5 which shows a flowchart of a method for maintaining address mapping information provided by an embodiment of the application. Figure 5 The maintenance process of the first address mapping information is shown, specifically, the variables are initialized, and then all entries in the first address mapping information are traversed, and each entry is checked multiple times: whether the entry is empty (the logical address is 0); if the input source logical address matches the entry logical address, further check the physical address, if the entry physical address is all zeros and the input physical address is non-zero, allow to overwrite; otherwise, check whether the physical address is different (there is a logical address conflict); if the physical address is the same, mark as existing; whether the logical address matches or not, check whether the physical address is repeated (exclude the self entry). According to the checking result, return the status code: 1 indicates that there is a logical address conflict or a physical address repetition; 2 indicates that the first address mapping information is empty; 3 indicates that the input source logical address and the source physical address already exist; 0 indicates no conflict or repetition. Only when the status code is 2 (the information is empty) or 0 (no conflict), the corresponding relationship between the source logical address and the source physical address is added to the first address mapping information, to ensure the accuracy and uniqueness of the information.

[0075] From the above technical solutions of the embodiments of the present application, it can be seen that the embodiments of the present application ensure the uniqueness and accuracy of the address mapping information through the verification and updating mechanism of the first address mapping module on the source address in the second service data. The module updates the mapping only when the source logical address and the source physical address do not exist, avoiding the introduction of duplicate addresses or address conflicts, effectively filtering the address confusion caused by the data transfer module (such as the address confusion of eth0 and eth1). This mechanism maintains the purity of the first address mapping information, prevents packet disorder or loss caused by incorrect address association, and further improves the reliability of address resolution.

[0076] In an exemplary embodiment, the slave device is further configured to: in the case of processing an address resolution packet, resolve the address resolution packet to obtain a verification logical address in the address resolution packet; in the case that the verification logical address indicates any virtual network node, verify whether the verification logical address verifies that the current virtual network node matches; and the current virtual network node belongs to the same data transmission process as the processing of the address resolution packet.

[0077] The address resolution packet is a packet for querying or responding to an address mapping relationship (such as an ARP request / response), and the verification logical address (such as an IP address to be queried) contained therein is used to determine the target node of the packet.

[0078] Specifically, when the verification logical address indicates any virtual network node (such as the IP address of e0) of the slave device, the slave device needs to verify whether the address matches the current virtual network node - the virtual node to which the data transmission process that processes the packet belongs (such as e0 for the processing process of e0), and if not, the packet is discarded to avoid incorrect resolution. Ensure that the address resolution packet is only processed by the target virtual node to prevent address information interference across nodes, and the logic is clear and executable.

[0079] Specifically, in the data sending process, the current virtual network node is the source virtual network node, and in this process, if the slave device processes an address resolution packet, the verification logical address in the address resolution packet is extracted, and if the verification logical address indicates a virtual network node, the verification logical address is compared to determine whether it indicates the source virtual network node to verify the correctness of the source virtual network node. In the data receiving process, the current virtual network node is the target virtual network node, and in this process, if the slave device processes an address resolution packet, the verification logical address in the address resolution packet is extracted, and if the verification logical address indicates a virtual network node, the verification logical address is compared to determine whether it indicates the target virtual network node to verify the correctness of the target virtual network node.

[0080] It can be seen from the technical solutions of the embodiments of the present application that the embodiments of the present application accurately guarantee the correctness of the nodes in the data sending and receiving process by verifying the matching of the verification logical address and the current virtual network node when processing the address resolution data packet. In the data sending scenario, the current virtual network node is the source virtual network node, and if the verification logical address of the address resolution data packet indicates a virtual network node, the legality of the source virtual network node can be directly verified by comparing whether the address points to the source virtual network node, which avoids the participation of an incorrect source virtual network node in data sending and prevents data packets from being sent to incorrect links due to incorrect source node matching. In the data receiving scenario, the current virtual network node is the target virtual network node, and if the verification logical address indicates a virtual network node, the data can be ensured to be processed by the correct target virtual network node by comparing whether the address points to the target virtual network node, which eliminates the situation of incorrect target node misreceiving data. This verification mechanism filters abnormal address resolution requests from the node identity level, avoids address information interference across nodes, lays a foundation for the directionality of subsequent data transmission, and effectively reduces communication confusion caused by incorrect node identification.

[0081] In an exemplary embodiment, the slave device is further configured to, in a case where the verification logical address indicates any physical network address, verify whether a corresponding relationship between the physical network node indicated by the verification logical address and the current virtual network node is established based on preset node mapping information, and the preset node mapping information indicates a one-to-one corresponding relationship between the physical network nodes of the master device and the virtual network nodes of the slave device.

[0082] Specifically, when the verification logical address indicates any physical network node (such as the IP address of eth0) of the master device, the slave device verifies whether the corresponding relationship between the physical network node and the current virtual network node is established (such as eth0 needs to correspond to e0) based on the preset node mapping information (such as a table storing that eth0 corresponds to e0 and eth1 corresponds to e1). If the corresponding relationship is not established (such as the address of eth0 is processed by e1), the address resolution data packet is rejected to prevent incorrect address mapping from being recorded. If the corresponding relationship is established, the address resolution data packet is processed normally and the mapping information is updated. This mechanism further guarantees the accuracy of address resolution by verifying the corresponding relationship between the nodes.

[0083] Specifically, when processing an address resolution packet (such as an ARP packet), the slave device parses the packet to obtain a verification logical address, and performs matching verification based on the address. If the verification logical address indicates any virtual network node of the slave device, the slave device verifies whether the verification logical address matches the current virtual network node (the current virtual network node and processing of the address resolution packet belong to the same data transmission process); if the verification logical address indicates any physical network node of the master device, the slave device verifies whether the physical network node and the current virtual network node correspond based on preset node mapping information (the information explicitly indicates a one-to-one correspondence between the physical network nodes of the master device and the virtual network nodes of the slave device, such as eth0 corresponding to e0 and eth1 corresponding to e1).

[0084] Specifically, in the data sending process, the current virtual network node is the source virtual network node. If the slave device processes an address resolution packet in the process, the verification logical address in the address resolution packet is extracted. If the verification logical address indicates a physical network node, it is determined whether the physical network node indicated by the verification logical address corresponds to the source virtual network node, so as to verify the correctness of the source virtual network node. In the data receiving process, the current virtual network node is the target virtual network node. If the slave device processes an address resolution packet in the process, the verification logical address in the address resolution packet is extracted. If the verification logical address indicates a physical network node, it is determined whether the physical network node indicated by the verification logical address corresponds to the target virtual network node, so as to verify the correctness of the target virtual network node.

[0085] Referring to Figure 6 which is a flowchart of an address resolution packet receiving method provided by an embodiment of the present application. Figure 6The input processing flow of the address resolution data packet is shown. Specifically, the data packet format is verified, and the hardware type, length, protocol type and length are checked to see if they conform to the Ethernet address resolution protocol standard. Invalid data packets will be discarded and errors will be recorded. If valid, the source logical address and target logical address are extracted. If the interface has been configured with IP and supports multi-IP mode, the GetActiveNetif () function is called to determine the virtual network node to which the verified logical address belongs, and for_us=1 is marked and the corresponding node is set. Otherwise, the target IP is directly compared, and if they do not match, for_us=0 is marked. Then, the is_mac_repeated () function is used in combination with the first address mapping information maintenance method described above to check if the source logical address and the source physical address are repeated, and whether to update the first address mapping information is determined according to the check result. The address resolution request is processed, and if the request is directed to a slave device and for_us=1 and the slave device has completed initialization (allowing a response), an address resolution reply is sent, otherwise the request is ignored. If it is an address resolution reply, the DHCP (Dynamic Host Configuration Protocol) module is notified, and the address resolution reply is processed by the DHCP module. In other cases, the corresponding information is recorded. Finally, the memory of the received address resolution data packet is released. Through the above process, it is ensured that the processing of the address resolution data packet conforms to the preset node mapping relationship, and address confusion is avoided.

[0086] As can be seen from the above technical solutions of the embodiments of the present application, the embodiments of the present application verify the correspondence between the physical network node and the current virtual network node based on the preset node mapping information, further enhancing the accuracy of the data transmission link. In the data sending scenario, the current virtual network node is the source virtual network node. If the verification logical address of the address resolution data packet indicates a physical network node, by checking whether the physical network node and the source virtual network node conform to the preset correspondence (such as the master device physical node eth0 corresponding to the slave device source virtual node e0), it can be ensured that the source virtual network node and the target physical network node of the master device are in the correct preset link, avoiding mismatch of the source node and the physical node link. In the data receiving scenario, the current virtual network node is the target virtual network node. If the verification logical address indicates a physical network node, by checking the preset correspondence between the physical network node and the target virtual network node, it can be ensured that the target virtual network node and the source physical network node of the master device are in the correct link, preventing mismatch of the target node and the physical node link. This verification mechanism based on preset mapping filters abnormal address resolution requests from the node link level, completely eliminates the problem of cross-link data packet transmission caused by chaotic node correspondence, and ensures that data always flows in the preset "physical network node-virtual network node" link, further improving the reliability of communication.

[0087] In an exemplary embodiment, the master device further comprises a second address mapping module, configured to maintain second address mapping information, which is used to store the mapping relationship between the logical address and the physical address of at least one virtual network node.

[0088] Specifically, the method for the second address mapping module to maintain the second address mapping information can refer to the method for the first address mapping module to maintain the second address mapping information.

[0089] The second address mapping module is a unit in the master device for maintaining the address mapping of the virtual network node, and its second address mapping information stores the correspondence between the logical address (such as the IP address of e0) and the physical address (such as the MAC address of e0) of the virtual network node of the slave device. The function of this module is symmetrical to the first address mapping module of the slave device, ensuring that the master device can correctly resolve the address information of the virtual node of the slave device and providing a basis for address resolution of bidirectional communication.

[0090] As can be seen from the above technical solutions of the embodiments of the present application, the second address mapping module of the master device maintains the address mapping of the virtual network node of the slave device, forming a symmetrical mechanism with the first address mapping module of the slave device, and solving the problem of address resolution of the virtual node of the slave device by the master device. The second address mapping information ensures that the master device can accurately obtain the correspondence between the logical address and the physical address of the virtual network node, providing a reliable basis for address resolution for the sending of the second service data, ensuring the directivity of the master device when sending data to the slave device, and perfecting the address resolution system of bidirectional communication.

[0091] Due to the existence of the newly added data relay module, the data packets may not be transmitted in order, and the phenomenon of time cross-folding may occur. This is because the module needs to process data packets from different logical network nodes and aggregate and redistribute them. In high-load situations, data packets from different sources may arrive at the aggregation module at the same time, causing inconsistent delays in processing and forwarding. In addition, if the system does not mark each data packet with an accurate timestamp or prioritize it, the data packets may lose their original timing relationship during the aggregation and distribution process, resulting in a chaotic order of data packets received at the receiving end, i.e., the phenomenon of time cross-folding. This non-sequential transmission can seriously affect application scenarios with high real-time requirements, such as voice calls and video conferences, and may lead to a decrease in service quality.

[0092] In view of this, in the embodiments of the present application, the master device communicates with the slave device through only one physical network node at the same time, and the upper-layer UDP / TCP protocol uses a single processing process, and the corresponding slave device virtual network node is determined according to the gateway address of the master device, so as to ensure that data is processed in the order of the same node. The bottom-layer driver limits only one virtual network node to send data at the same time, so as to avoid data packet cross-mixing caused by simultaneous sending of the virtual network nodes, and to ensure the transmission order.

[0093] In one exemplary embodiment, the slave device includes physical resources shared by the virtual network nodes, and logical resources corresponding to each virtual network node;

[0094] For each virtual network node, the virtual network node is configured to occupy the logical resources corresponding to the virtual network node in the case that the physical resources are occupied, and to preempt the physical resources and release the logical resources when the physical resources are released.

[0095] The physical resources shared by the virtual network nodes refer to hardware resources (such as physical network cards, DMA controllers) of the slave device, and the logical resources corresponding to each virtual network node refer to software resources (such as exclusive buffer, configuration parameters).

[0096] Specifically, when the physical resources are occupied, the virtual node first occupies its own logical resources (such as cached data); after the physical resources are released, the virtual node immediately preempts the physical resources and releases the logical resources (such as transferring the cached data to the physical buffer for sending). Through the logical resource temporary storage-physical resource preemption, the ordered communication of multiple nodes under a single physical resource is realized, and resource conflicts are avoided.

[0097] Specifically, the virtual network nodes (such as e0 and e1) of the slave device share physical resources (such as physical ETH peripherals, physical layers, DMA resources, and interrupt processing modules), and each virtual network node has independent logical resources (such as network interface configurations, IP parameters, link states, and exclusive data buffers). Specifically, the physical address (such as the MAC address) of the virtual network node e1 is set to the last digit of the physical address of e0 plus 1, so as to ensure that the physical addresses of the two are different but associated. At the driver layer, the virtual network nodes share the physical resources, but the network interfaces, configurations, and states of each node are independent in logic. The PHY (Physical Layer Device) monitoring thread is responsible for detecting the physical link states corresponding to the two virtual network nodes, and synchronously notifying each node.

[0098] From the above technical solutions of the embodiments of the present application, it can be seen that for each virtual network node, when the physical resource is occupied by other nodes, the node will first occupy the logical resource (such as the exclusive data buffer) corresponding to the node to cache the data to be transmitted; until the physical resource is released, the node immediately occupies the physical resource and releases the cached data in the logical resource, thereby realizing time-sharing multiplexing of the physical resource. Through the "logical resource temporary storage-physical resource occupation" mechanism, the ordered data transmission of multiple virtual network nodes under a single physical resource is realized, the ordered nature of the data transmission of multiple virtual nodes is ensured while the hardware cost is controlled (without the need to increase the physical interface), the data packet mixing or loss caused by resource conflict is avoided, and the utilization efficiency of the physical resource is improved.

[0099] Due to the existence of the newly added data relay module, the data packet may stay in the network card for an indefinite time delay before being sent out. This is because the module needs to process data packets from different logical network nodes and aggregate, analyze, and redistribute them. In this process, in order to ensure that the data packet can be correctly routed to the target address, the module may need to temporarily store the data packet and wait for enough information for accurate path selection. This additional processing step increases the residence time of the data packet at the network interface, resulting in indefinite delay. Especially in high-load situations, as the amount of data to be processed increases, the data packet may experience a longer waiting time, further exacerbating the delay phenomenon. In addition, this design may also introduce a complex scheduling mechanism to manage data streams of different priorities, which may also cause some data packets to be delayed for sending in order to prioritize the processing of urgent or important traffic.

[0100] In view of this, the embodiments of the present application optimize the real-time processing mechanism of the underlying driver to reduce data retention. When receiving data from the device, the Ethernet interrupt is triggered, and the corresponding virtual network node is immediately notified. The data is copied from the DMA (Direct Memory Access) buffer to the pbuf (Packet Buffer) of the corresponding virtual network node and the DMA descriptor is released, avoiding data retention in the buffer. When sending data from the device, the availability of the DMA descriptor is checked before sending, and the transmission is immediately started, reducing the waiting time of the data in the network card. In addition, a PHY monitoring thread is created during initialization to periodically detect the physical link state, ensuring smooth link and avoiding data retention due to link abnormalities.

[0101] In an exemplary embodiment, the slave device is further configured to initialize the virtual network node. Specifically, the slave device initializes the virtual network node (e.g., e0, e1), and only after the initialization is completed, the physical resource opens the logical resource corresponding to the virtual network node, so as to avoid communication errors (e.g., the second address mapping information of the master device records error information) caused by the non-initialized virtual network node. In a specific implementation, a network interface data structure body corresponding to each virtual network node is created based on the lwIP-2.0.2 protocol stack, so as to support the adaptation of network communication. Since the master device can initiate asynchronous communication with the slave device at any time, if the slave device has not completed the initialization of the network port, and the master device has attempted to communicate with the slave device, the second address mapping information of the master device can record error information. To avoid such problems, a global variable is defined to identify whether the slave device has completed the initialization of the network port. Only after the initialization is completed, the slave device is allowed to process the receiving and sending operations of the address resolution packet.

[0102] For each virtual network node, the physical resource and the logical resource corresponding to the virtual network node are configured to open the virtual network node under the condition that the initialization of the virtual network node is completed.

[0103] Specifically, the initialization of the virtual network node by the slave device includes the steps of configuring network parameters (e.g., IP, MAC address), allocating logical resources, establishing node mapping relationship, etc. The opening of the physical resource and the logical resource to the virtual network node means that only after the initialization is completed, the node can use the physical network card, DMA, etc., and access the logical resource thereof. This prevents the non-initialized virtual node from participating in communication (e.g., address recording error caused by the master device sending data in advance), and ensures that the node is put into use after the node function is complete.

[0104] Specifically, refer to Figure 7 which is a flowchart of an Ethernet driver initialization method provided by the embodiment of the application. Figure 7The Ethernet initialization flow is shown. Specifically, the system is initialized, and specifically, the entire Ethernet system is initialized through the function of rt_hw_stm32_eth_init(), and the receive buffer (Rx_Buff), the transmit buffer (Tx_Buff), and the DMA descriptor (DMARxDscrTab, DMATxDscrTab, etc.) are allocated. The physical address of the virtual network node is configured, for example, e0 uses the incoming physical address, and e1 uses the address after the last digit plus 1. The virtual network node is registered, for example, the function of eth_device_init() is called to register e0 and e1 respectively. e0 corresponds to the stm32_eth_device structure, and the network interface pointer is stored in pRRU_eth_dev1. e1 corresponds to the stm32_eth_device1 structure, and the network interface pointer is stored in pRRU_eth_dev2. The physical layer PHY monitoring thread is started, specifically, the "phy" thread is created to run the function of phy_monitor_thread_entry(), which automatically detects the PHY address and initializes the PHY, and periodically checks the physical link state change through the timer or interrupt.

[0105] In addition, the link state of each virtual network node is independently controlled through the function of eth_change_linkstatus(), which ensures that the resource opening state of each virtual network node matches the initialization progress and guarantees the communication stability.

[0106] As can be seen from the above technical solutions of the embodiments of the present application, the mechanism of opening resources after the initialization of the virtual network node is completed solves the error problem caused by the participation of the uninitialized node in communication. The master device may asynchronously initiate communication, and if the slave device node is not initialized, it is easy to cause the master device address table to record errors. This mechanism limits the resource opening time, ensures that the virtual node participates in communication only after the initialization steps such as network parameter configuration and resource allocation are completed, avoids address resolution errors or data transmission failures caused by incomplete node functions, and improves the stability of system startup and operation.

[0107] Corresponding to the network communication system provided by the above several embodiments, the embodiment of the present application also provides a network communication method. Since the network communication method provided by the embodiment of the present application corresponds to the network communication system provided by the above several embodiments, the implementation mode of the aforementioned network communication system is also applicable to the network communication method provided by the present embodiment, which will not be described in detail in the present embodiment.

[0108] The embodiment of the application provides a network communication method based on the network communication system provided in any one of the above embodiments, the method has the functions of the network communication system in the above system embodiments, and the functions can be realized by hardware or corresponding software executed by hardware. The system comprises a master device, a data relay module and a slave device, the master device comprises at least one physical network node, the at least one physical network node is in communication connection with the data relay module respectively, the slave device comprises a virtual network node corresponding to the at least one physical network node, and the virtual network node is in communication connection with the data relay module through a physical network card of the slave device. The method can comprise:

[0109] The slave device acquires first service data to be sent; the first service data comprises a target logical address, and the target logical address indicates a target physical network node receiving the first service data in the at least one physical network node;

[0110] The slave device determines a source virtual network node corresponding to the target physical network node in the at least one virtual network node, processes the first service data based on the source virtual network node, and sends the processed first service data to the data relay module through the physical network card; the processed first service data comprises a source physical address indicating the source virtual network node;

[0111] The data relay module determines a target physical network node corresponding to the source virtual network node in the at least one physical network node based on the source physical address, and sends the first service data to the target physical network node.

[0112] In an exemplary embodiment, the method further comprises:

[0113] The master device sends second service data to the slave device through the data relay module; the second service data comprises a target physical address, and the target physical address indicates a target virtual network node processing the second service data in the at least one virtual network node;

[0114] The slave device receives the second service data through the physical network card, processes the second service data based on the target virtual network node indicated by the target physical address, determines a source physical network node corresponding to the target virtual network node in the at least one physical network node based on the target physical address, and dispatches the processed second service data to a logical module used for processing services of the target virtual network node.

[0115] In an exemplary embodiment, the slave device further comprises a first address mapping module, the first address mapping module is used for maintaining first address mapping information, and the first address mapping information is used for storing a mapping relationship between logical addresses and physical addresses of the at least one physical network node; the method further comprises:

[0116] The first address mapping module checks whether the target logical address exists in the first address mapping information;

[0117] If the target logical address does not exist in the first address mapping information, a network address request for the target logical address is sent to the master device so that the master device returns a network address reply, which indicates the target physical address corresponding to the target logical address.

[0118] Update the first address mapping information based on the target logical address and the corresponding target physical address.

[0119] In one exemplary implementation, the method further includes:

[0120] The first address mapping module parses the second service data to obtain the source logical address and source physical address in the second service data;

[0121] Determine whether the source logical address or the source physical address in the second business data exists in the first address mapping information;

[0122] If the source logical address in the second service data is not present in the first address mapping information, and the source physical address in the second service data is not present in the first address mapping information, the first address mapping information is updated based on the source logical address and source physical address in the second service data.

[0123] In one exemplary implementation, the method further includes:

[0124] When the device is processing address resolution data packets, it parses the address resolution data packets to obtain the verification logic address in the address resolution data packets;

[0125] When the verification logical address indicates any virtual network node, the verification logical address is used to verify whether the current virtual network node matches; the processing of the current virtual network node and the address resolution data packet belong to the same data transmission process.

[0126] In one exemplary implementation, the method further includes:

[0127] When the verification logical address indicates any physical network address, the slave device verifies whether the correspondence between the physical network node indicated by the verification logical address and the current virtual network node is valid based on the preset node mapping information; the preset node mapping information indicates the one-to-one correspondence between the physical network nodes of the master device and the virtual network nodes of the slave device.

[0128] In an example embodiment, the host device further comprises a second address mapping module configured to maintain second address mapping information, the second address mapping information configured to store mapping relationship between logical addresses and physical addresses of the at least one virtual network node.

[0129] In an example embodiment, the slave device comprises physical resources shared by the virtual network nodes, and logical resources corresponding to each virtual network node; and for each virtual network node, the method further comprises:

[0130] In the case that the physical resources are occupied, the virtual network node occupies the logical resources corresponding to the virtual network node until the physical resources are released, and the physical resources are preempted and the logical resources are released.

[0131] In an example embodiment, the method further comprises:

[0132] The slave device initializes the virtual network node;

[0133] For each virtual network node, the physical resources and the logical resources corresponding to the virtual network node are opened to the virtual network node in the case that the initialization of the virtual network node is completed.

[0134] It should be noted that the method provided by the above embodiments, in realizing its function, only divides the above-mentioned each functional module as an example, and in actual application, the above-mentioned functions can be completed by different functional modules according to the needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the method and system embodiments provided by the above embodiments belong to the same concept, and the specific implementation process is detailed in the system embodiment, which will not be repeated here.

[0135] The electronic device provided by the embodiment of the present application comprises a processor and a memory, the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program is loaded and executed by the processor to realize any one of the network communication methods provided by the above method embodiments.

[0136] The memory can be used to store software programs and modules, and the processor performs various function applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; and the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory can also include a memory controller to provide access of the processor to the memory.

[0137] The method embodiments provided by the embodiments of the application can be executed in a computer terminal, a server or a similar computing device, that is, the above-mentioned electronic device can include a computer terminal, a server or a similar computing device. The computer device running a network communication method is provided by the embodiments of the application, and the internal structure of the computer device can include but is not limited to a processor, a network interface and a memory. Among them, the processor, the network interface and the memory in the computer device can be connected through a bus or other means.

[0138] Among them, the processor (or CPU (Central Processing Unit, Central Processor)) is the computing core and control core of the computer device. The network interface can optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.). The memory (Memory) is a memory device in the computer device, used for storing programs and data. It can be understood that the memory here can be a high-speed RAM storage device, or a non-volatile storage device (non-volatile memory), such as at least one magnetic disk storage device; optionally, it can also be at least one storage device located away from the aforementioned processor. The memory provides a storage space that stores the operating system of the electronic device, which can include but is not limited to: a Windows system (an operating system), a Linux (an operating system), an Android (a mobile operating system) system, an IOS (a mobile operating system) system, etc., and the application does not limit this; and in the storage space, one or more instructions suitable for being loaded and executed by the processor are also stored, and these instructions can be one or more computer programs (including program codes). In the embodiments of the present application, the processor loads and executes one or more instructions stored in the memory to implement the network communication method provided by the above-mentioned method embodiments.

[0139] The embodiment of the present application further provides a computer readable storage medium which can be arranged in an electronic device to save at least one instruction or at least one program related to a network communication method, and the processor loads and executes the at least one instruction or the at least one program to implement any one of the network communication methods provided by the method embodiments.

[0140] Optionally, in the embodiment, the storage medium can include but is not limited to a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk and various storage program codes.

[0141] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. The above-mentioned embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be executed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.

[0142] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the method embodiments, since they are basically similar to the system embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the system embodiments.

[0143] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or by program to instruct relevant hardware to complete, and the program can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk.

[0144] The above is only the preferred embodiment of the present application, and does not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A network communication system, characterized by The system comprises a master device, a data relay module and a slave device, the master device comprises at least one physical network node, the at least one physical network node is respectively connected with the data relay module in communication, the slave device comprises a virtual network node corresponding to the at least one physical network node, and the virtual network node is connected with the data relay module in communication through a physical network card of the slave device; The slave device is used for obtaining first service data to be sent; the first service data comprises a target logical address, and the target logical address indicates a target physical network node receiving the first service data in the at least one physical network node; The slave device is further used for determining a source virtual network node corresponding to the target physical network node in the at least one virtual network node, processing the first service data based on the source virtual network node, and sending the processed first service data to the data relay module through the physical network card; the processed first service data comprises a source physical address indicating the source virtual network node; The data relay module is used for determining the target physical network node corresponding to the source virtual network node in the at least one physical network node based on the source physical address, and sending the first service data to the target physical network node.

2. The network communication system of claim 1, wherein, The master device is used for sending second service data to the slave device through the data relay module; the second service data comprises a target physical address, and the target physical address indicates a target virtual network node processing the second service data in the at least one virtual network node; The slave device is further used for receiving the second service data through the physical network card, processing the second service data based on the target virtual network node indicated by the target physical address, determining a source physical network node corresponding to the target virtual network node in the at least one physical network node based on the target physical address, and dispatching the processed second service data to a logical module used for processing service corresponding to the target virtual network node.

3. The network communication system of claim 2, wherein, The slave device further comprises a first address mapping module, the first address mapping module is used for maintaining first address mapping information, and the first address mapping information is used for storing a mapping relationship between logical addresses and physical addresses of the at least one physical network node; the first address mapping module is used for: checking whether the target logical address exists in the first address mapping information; in the case that the target logical address does not exist in the first address mapping information, sending a network address request for the target logical address to the master device, so that the master device returns a network address reply, and the network address reply indicates a target physical address corresponding to the target logical address; updating the first address mapping information based on the target logical address and the corresponding target physical address.

4. The network communication system of claim 3, wherein, The first address mapping module is further used for: parsing the second service data to obtain a source logical address and a source physical address in the second service data; determining whether the source logical address in the second service data or the source physical address in the second service data exists in the first address mapping information; in a case where the source logical address in the second service data does not exist in the first address mapping information and the source physical address in the second service data does not exist in the first address mapping information, updating the first address mapping information based on the source logical address and the source physical address in the second service data.

5. The network communication system of claim 3, wherein, The slave device is further configured to: in a case of processing an address resolution data packet, resolving the address resolution data packet to obtain a verification logical address in the address resolution data packet; in a case where the verification logical address indicates any of the virtual network nodes, verifying whether the verification logical address matches a current virtual network node; the current virtual network node and processing of the address resolution data packet belong to a same data transmission process.

6. The network communication system of claim 5, wherein, The slave device is further configured to, in a case where the verification logical address indicates any of the physical network nodes, based on preset node mapping information, verifying whether a correspondence between a physical network node indicated by the verification logical address and the current virtual network node is established; the preset node mapping information indicates a one-to-one correspondence between the physical network nodes of the master device and the virtual network nodes of the slave device.

7. The network communication system according to any one of claims 3 to 6, wherein, The master device further comprises a second address mapping module configured to maintain second address mapping information, the second address mapping information being configured to store a mapping relationship between logical addresses and physical addresses of at least one of the virtual network nodes.

8. The network communication system of claim 1 or 2, wherein, The slave device comprises physical resources shared by the virtual network nodes, and logical resources corresponding to each of the virtual network nodes; For each of the virtual network nodes, the virtual network node is configured to, in a case where the physical resources are occupied, occupy the logical resources corresponding to the virtual network node, and until the physical resources are released, preempt the physical resources and release the logical resources.

9. The network communication system of claim 8, wherein, The slave device is further configured to initialize the virtual network nodes; For each of the virtual network nodes, the physical resources and the logical resources corresponding to the virtual network nodes are configured to, in a case where initialization of the virtual network nodes is completed, open the virtual network nodes.

10. A network communication method based on the network communication system according to any one of claims 1 to 9, characterized by, The system comprises a master device, a data relay module and a slave device, the master device comprises at least one physical network node, the at least one physical network node is respectively connected with the data relay module in communication, the slave device comprises virtual network nodes corresponding to the at least one physical network node, the virtual network nodes are connected with the data relay module in communication through a physical network card of the slave device; the method comprises: The slave device obtains first service data to be sent; the first service data comprises a target logical address, the target logical address indicates a target physical network node receiving the first service data in the at least one physical network node; The slave device determines a source virtual network node corresponding to the target physical network node from the at least one virtual network node, processes the first service data based on the source virtual network node, and sends the processed first service data to the data relay module through the physical network card; the processed first service data comprises a source physical address indicating the source virtual network node; The data relay module determines the target physical network node corresponding to the source virtual network node from the at least one physical network node based on the source physical address, and sends the first service data to the target physical network node.

Citation Information

Patent Citations

  • IMS service processing method and device, system equipment and storage medium

    CN114448946A

  • Container cluster management system

    CN119211021A