Node communication method, electronic device, and storage medium
By building virtual ports for the target processor core in the storage system, the inefficiency and latency fluctuations caused by resource contention in inter-node communication are resolved, achieving efficient data transmission and processing.
Patent Information
- Application Number
- CN202511106575.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-07
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-08-07
AI Technical Summary
In existing storage systems, inter-node communication suffers from low efficiency and latency fluctuations due to resource contention and excessive processor core load.
By constructing virtual ports for the target processor core and utilizing the node communication resource set, virtual ports are established for the target node to achieve data transmission and polling processing, avoiding resource conflicts and competition, and improving communication efficiency.
This effectively avoids resource conflicts and competition, improves the efficiency of data communication between nodes, and reduces communication latency.
Smart Images

Figure CN120596412B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of node communication technology, and in particular to a node communication method, an electronic device, and a storage medium. Background Art
[0002] Currently, inter-node communication in storage systems typically involves directly connecting one port of a node to another port to form a link. Network data is transmitted through this link, and data transmission and reception in all queues are processed by the processor core that manages the port. This can lead to resource competition between queues, and the increased processing tasks on the ports reduce the processing power of the processor core and the communication efficiency of data transmission and reception. Summary of the Invention
[0003] The present application provides a node communication method, an electronic device, and a storage medium to at least solve the problem of reduced processing power of a processor core and reduced communication efficiency of data transmission and reception.
[0004] The present application provides a node communication method, comprising: obtaining a node communication resource set corresponding to a target processor core, the node communication resource set including a plurality of node communication resources;
[0005] Based on the node communication resource set, a virtual port is constructed for the target node, where the target node is the node corresponding to the target processor core;
[0006] Establishing a communication connection between a sending node and a receiving node through a virtual port, and updating a communication connection list of the sending node and the receiving node, wherein the sending node is a target node for sending data and the receiving node is a target node for receiving data;
[0007] The target data is sent to the virtual port of the receiving node through the virtual port of the sending node, so that the processor core corresponding to the virtual port of the receiving node polls the target data. The target data at least includes the sending resources stored in the node communication resource set corresponding to the virtual port.
[0008] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned node communication methods when executing the computer program.
[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned node communication methods are implemented.
[0010] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned node communication methods when executed by a processor.
[0011] Through this application, a node communication resource set corresponding to a target processor core is obtained, and the node communication resource set includes multiple node communication resources; based on the node communication resource set, a virtual port is constructed for the target node, and the target node is the node corresponding to the target processor core; a communication connection between a sending node and a receiving node is established through the virtual port, and the communication connection linked list of the sending node and the receiving node is updated, the sending node is the target node for sending data, and the receiving node is the target node for receiving data; the target data is sent to the virtual port of the receiving node through the virtual port of the sending node, so that the processor core corresponding to the virtual port of the receiving node performs polling processing on the target data, and the target data at least includes the sending resources stored in the node communication resource set corresponding to the virtual port. In this scheme, a virtual port is created for the target node, which is different from the physical port. The virtual port realizes data transmission and data polling processing, and compared with the processor core that is uniquely corresponding to the physical port, the virtual port does not limit the processor core, which can avoid resource conflict and competition, improve the efficiency of data communication between nodes, and reduce communication delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0013] Figure 1 A node communication method according to an embodiment of the present invention Figure 1 ;
[0014] Figure 2 A node communication method according to an embodiment of the present invention Figure 2 ;
[0015] Figure 3 A structural diagram of a node communication device provided in an embodiment of the present application;
[0016] Figure 4 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0018] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0019] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being more preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0020] With the development of technologies such as the Internet of Things (IoT), AI, ChatGPT, and humanoid robots, data is exponentially increasing, and data storage space is growing exponentially. This surge in data volume poses significant challenges to data transmission efficiency. To meet the rapidly growing storage space, node transmission efficiency is increasing. An increasing number of storage systems are utilizing various high-speed, low-latency transmission networks. High-speed networks are a common node data transmission link in storage systems. As the number of processor cores increases, effectively leveraging the characteristics of high-speed networks to achieve efficient communication between nodes poses higher requirements and challenges to storage systems.
[0021] In related technologies, communication between storage system nodes typically involves a direct connection between one node's port and another node's port. All network data is transmitted to the peer node via this single link. Data sent and received on all queues is processed by the processor core that manages the port. Multiple queues compete for resources, and static resource allocation fails to fully utilize the low-latency, high-bandwidth characteristics and multi-core capabilities of modern processors. Furthermore, competition between queues for resources and processor cores weakens concurrent processing capabilities. The interplay of processor core resource competition, physical port management, and communication processing also leads to fluctuating communication delays, and static resource allocation results in low resource utilization.
[0022] In order to solve all or part of the above technical problems and to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0023] like Figure 1 As shown, Figure 1A flowchart of a node communication method provided in an embodiment of the present application, the method may include the following steps:
[0024] 101. Obtain a node communication resource set corresponding to a target processor core.
[0025] It should be noted that the processor is the "brain" of the computer, responsible for executing instructions, processing data and controlling system operation. The processor core is an independent computing unit inside the processor. Each processor core can independently execute instruction streams (threads). Currently commonly used processors can include multiple cores, which are often called multi-core processors, which improve computing efficiency through parallel processing.
[0026] In an embodiment of the present application, for a target processor core, a node communication resource set corresponding to the target processor core can be obtained. The node communication resource set can include multiple node communication resources. The node communication resource set can also be called a node communication resource pool. The node communication resource pool is divided into pools according to the number of processor cores, and each processor core has a corresponding independent resource pool.
[0027] In some embodiments, the node communication resource set may include at least: a sending queue, a completion queue of the sending queue, a shared receiving queue, a completion queue of the sending queue, a work resource linked list, etc. Since the port can be used to send and receive data to realize node communication, the port can send data as well as receive data. Correspondingly, the data to be sent is stored to form a sending queue, and after the sending is completed, it is stored in the completion queue of the sending queue; similarly, the received data is stored to form a shared receiving queue, and after the received data is processed, it is stored in the completion queue of the shared receiving queue. Other data can also be stored in the node communication resource set, which is not specifically limited in the embodiments of the present application.
[0028] In some embodiments, the node communication resource set may include a lot of data. The following only describes the method of obtaining some of the data. Among them, obtaining the node communication resource set corresponding to the target processor core may specifically include: building a sending queue for the port corresponding to the target processor core, and a first completion queue of the sending queue; building a shared receiving queue for the port corresponding to the target processor core, and a second completion queue of the shared receiving queue; obtaining the working resources of the port corresponding to the target processor core, and the status of the working resources, and building a working resource linked list; building a node communication resource set according to the sending queue, the shared receiving queue, the first completion queue, the second completion queue and the working resource linked list.
[0029] It should be noted that when initializing the channel, a sending queue and the first completion queue of the sending queue can be constructed for the port. The sending queue can be one sending queue for each port, and there is a one-to-one correspondence between the sending queue and the first completion queue of the sending queue. The sending queue can be used to store data that needs to be sent, and the first completion queue of the sending queue can store data that has been sent.
[0030] It should be noted that a shared receive queue and a second completion queue of the shared receive queue can also be constructed for the port. The shared receive queue can be shared by multiple ports. There is a one-to-one correspondence between the shared receive queue and the second completion queue of the shared receive queue. The shared receive queue can be used to store received data, which can specifically include data received by multiple ports. The second completion queue of the shared receive queue can be used to store data that has completed processing of the received data.
[0031] It should be noted that the working resources of the port corresponding to the target processor core and the status of the working resources can also be obtained. When the port sends and receives data, it needs to call the working resources to implement it. Therefore, working resources can also be stored in the node communication resource set. The working resources can represent the various hardware, software capabilities, data and other contents that the port needs to use during the data transmission process, and the status of various working resources may be different. The status may include idle state, active state, etc. Therefore, a working resource linked list can be constructed based on the working resources and the status of the working resources. The working resource linked list can display all stored working resources and their respective status.
[0032] In an embodiment of the present application, an independent node communication resource set is constructed for each processor core, and data such as the receiving and transmitting queues and working resources corresponding to the processor core are stored. This can avoid resource competition between processor cores. By sharing the receiving queue, it can also avoid the situation where some queues are too idle or busy. At the same time, it can also ensure that there is no resource competition between the ports corresponding to the processor cores, thereby improving concurrent processing capabilities.
[0033] 102. Construct a virtual port for the target node according to the node communication resource set.
[0034] In an embodiment of the present application, after obtaining the node communication resource set, a virtual port can be constructed for the target node according to the relevant data in the node communication resource set. The target node can be the node corresponding to the target processor core.
[0035] A node is an independent computing unit in a computer network or distributed system. It can be a server, a personal computer, or an embedded device. In a multiprocessor system, a node may also refer to a physical or logical unit containing multiple processors. In distributed computing, nodes collaborate to complete large-scale tasks; in a multiprocessor system, a node may represent an independent computing board or socket. A node may contain one or more processors (e.g., a multi-socket server).
[0036] A port is an interface between a computer and external devices or networks. It can be categorized as either hardware or software ports. Hardware ports include USB, HDMI, and Ethernet ports, and are used to connect physical devices. Software ports are logical identifiers used in the TCP / IP protocol to distinguish different network services (for example, HTTP uses port 80 by default). Ports can facilitate data input / output (I / O) or network communication. Ports are the external interface of a node, and the processor / core interacts with the outside world through ports.
[0037] In the embodiment of the present application, a virtual port may be constructed for the target node. The target node may include multiple physical ports, but only one virtual port may be constructed.
[0038] In some embodiments, a virtual port is constructed for a target node based on a node communication resource set, which may specifically include: obtaining communication port information based on the node communication resource set; parsing a device configuration file pre-stored in the node communication resource set to determine the processor core data used for node communication; and constructing a virtual port for the target node based on the communication port information, processor core data, a preset communication port type, and a preset communication port function.
[0039] It should be noted that a node communication port information structure may be constructed, and the communication port information may at least include: a type index, a usage flag, and a processor core index array.
[0040] The type index is a unique index number used to identify communication ports of the same type. In a complex communication system, there may be many different types of communication ports, such as Ethernet ports, serial ports, and USB ports. Each port type may have multiple instances. The type index is used to distinguish between these ports of the same type. The type index provides a convenient way to identify communication ports for system management and operation. Using the type index, you can quickly locate a specific communication port for configuration, monitoring, data transmission, and other operations.
[0041] The usage flag is a binary bit or a set of binary bits that indicates the usage status of a communication port. It typically has two common states: in use (e.g., the flag is 1) and unused (e.g., the flag is 0), but additional states, such as initializing and faulty, can be defined based on actual needs. The usage flag is primarily used for communication port resource management and scheduling. By checking the usage flag, the system can determine whether each communication port is currently occupied, thereby avoiding conflicts caused by multiple processes or tasks accessing the same port simultaneously and properly allocating idle ports to new tasks.
[0042] The processor core index array is an array containing multiple processor core indices, representing the processor core numbers assigned to the node's communication ports. In modern multi-core processor systems, to improve communication efficiency and system performance, different communication ports are typically assigned to different processor cores for management and processing. The processor core index array is used to record this assignment and represents the processor core number assigned to the node's communication port. By binding a communication port to a specific processor core, data transmission latency between different cores can be reduced, data processing parallelism can be increased, and thus the communication performance and response speed of the entire system can be improved.
[0043] It should be noted that the efficient communication module initialization logic executes, loads the processor cores and number assigned to node communication from the device configuration file, and saves them to the processor core mapping array. The array value is the number of the assigned processor core, and the communication port information can be updated at the same time. The device configuration file can be automatically generated and stored during operation, and the data in the device configuration file will be updated as the system runs.
[0044] It should be noted that when creating a virtual port, it is also necessary to set the virtual communication port type and the virtual communication port polling processing type for the virtual port, and register the port management function and the communication port polling processing function on the processor core that manages the physical port. The port management function is used to set and adjust the virtual communication port type of the virtual port, and the communication port polling processing function is used to set and adjust the virtual communication port polling processing type of the virtual port, and register the communication port polling processing function on the processor core of the assigned node communication.
[0045] In an embodiment of the present application, when creating a virtual port for a target node, data of the virtual port can be configured using data from multiple angles. This ensures that the virtual port replaces the physical port to send and receive data between nodes, separates the control plane and the data plane, and avoids fluctuations in communication link delay caused by port management events.
[0046] 103. Establish a communication connection between the sending node and the receiving node through the virtual port, and update the communication connection linked list of the sending node and the receiving node.
[0047] In an embodiment of the present application, after a virtual port is constructed for the target node, the communication connection between nodes can be realized through the virtual port. Since there are two roles in the communication connection between nodes, namely: initiator and target, the initiator is the node that starts the data transmission, that is, the sending node, and the target is the node to which the data is transmitted, that is, the receiving node. It can be understood that the sending node is the target node for sending data, and the receiving node is the target node for receiving data. Both the sending node and the receiving node have virtual ports created, so the connection between the sending node and the receiving node is realized through the virtual port. After establishing the communication connection between the sending node and the receiving node through the virtual port, the communication connection can also be added to the communication connection list of the sending node and the receiving node. The communication connection list can be used to display all communication connection conditions of the current node.
[0048] In some embodiments, establishing a communication connection between a sending node and a receiving node through a virtual port may specifically include: obtaining communication connection entries of the sending node and the receiving node respectively; when the communication connection entries are in a transmission-enabled state, determining the polling type of the virtual ports of the sending node and the receiving node; when the polling type is a virtual communication port type, establishing a communication connection between the sending node and the receiving node through the virtual port.
[0049] It should be noted that in the resource preparation stage, the ports connected to the corresponding communication connection entries are obtained on the sending node and the receiving node respectively, and the status of the communication connection entries is detected. If the status of the communication connection entry is the queue-to-transmission enabled state, it means that the current communication connection between the sending node and the receiving node can be used to transmit data. Then, the virtual port corresponding to the connection is obtained on the sending node and the receiving node, and the virtual communication port polling processing type of the virtual port is detected. Since the virtual communication port polling processing type of the virtual port may also be used for other purposes such as memory management or data management, and the communication connection requires a virtual port for communication to be connected, if the virtual communication port polling processing type of the virtual port is a virtual communication port type, it means that the virtual port is used for node communication, and then a communication connection between the sending node and the receiving node can be established through the virtual port.
[0050] In an embodiment of the present application, when creating a communication connection between nodes through a virtual port, it is possible to first determine whether the node is currently in a state where data transmission can be performed, and then determine a virtual port of the virtual communication port type to create a communication connection. Since different virtual ports may be used for different needs, this can ensure that the communication connection between the nodes can be successfully established and normal communication can be performed.
[0051] 104. Send target data to the virtual port of the receiving node through the virtual port of the sending node, so that the processor core corresponding to the virtual port of the receiving node performs polling processing on the target data.
[0052] In an embodiment of the present application, after the communication connection between the sending node and the receiving node is established, data transmission can be carried out. The target data is sent to the virtual port of the receiving node through the virtual port of the sending node, and the virtual port of the receiving node receives the target data. The target data can then be polled and processed by the processor core corresponding to the virtual port of the receiving node.
[0053] It should be noted that the target data at least includes the sending resources stored in the node communication resource set corresponding to the virtual port.
[0054] In some embodiments, sending target data to the virtual port of the receiving node through the virtual port of the sending node can specifically include: obtaining sending resources from the node communication resource set and storing the sending resources in a sending resource linked list; traversing the sending resource linked list to obtain target data, and adding the target data to a sending queue; sending the target data in the sending queue through the virtual port of the sending node; after detecting that the sending is completed, adding the target data to the completion queue of the sending queue.
[0055] It should be noted that when the virtual port of the sending node sends the target data, it can obtain the sending resources corresponding to the requested number from the sending resource linked list stored in the node communication resource set corresponding to the processor core, and add it to the sending resource linked list corresponding to the working resource. At the same time, it traverses the sending resource linked list, updates the operation code, data memory quantity, data address, etc. in the sending resource object obtained therefrom to obtain the target data, and then adds the target data to the sending queue corresponding to the virtual port of the sending node. The communication module obtains the target data from the sending queue and transmits it to the virtual port of the receiving node. The receiving process is similar to the sending process. After the virtual port of the sending node completes sending the target data, it can add the target data to the completion queue of the sending queue, indicating that the sending process of the data has ended.
[0056] In an embodiment of the present application, when the virtual port of the sending node sends data, it can be stored in the sending queue first, and after the sending is completed, the data can be added to the completion queue of the sending queue. In this way, the sending process and sending progress of the virtual port of the sending node can be displayed intuitively and clearly.
[0057] In an embodiment of the present application, a node communication resource set corresponding to a target processor core is obtained, and the node communication resource set includes multiple node communication resources; a virtual port is constructed for a target node based on the node communication resource set, and the target node is a node corresponding to any node communication resource; a communication connection between a sending node and a receiving node is established through the virtual port, and a communication connection list of the sending node and the receiving node is updated, wherein the sending node is a target node for sending data, and the receiving node is a target node for receiving data; the target data is sent to the virtual port of the receiving node through the virtual port of the sending node, so that the processor core corresponding to the virtual port of the receiving node performs polling processing on the target data, and the target data at least includes the sending resources stored in the node communication resource set corresponding to the virtual port. In this scheme, a virtual port is created for the target node, which is different from the physical port. The virtual port realizes data transmission and data polling processing, and compared with the processor core that is uniquely corresponding to the physical port, the virtual port does not limit the processor core, which can avoid resource conflict and competition, improve the efficiency of data communication between nodes, and reduce communication delay.
[0058] like Figure 2 As shown, Figure 2 Another flowchart of a node communication method provided in an embodiment of the present application, the method may include the following steps:
[0059] 201. Obtain a node communication resource set corresponding to a target processor core.
[0060] 202. Construct a virtual port for the target node according to the node communication resource set.
[0061] 203. Establish a communication connection between the sending node and the receiving node through the virtual port, and update the communication connection linked list of the sending node and the receiving node.
[0062] In the embodiment of the present application, for the description of steps 201 to 203 , please refer to the detailed description of steps 101 to 103 in the above embodiment, which will not be repeated in the embodiment of the present application.
[0063] In some embodiments, when establishing a communication connection between a sending node and a receiving node through a virtual port, the processor core number corresponding to the communication connection and the processor core index may also be obtained. A determination is then made as to whether the number of working resources corresponding to the processor core index corresponding to the virtual port is greater than 0. If so, idle working resources are obtained from an idle working array of node communications corresponding to the virtual port and the processor core index. Working resources include IO status, callback function, processor core index, port type, etc. Working resource entries are initialized, and idle working resources are deleted from a linked list of working resources in the node communication resource set.
[0064] In some embodiments, the obtained working resources in idle state can also be added to the corresponding shared receive queue of the port and processor core, and the depth of the current shared receive queue can be increased. The depth of the shared receive queue can represent the amount of data stored in the shared receive queue. If the current queue depth is 0, it means that there is no data in it, then it can be said that the addition failed, and a failure prompt message is returned; if the current queue depth is less than the maximum queue depth of the communication connection, the resource suspension number is updated, and the resource suspension number can be the maximum queue depth minus the current queue depth, that is, how much data the queue can continue to store, and then the resource count of the communication connection is updated to increase the current receive queue depth.
[0065] In some embodiments, if the number of resources suspended for a communication connection is greater than 0, the communication connection is added to the corresponding communication connection suspension linked list, and the connection state is updated to the connected state. Link connection command reading and writing are set, a connection command object is obtained through the communication connection, and it is determined whether the polling type of the connection is a node communication type. If so, an idle working resource is obtained from the node communication resource set corresponding to the corresponding port type and processor core index, and the connection type and connection index of the working resource are set. The private data field of the command object is then updated to the working resource. If it is not a node communication type, the logic corresponding to other types is executed.
[0066] In some embodiments, the communication IO start time can also be set, and the data type, data length and data memory address can be added to the communication connection command object. At the same time, the IO status of the working resource can be updated to the sending status, and the working resource can be added to the IO linked list corresponding to the connection.
[0067] 204. Send target data to the virtual port of the receiving node through the virtual port of the sending node, so that the processor core corresponding to the virtual port of the receiving node performs polling processing on the target data.
[0068] In the embodiment of the present application, for the description of step 204, please refer to the detailed description of step 104 in the above embodiment, and the embodiment of the present application will not be repeated.
[0069] 205. Detect the communication port type and polling processing type of the virtual port.
[0070] In an embodiment of the present application, after the virtual port of the receiving node receives the target data sent by the virtual port of the sending node, it is necessary to perform polling processing on the target data. During the polling processing, it is first necessary to traverse the virtual ports of the receiving node and determine the communication port type and polling processing type of the virtual port. The communication port type and polling processing type are configured when the virtual port is created.
[0071] 206. When it is detected that the communication port type is a node communication port and the polling process type is a node communication polling process, receive target data through the virtual port of the receiving node.
[0072] In an embodiment of the present application, when it is determined that the communication port type is a node communication port and the polling processing type is node communication polling processing, it can be determined that the virtual port is a virtual port for node communication, and therefore the target data can be received through the virtual port of the receiving node.
[0073] 207. Store the target data in a shared receiving queue, and perform polling processing on the target data through the processor core corresponding to the virtual port of the receiving node.
[0074] In an embodiment of the present application, after the virtual port of the receiving node receives the target data, the target data can be first stored in the shared receiving queue corresponding to the virtual port to indicate that the target data has been received, and then polling processing can be performed. The polling processing of the target data is actually completed by the processor core. Here, the virtual port is not actually limited to a unique corresponding processor core, so the target data can be polled according to any processor core used for data processing.
[0075] 208. After detecting that the polling process is completed, add the target data to the completion queue of the shared receive queue.
[0076] In an embodiment of the present application, after the polling process is completed, it indicates that the processing of the target data has ended, so the target data can be added to the completion queue of the shared receiving queue, indicating that the target data has been processed.
[0077] In an embodiment of the present application, according to the communication port type and the polling processing type, a virtual port used for node communication in the receiving node is selected to receive the target data. Since different virtual ports may be used for different needs, this can ensure that the data transmission between the nodes can be received and processed smoothly; the target data is processed by the processor core, and the target data is synchronized in the shared receive queue and the completion queue of the shared receive queue respectively. In this way, information such as the processing status and processing progress of the target data by the virtual port of the receiving node can be clearly and intuitively displayed.
[0078] In some embodiments, during the polling processing, in addition to detecting the communication port type and the polling processing type, it is also necessary to detect whether the virtual port of the receiving node has a fault mark. The fault mark can be used to mark that the virtual port of the receiving node has a fault, or it can be used to mark that the shared receiving queue of the virtual port of the receiving node has a fault. If the fault mark is detected on the virtual port of the receiving node, it means that the virtual port and / or shared receiving queue of the current receiving node is faulty and cannot receive and process data, so the data transmission can be suspended; if the fault mark is not detected on the virtual port of the receiving node, it means that the virtual port of the current receiving node is in normal state, so the target data can be received through the virtual port of the receiving node.
[0079] In some embodiments, the communication port type, polling processing type, and fault flag of the virtual port may be detected in sequence or simultaneously.
[0080] Among them, when detecting in sequence, the virtual port can be first traversed to determine whether the port type is a node communication port. If it is a node communication port, node communication polling processing is performed. Then, it can be determined whether the virtual port has a fault mark, which can include a virtual port fault mark or a shared receive queue fault mark, etc. If so, it means that the current virtual port has a fault, and then the polling processing flow of the virtual port is exited. If there is no error mark, other management class asynchronous events are processed on the processor core where the virtual port is located. Then, the polling processing type is determined. If it is a node communication polling processing type, target data is received, and a connection list of node communication is obtained from the processor core corresponding to the processor core index number. The connection list is traversed to obtain a connection entry and determine whether the processor core bound to the connection is the current processor core. If so, the receive queue is polled, and a completion queue item is obtained from the completion queue corresponding to the send queue, and the completion operation corresponding to the send queue is executed. It is also possible to determine the completion queue of the shared receive queue of the receiving node corresponding to the processor core according to the virtual communication polling processing type, obtain the completion queue item and execute the receive queue completion operation.
[0081] 209. Periodically detect the actual queue depth of the shared receive queue.
[0082] In an embodiment of the present application, during the data polling process, the actual queue depth, that is, the amount of data currently stored in the shared receive queue, can be detected according to a fixed period.
[0083] 210. If it is detected that the actual queue depth is less than a first preset depth threshold, the shared receiving queue is scaled down.
[0084] 211. If it is detected that the actual queue depth is greater than a second preset depth threshold, the shared receiving queue is expanded.
[0085] In an embodiment of the present application, the first preset depth threshold and the second preset depth threshold are both thresholds set in advance, and the second preset depth threshold is greater than the first preset depth threshold. If the actual queue depth is less than the first preset depth threshold, it means that the current shared receive queue is very idle and does not take up too much memory space. Therefore, the shared receive queue can be scaled down, that is, the maximum queue depth of the shared receive queue can be reduced; if the actual queue depth is greater than the second preset depth threshold, it means that the current shared receive queue is relatively crowded and a lot of data has been stored. Therefore, the shared receive queue can be expanded, that is, the maximum queue depth of the shared receive queue can be increased.
[0086] In some embodiments, if the actual queue depth is less than a first preset depth threshold, the current queue depth is automatically reduced by 20%; if the actual queue depth is less than the first preset depth threshold within 5 minutes and the idle rate is greater than 60%, the queue depth is automatically reduced by 30%; if the actual queue depth is greater than a second preset depth threshold, the current queue depth is automatically expanded by 20%; if there are three consecutive full loads, that is, the actual queue depth reaches the maximum queue depth, the current queue depth is automatically expanded by 50%.
[0087] In the embodiment of the present application, by dynamically expanding and shrinking the queue depth, it is possible to avoid situations where some queues are too idle or too busy, to avoid a large number of queue resources being idle, and to avoid situations where the processing capacity waiting time is too long and the processing efficiency is reduced due to insufficient queue resources under high load.
[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0089] like Figure 3As shown, an embodiment of the present application further provides a node communication device, which may include:
[0090] An acquisition module 301 is configured to acquire a node communication resource set corresponding to a target processor core, wherein the node communication resource set includes a plurality of node communication resources;
[0091] A construction module 302 is configured to construct a virtual port for a target node based on a node communication resource set, where the target node is a node corresponding to a target processor core;
[0092] Processing module 303, configured to establish a communication connection between a sending node and a receiving node through a virtual port, and update a communication connection linked list of the sending node and the receiving node, wherein the sending node is a target node for sending data and the receiving node is a target node for receiving data;
[0093] The processing module 303 is also used to send target data to the virtual port of the receiving node through the virtual port of the sending node, so that the processor core corresponding to the virtual port of the receiving node polls the target data, and the target data at least includes the sending resources stored in the node communication resource set corresponding to the virtual port.
[0094] In some embodiments, the construction module 302 is specifically configured to construct a send queue and a first completion queue of the send queue for a port corresponding to a target processor core;
[0095] A construction module 302 is specifically configured to construct a shared receive queue and a second completion queue of the shared receive queue for the port corresponding to the target processor core;
[0096] The acquisition module 301 is specifically used to obtain the working resources of the port corresponding to the target processor core and the status of the working resources, and to build a working resource list;
[0097] The construction module 302 is specifically configured to construct a node communication resource set according to the sending queue, the shared receiving queue, the first completion queue, the second completion queue, and the work resource linked list.
[0098] In some embodiments, the acquisition module 301 is specifically configured to acquire communication port information according to a node communication resource set, where the communication port information includes: a type index, a usage flag, and a processor core index array;
[0099] The processing module 303 is specifically configured to parse a device configuration file pre-stored in the node communication resource set to determine processor core data for node communication;
[0100] The construction module 302 is specifically configured to construct a virtual port for a target node according to the communication port information, the processor core data, the preset communication port type, and the preset communication port function.
[0101] In some embodiments, the acquisition module 301 is specifically configured to respectively acquire communication connection entries of a sending node and a receiving node;
[0102] The processing module 303 is specifically configured to determine the polling type of the virtual ports of the sending node and the receiving node when the communication connection entry is in the transmission-enabled state;
[0103] The construction module 302 is specifically configured to establish a communication connection between the sending node and the receiving node through the virtual port when the polling type is a virtual communication port type.
[0104] In some embodiments, the acquisition module 301 is specifically configured to acquire a sending resource from a node communication resource set and store the sending resource in a sending resource linked list;
[0105] The processing module 303 is specifically used to traverse the sending resource list, obtain the target data, and add the target data to the sending queue;
[0106] The processing module 303 is specifically configured to send the target data in the sending queue through the virtual port of the sending node;
[0107] The processing module 303 is specifically configured to add the target data to a completion queue of the sending queue after detecting that the sending is completed.
[0108] In some embodiments, the processing module 303 is further configured to detect the communication port type and the polling processing type of the virtual port;
[0109] The processing module 303 is further configured to receive target data through the virtual port of the receiving node when detecting that the communication port type is a node communication port and the polling processing type is a node communication polling processing;
[0110] The processing module 303 is further configured to store the target data in a shared receiving queue and perform polling processing on the target data through the processor core corresponding to the virtual port of the receiving node;
[0111] The processing module 303 is further configured to add the target data to a completion queue of the shared receiving queue after detecting that the polling process is completed.
[0112] In some embodiments, the processing module 303 is specifically configured to, when detecting that the communication port type is a node communication port and the polling processing type is a node communication polling processing, detect whether a fault flag exists on the virtual port of the receiving node, where the fault flag is used to indicate that a fault exists on the virtual port and / or the shared receiving queue;
[0113] The processing module 303 is specifically configured to receive target data through the virtual port of the receiving node when no fault mark is detected on the virtual port of the receiving node.
[0114] In some embodiments, the processing module 303 is further configured to periodically detect an actual queue depth of the shared receive queue;
[0115] The processing module 303 is further configured to shrink the shared receiving queue if it is detected that the actual queue depth is less than a first preset depth threshold;
[0116] The processing module 303 is further configured to expand the shared receiving queue if it is detected that the actual queue depth is greater than a second preset depth threshold.
[0117] In the embodiments of the present application, the description of the features in the embodiments corresponding to the node communication device can refer to the relevant description of the embodiments corresponding to the node communication method, and will not be repeated here.
[0118] like Figure 4 As shown, an embodiment of the present application further provides an electronic device, including a memory 401 and a processor 402, wherein the memory 401 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any of the above-mentioned node communication method embodiments.
[0119] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned node communication method embodiments when running.
[0120] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0121] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned node communication method embodiments are implemented.
[0122] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned node communication method embodiments are implemented.
[0123] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0124] The above is a detailed introduction to the process monitoring of a storage system provided by this application. Specific examples are used herein to illustrate the principles and implementation methods of this application. The description of the above embodiments is only intended to help understand the method and core ideas of this application. It should be pointed out that, for those skilled in the art, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
Claims
1. A node communication method, characterized in that: The method comprises: Constructing a send queue and a first completion queue of the send queue for the port corresponding to the target processor core; Constructing a shared receive queue for the port corresponding to the target processor core, and a second completion queue of the shared receive queue; Obtaining the working resources of the port corresponding to the target processor core and the status of the working resources, and constructing a working resource linked list; Constructing a node communication resource set according to the sending queue, the shared receiving queue, the first completion queue, the second completion queue and the work resource linked list; Acquire communication port information according to the node communication resource set, the communication port information including: type index, usage flag, and processor core index array; Parsing a pre-stored device configuration file in the node communication resource set to determine processor core data for node communication; Constructing a virtual port for a target node according to the communication port information, the processor core data, a preset communication port type, and a preset communication port function, the target node being a node corresponding to the target processor core; Establishing a communication connection between a sending node and a receiving node through the virtual port, and updating a communication connection linked list of the sending node and the receiving node, wherein the sending node is a target node for sending data and the receiving node is a target node for receiving data; Target data is sent to the virtual port of the receiving node through the virtual port of the sending node, so that the processor core corresponding to the virtual port of the receiving node polls the target data, and the target data at least includes the sending resources stored in the node communication resource set corresponding to the virtual port.
2. The method according to claim 1, characterized in that The establishing of a communication connection between the sending node and the receiving node through the virtual port includes: respectively obtaining communication connection entries of the sending node and the receiving node; When the communication connection entry is in a transmission-enabled state, determining a polling type of the virtual ports of the sending node and the receiving node; When the polling type is a virtual communication port type, a communication connection between the sending node and the receiving node is established through the virtual port.
3. The method according to claim 1, characterized in that The sending of target data to the virtual port of the receiving node through the virtual port of the sending node includes: Acquire the sending resource from the node communication resource set, and store the sending resource in a sending resource linked list; Traversing the sending resource linked list, obtaining the target data, and adding the target data to the sending queue; Sending the target data in the sending queue through the virtual port of the sending node; After the sending completion is detected, the target data is added to the completion queue of the sending queue.
4. The method according to claim 1, wherein After sending the target data to the virtual port of the receiving node through the virtual port of the sending node so that the processor core corresponding to the virtual port of the receiving node performs polling processing on the target data, the method further includes: detecting a communication port type and a polling processing type of the virtual port; When it is detected that the communication port type is a node communication port and the polling process type is a node communication polling process, receiving the target data through the virtual port of the receiving node; storing the target data in a shared receiving queue, and performing polling processing on the target data through a processor core corresponding to the virtual port of the receiving node; After detecting that the polling process is completed, the target data is added to the completion queue of the shared receive queue.
5. The method according to claim 4, characterized in that The receiving the target data through the virtual port of the receiving node when detecting that the communication port type is a node communication port and the polling processing type is a node communication polling processing includes: When it is detected that the communication port type is a node communication port and the polling process type is a node communication polling process, detecting whether a fault mark exists on the virtual port of the receiving node, the fault mark being used to indicate that a fault exists on the virtual port and / or the shared receiving queue; When the fault flag is not detected on the virtual port of the receiving node, the target data is received through the virtual port of the receiving node.
6. The method according to claim 4, characterized in that The method further comprises: Periodically detecting an actual queue depth of the shared receive queue; If it is detected that the actual queue depth is less than a first preset depth threshold, shrinking the shared receive queue; If it is detected that the actual queue depth is greater than a second preset depth threshold, the shared receiving queue is expanded.
7. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the node communication method according to any one of claims 1 to 6 when executing the computer program.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the node communication method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Computer communication and connection method and system
CN102567123A
Virtual networking system and method in processing system
CN1520550A