Node bandwidth evaluation method, device, system and computer readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHUHAI CHENGMI TECH CO LTD
- Filing Date
- 2026-05-07
- Publication Date
- 2026-07-31
AI Technical Summary
[0003]然而,这种主动探测方式存在以下技术缺陷:首先,频繁的探测行为需要不断建立和拆除新的 TCP 连接,会引入额外的网络开销,加重系统负担;其次,在大吞吐量场景下,会存在测量失真,无法反映真实的网络状况;而且,不受控的探测流量会与正常的业务流量竞争网络资源,从而对业务性能造成干扰
调度节点将用于带宽探测的探测指令封装在心跳响应消息中,工作节点将探测载荷封装到第二心跳请求消息中,使调度节点和工作节点复用现有的心跳长连接通道进行带宽探测,无需建立新的TCP连接,有利于降低资源消耗;而且工作节点从预配置的静态缓冲区中截取数据片段并封装为探测载荷,并将探测载荷放入第二心跳请求消息中,避免频繁申请大块内存,有利于降低负载以及降低对正常业务的干扰。
Smart Images

Figure CN122496443A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a node bandwidth evaluation method, apparatus, system, and computer-readable storage medium. Background Technology
[0002] In distributed task scheduling systems (such as Hadoop Yarn, Kubernetes, Mesos, etc.), accurately obtaining the actual bandwidth between nodes is crucial for achieving efficient resource scheduling and task allocation. Existing technologies typically employ active probing to measure bandwidth, which involves establishing independent TCP connections and sending probe packets (e.g., using tools like iperf) for estimation.
[0003] However, this proactive probing method has the following technical drawbacks: First, frequent probing requires constantly establishing and tearing down new TCP connections, introducing additional network overhead and increasing the system load; second, in high-throughput scenarios, measurement distortion may occur, failing to reflect the true network condition; moreover, uncontrolled probing traffic can compete for network resources with normal service traffic, thus interfering with service performance. These problems also exist in the construction and networking of next-generation mobile communication core networks and access networks for mobile telecommunications services. Summary of the Invention
[0004] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes a node bandwidth assessment method, apparatus, system, and computer-readable storage medium, which can utilize existing heartbeat channels for hitch detection, reducing network overhead and minimizing interference with normal services.
[0005] In a first aspect, embodiments of the present invention provide a node bandwidth evaluation method, comprising: In response to the worker node's first heartbeat request message, the scheduling node returns a heartbeat response message containing a probe instruction, which includes a probe switch identifier and a target fill size; In response to the heartbeat response message, when the probe switch identifier is indicated as on, the working node extracts a data segment from a pre-configured static buffer and encapsulates it into a probe payload, the size of which is related to the target fill size; The working node places the probe payload into a second heartbeat request message and sends it to the scheduling node; In response to the second heartbeat request message, the scheduling node determines the instantaneous bandwidth based on the time taken and the amount of data received from the probe payload, and updates the bandwidth score of the working node based on the instantaneous bandwidth and the historical bandwidth score.
[0006] According to some embodiments of the present invention, the data stored in the static buffer is a high-entropy pseudo-random byte sequence, and the step of extracting data fragments from the pre-configured static buffer and encapsulating them into a probe payload includes: High-entropy pseudo-random byte sequence fragments are extracted from a pre-configured static buffer using a zero-copy method and encapsulated as a probe payload.
[0007] According to some embodiments of the present invention, updating the bandwidth score of the working node based on the instantaneous bandwidth and the historical bandwidth score includes: The bandwidth score of the working node is updated by performing an exponential moving average process based on the instantaneous bandwidth and historical bandwidth score.
[0008] According to some embodiments of the present invention, the node bandwidth evaluation method further includes: The scheduling node increments the target filling size within consecutive heartbeat cycles; If the heartbeat round-trip delay exceeds a preset threshold at any stage, the issuance of the detection command will be terminated.
[0009] According to some embodiments of the present invention, the node bandwidth evaluation method further includes: The scheduling node monitors local load characteristics and stops generating the detection command if any load characteristic exceeds a preset threshold. Alternatively, the scheduling node may stop generating the detection command if the overall heartbeat timeout rate of the cluster exceeds a preset threshold.
[0010] Secondly, embodiments of the present invention provide a node bandwidth evaluation method, applied to a scheduling node, comprising: In response to the worker node's first heartbeat request message, return a heartbeat response message containing probe instructions, and wait for the worker node to send a heartbeat request message again; In response to a second heartbeat request message from the working node, the instantaneous bandwidth is determined based on the time taken and the amount of data received from the probe payload contained in the second heartbeat request message, and the bandwidth score of the working node is updated based on the instantaneous bandwidth and the historical bandwidth score.
[0011] Thirdly, embodiments of the present invention provide a node bandwidth evaluation method, applied to a working node, including: In response to the scheduling node returning a heartbeat response message containing the probe command, the probe command is parsed to obtain the probe switch identifier and the target fill size; When the detection switch indicator is set to ON, data segments are extracted from a pre-configured static buffer and encapsulated into a detection payload, the size of which is related to the target fill size; The probe payload is placed into a second heartbeat request message and sent to the scheduling node so that the scheduling node can determine the instantaneous bandwidth and update the bandwidth score.
[0012] Fourthly, embodiments of the present invention provide a node bandwidth evaluation device, including a scheduling node and a working node. The scheduling node is used to respond to the first heartbeat request message from the worker node by returning a heartbeat response message containing a probe instruction, the probe instruction including a probe switch identifier and a target fill size; The working node is used to respond to the heartbeat response message, and when the probe switch identifier is indicated as on, to extract data segments from a pre-configured static buffer and encapsulate them into a probe payload, wherein the size of the data segment is associated with the target fill size; The working node is also used to put the probe payload into a second heartbeat request message and send it to the scheduling node; The scheduling node is also configured to respond to the second heartbeat request message, determine the instantaneous bandwidth based on the time taken and the amount of data received from the probe payload, and update the bandwidth score of the working node based on the instantaneous bandwidth and the historical bandwidth score.
[0013] Fifthly, embodiments of the present invention provide a node bandwidth evaluation system, including a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to implement the above-described node bandwidth evaluation method.
[0014] Sixthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when run, implements the above-described node bandwidth evaluation method.
[0015] The embodiments of the present invention have at least the following beneficial effects: The scheduling node encapsulates the probe instructions used for bandwidth probing in the heartbeat response message, while the worker node encapsulates the probe payload in the second heartbeat request message. This allows the scheduling node and worker nodes to reuse the existing long-connection heartbeat channel for bandwidth probing without establishing a new TCP connection, which helps reduce resource consumption. Furthermore, the worker node extracts data fragments from the pre-configured static buffer and encapsulates them into probe payloads, then places the probe payloads into the second heartbeat request message. This avoids frequently requesting large blocks of memory, which helps reduce load and minimizes interference with normal business operations.
[0016] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0017] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is one of the flowcharts of the node bandwidth evaluation method according to an embodiment of the present invention; Figure 2 This is the second flowchart of the node bandwidth evaluation method according to an embodiment of the present invention; Figure 3 This is the third step in the flowchart of the node bandwidth evaluation method according to an embodiment of the present invention; Figure 4 This is a schematic block diagram of the node bandwidth evaluation device according to an embodiment of the present invention; Figure 5 This is a block diagram illustrating the principle of the node bandwidth evaluation system according to an embodiment of the present invention. Detailed Implementation
[0018] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0019] In the description of this invention, "several" means one or more, "multiple" means two or more, "greater than," "less than," "exceeding," etc. are understood to exclude the stated number, and "above," "below," "within," etc. are understood to include the stated number. If "first," "second," etc. are used in the description, they are only for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the order of the indicated technical features.
[0020] In distributed task scheduling systems (such as Hadoop Yarn, Kubernetes, and Mesos), data locality is a key factor affecting task execution efficiency, aiming to bring computation as close to the data as possible to reduce costly network transmissions. To achieve this goal, scheduling strategies need to make intelligent decisions based on the network conditions between nodes. Traditional scheduling strategies typically rely on static network topology configurations or simple Ping values based on the ICMP protocol to determine the network distance and connectivity between nodes. However, with the widespread adoption of compute-storage separation architectures, the separation of compute and storage nodes has made available throughput between nodes the performance bottleneck that determines whether data locality can be effectively achieved or efficient remote access can be achieved. Therefore, accurately obtaining the actual bandwidth between nodes is a prerequisite for scheduling strategies to make correct judgments.
[0021] In related technologies, active probing is typically used to obtain the true bandwidth between nodes. The core of this method is to establish independent TCP connections (e.g., using the iperf tool) and estimate available bandwidth by sending probe packets. However, this measurement method has the following significant drawbacks: 1) Huge network and system overhead: Frequent probing requires the constant establishment and teardown of TCP connections, which not only consumes a large amount of system resources such as file descriptors, but also generates additional control plane traffic, increasing the burden on the scheduling system itself.
[0022] 2) Distortion of measurement results: On the one hand, the probe packets of a regular TCP connection are extremely small (usually only a few hundred bytes), which cannot effectively trigger and reflect the dynamic behavior of the TCP congestion window in high-throughput scenarios, resulting in artificially high measurement values. On the other hand, if the probe packets are simply padded with all zeros to simulate real load, they are easily compressed by the compression algorithms of the network card driver or middleware (such as Snappy, Gzip), making the measured bandwidth much higher than the actual physical bandwidth, i.e., the bandwidth measurement results are distorted.
[0023] 3) Interference with normal business operations: Uncontrolled probe traffic will compete with normal business data flow for network resources. In bandwidth-limited scenarios, probe traffic may occupy the transmission bandwidth of business data, resulting in decreased business performance and increased latency.
[0024] Based on this, please refer to Figure 1 This embodiment discloses a node bandwidth evaluation method, including steps S110 to S140. It should be noted that the numbering of the steps in this embodiment is only for ease of review and understanding, and not to limit the execution order of the steps. The details of each step are described below: S110. In response to the first heartbeat request message from the worker node, the scheduling node returns a heartbeat response message containing probe instructions, which include a probe switch identifier and a target fill size. For example, in a distributed system, the master node and worker nodes maintain communication and state synchronization through a periodic heartbeat mechanism. This embodiment uses gRPC as the communication framework and defines the data structure of heartbeat messages based on Protocol Buffers (PBuffers). gRPC, as a modern, open-source, high-performance remote procedure call (RPC) framework, has cross-platform compatibility, low latency, and support for streaming transmission, making it suitable for microservice communication within and across data centers. Meanwhile, Protocol Buffers, as an efficient and compact binary serialization format, has advantages such as fast serialization speed, small data size, and strong compatibility, making it very suitable for high-frequency, low-overhead heartbeat message transmission.
[0025] In traditional heartbeat mechanisms, heartbeat request and response messages typically only contain basic information such as node status and timestamps to determine whether a node is alive. However, this embodiment extends the heartbeat protocol. While maintaining the original functionality, it adds message fields and adjusts the responses and requests of both communicating parties. This achieves bandwidth detection while retaining the heartbeat detection function, resulting in an integrated "heartbeat + detection" communication technology.
[0026] Specifically, a new field has been added to the heartbeat response message to carry a probe instruction. The probe instruction is generated and issued by the scheduling node and is used to control whether the worker node executes the bandwidth probe task. A new field has been added to the heartbeat request message to carry a probe payload. The probe payload is a piece of random or pseudo-random data of configurable size, used to simulate the transmission behavior of real business traffic.
[0027] In a typical heartbeat cycle, a worker node sends a first heartbeat request message to the scheduling node, containing the current node's status information. Upon receiving the first heartbeat request message, the scheduling node performs routine heartbeat response processing, such as updating the node's active status and recording a timestamp. If, based on the current scheduling policy or network monitoring requirements, the scheduling node needs to perform bandwidth probing on a worker node, it embeds a probe instruction in the current heartbeat response message. The probe instruction includes a probe switch flag and a target padding size. The probe switch flag indicates whether the worker node should initiate the current bandwidth probing process; the target padding size, in bytes, specifies the amount of data the probe payload should fill, such as 256KB or 512KB, to simulate different scales of data transmission scenarios.
[0028] S120. In response to the heartbeat response message, when the probe switch identifier is indicated as open, the working node extracts data segments from the pre-configured static buffer and encapsulates them into a probe payload. The size of the data segment is related to the target filling size. For example, after receiving a heartbeat response message containing a probe command, the worker node parses the probe command to obtain the probe switch identifier and the target fill size. If the probe switch identifier is "on", a data segment of the corresponding size is extracted from the pre-configured static buffer according to the target fill size as probe data, so that the data segment can be encapsulated into a probe payload and sent back to the scheduling node through the established gRPC connection.
[0029] S130, The working node puts the probe payload into a second heartbeat request message and sends it to the scheduling node; For example, the scheduling node and the worker node reuse the existing heartbeat channel. After the worker node completes the encapsulation of the probe payload, it puts the probe payload into a second heartbeat request message, which is then sent to the scheduling node through the established gRPC connection (i.e., the heartbeat channel).
[0030] S140. In response to the second heartbeat request message, the scheduling node determines the instantaneous bandwidth based on the time taken to receive the probe payload and the amount of data, and updates the bandwidth score of the working node based on the instantaneous bandwidth and the historical bandwidth score.
[0031] For example, upon receiving a second heartbeat request message, the scheduling node responds to the second heartbeat information by parsing and reading the probe payload within it. It records a first timestamp indicating the start of reading the probe payload and a second timestamp indicating the completion of reading. The difference between the second and first timestamps determines the time taken for the scheduling node to receive the probe payload. Based on this time taken and the amount of data read, the instantaneous bandwidth between nodes can be calculated, and the bandwidth score of the working node can be determined accordingly. In this embodiment, updating the bandwidth score of the working node based on the instantaneous bandwidth and historical bandwidth scores reduces drastic fluctuations in the bandwidth score caused by single probe errors, thus improving the accuracy of bandwidth assessment.
[0032] This embodiment reuses the existing heartbeat channel, eliminating the need to establish an additional independent probe connection, which significantly reduces system overhead. The probe behavior is triggered on demand by the scheduling node, providing controllability and flexibility. The probe payload can be dynamically adjusted to avoid measurement distortion caused by data that is too small or compressed. At the same time, since the probe traffic and heartbeat messages share the same connection, the transmission behavior of the probe traffic is closer to the real business scenario, and the measurement results are more representative.
[0033] Therefore, the scheduling node encapsulates the probe instructions used for bandwidth probing in the heartbeat response message, and the worker node encapsulates the probe payload in the second heartbeat request message. This allows the scheduling node and worker nodes to reuse the existing long-connection heartbeat channel for bandwidth probing without establishing a new TCP connection, which helps reduce resource consumption. Moreover, the worker node extracts data fragments from the pre-configured static buffer and encapsulates them into probe payloads, and then puts the probe payloads into the second heartbeat request message. This avoids frequently requesting large blocks of memory, which helps reduce the load and minimizes interference with normal business operations.
[0034] In some application examples, the static buffer stores high-entropy pseudo-random byte sequences. Data fragments are extracted from the pre-configured static buffer and encapsulated into probe payloads, including: High-entropy pseudo-random byte sequence fragments are extracted from a pre-configured static buffer using a zero-copy method and encapsulated as a probe payload.
[0035] For example, entropy is a metric for measuring the randomness of a byte string. High entropy refers to a uniformly random byte string, while low entropy refers to a byte string that is easily guessed or predicted. A random number generator (RNG) is a tool that generates approximately random sequences using deterministic algorithms. Essentially, it's a mathematical function that relies on a seed value to construct a repeating sequence. The seed value can be obtained from a high-entropy source (such as a hardware entropy pool), avoiding the use of predictable values (such as timestamps). Encapsulating high-entropy pseudo-random byte sequence fragments in the probe payload helps prevent automatic compression by the gRPC connection layer or network link layer, ensuring that the measurement results accurately reflect the throughput capacity of the physical link and exhibiting good resistance to compression spoofing. Furthermore, the use of static buffers to store data and zero-copy technology to extract data fragments on worker nodes avoids the GC (garbage collection) pressure and CPU load spikes caused by frequent requests for large memory blocks, thus reducing system overhead. Zero-copy is an optimization technique for computer I / O operations. Its core is that the CPU does not need to copy data from one storage area to another, significantly reducing context switching and CPU copy time, thereby improving system throughput. This technology utilizes mechanisms such as DMA (Direct Memory Access) and memory mapping to enable data to be transferred directly in kernel space or at the hardware level, avoiding redundant copying of data between user space and kernel space in traditional I / O modes.
[0036] In step S140 above, updating the bandwidth score of the working node based on the instantaneous bandwidth and historical bandwidth score includes: The bandwidth score of the working node is updated by performing an exponential moving average based on the instantaneous bandwidth and historical bandwidth scores.
[0037] For example, let the historical bandwidth score be EMA. old The updated bandwidth rating is EMA. new If the instantaneous bandwidth is BW, then EMA new =α×BW+(1-α)×EMA old Where α is the smoothing coefficient, α∈(0,1). This embodiment uses exponential moving average to smooth the jitter of the communication network, which can reduce the drastic fluctuations in bandwidth score caused by single detection errors and improve the accuracy of bandwidth assessment.
[0038] In some application examples, node bandwidth evaluation methods also include: The scheduling node increments the target filling size within consecutive heartbeat cycles; If the heartbeat round-trip delay exceeds a preset threshold at any stage, the issuance of the detection command will be terminated.
[0039] For example, to ensure the stability of the node cluster and prevent probe traffic from impacting normal business operations, this embodiment uses a built-in state machine to achieve precise control over the bandwidth probe process. Specifically, a cold start cooling control time is configured for each node, for example, configuring each node to only trigger a complete probe process once every 30 minutes, thereby avoiding resource contention caused by frequent probes.
[0040] During the detection process, this embodiment employs a progressive detection strategy, breaking down the detection process and distributing it across multiple heartbeat cycles. For example: The first round of probing aims to test connectivity. The scheduling node is configured with a target padding size of 10KB. Worker nodes respond to commands by directly extracting a 10KB high-entropy pseudo-random byte sequence fragment from a pre-configured static buffer using zero-copy technology and encapsulating it as the probe payload. This step aims to quickly test network connectivity and basic latency with minimal overhead.
[0041] Second round of detection: Gradually increase the pressure. If the first round of detection is normal, the scheduling node will increase the target filling size to 100KB in the next cycle to further detect the transmission capacity of the link.
[0042] The third round of probing: Saturation testing is conducted. If the first two rounds of probing pass, the scheduling node is configured with a target padding size of 1MB to simulate large data transmission and test the actual throughput performance of the network link under near-saturation conditions.
[0043] In addition, to ensure the security of the probe, if the heartbeat round-trip delay exceeds a preset threshold in any round of probe, the probe state is immediately reset and subsequent probes are stopped, that is, the probe commands are terminated from being sent to the worker nodes. This ensures that the probe exits quickly when network congestion is detected, without affecting the overall stability of the cluster.
[0044] In some application examples, node bandwidth evaluation methods also include: The scheduling node monitors local load characteristics and stops generating probe commands if any load characteristic exceeds a preset threshold. Alternatively, the scheduling node may stop generating probe commands if the overall heartbeat timeout rate of the cluster exceeds a preset threshold.
[0045] For example, this embodiment also configures a global circuit breaker protection mechanism. The scheduling node monitors local load characteristics, such as CPU load and I / O load. When any load characteristic exceeds a preset threshold (e.g., CPU utilization exceeds 80%), it automatically disables the probing function of all worker nodes and stops generating probing commands through a protocol flag. Alternatively, the scheduling node stops generating probing commands when the overall heartbeat timeout rate of the cluster exceeds a preset threshold. In this way, global circuit breaker protection can be achieved to ensure the reliability of the probing behavior.
[0046] Therefore, the working nodes use static buffers to store data and zero-copy technology to extract data fragments. Combined with the global circuit breaker mechanism of progressive probe and scheduling nodes, this ensures that the probe behavior will not impact the normal cluster heartbeat keep-alive logic, avoids interfering with normal business logic, and helps improve the stability and reliability of bandwidth probe.
[0047] Please refer to Figure 2 Based on the above technical concept, this embodiment also provides a node bandwidth evaluation method, applied to scheduling nodes, including steps S210-S220. It should be noted that the numbering of the steps in this embodiment is only for ease of review and understanding, and not to limit the execution order of the steps. The details of each step are described below: S210. In response to the first heartbeat request message from the worker node, return a heartbeat response message containing the probe command, and wait for the worker node to send another heartbeat request message; S220, in response to the second heartbeat request message from the working node, determine the instantaneous bandwidth based on the time taken and the amount of data received from the probe payload contained in the second heartbeat request message, and update the bandwidth score of the working node based on the instantaneous bandwidth and the historical bandwidth score.
[0048] For example, in a distributed system, the master node and worker nodes maintain communication and state synchronization through a periodic heartbeat mechanism. This embodiment uses gRPC as the communication framework and defines the data structure of heartbeat messages based on Protocol Buffers (PBuffers). gRPC, as a modern, open-source, high-performance remote procedure call (RPC) framework, has cross-platform compatibility, low latency, and support for streaming transmission, making it suitable for microservice communication within and across data centers. Meanwhile, Protocol Buffers, as an efficient and compact binary serialization format, has advantages such as fast serialization speed, small data size, and strong compatibility, making it very suitable for high-frequency, low-overhead heartbeat message transmission.
[0049] In traditional heartbeat mechanisms, heartbeat request and response messages typically only contain basic information such as node status and timestamps to determine whether a node is alive. However, this embodiment extends the heartbeat protocol. While maintaining the original functionality, it adds message fields and adjusts the responses and requests of both communicating parties. This achieves bandwidth detection while retaining the heartbeat detection function, resulting in an integrated "heartbeat + detection" communication technology.
[0050] Specifically, a new field has been added to the heartbeat response message to carry a probe instruction. The probe instruction is generated and issued by the scheduling node and is used to control whether the worker node executes the bandwidth probe task. A new field has been added to the heartbeat request message to carry a probe payload. The probe payload is a piece of random or pseudo-random data of configurable size, used to simulate the transmission behavior of real business traffic.
[0051] In a typical heartbeat cycle, a worker node sends a first heartbeat request message to the scheduling node, containing the current node's status information. Upon receiving the first heartbeat request message, the scheduling node performs routine heartbeat response processing, such as updating the node's active status and recording a timestamp. If, based on the current scheduling policy or network monitoring requirements, the scheduling node needs to perform bandwidth probing on a worker node, it embeds a probe instruction in the current heartbeat response message. The probe instruction includes a probe switch flag and a target padding size. The probe switch flag indicates whether the worker node should initiate the current bandwidth probing process; the target padding size, in bytes, specifies the amount of data the probe payload should fill, such as 256KB or 512KB, to simulate different scales of data transmission scenarios.
[0052] After responding to the first heartbeat request message, the scheduling node waits for the worker node to send another heartbeat request message. Upon receiving the second heartbeat request message, the scheduling node responds by parsing and reading the probe payload within it, recording the first timestamp of starting to read the probe payload and the second timestamp of completing the reading. The difference between the first and second timestamps determines the time taken for the scheduling node to receive the probe payload. Based on the time taken and the amount of data read, the instantaneous bandwidth between the nodes can be calculated, and the bandwidth score of the worker node can be determined accordingly. In this embodiment, updating the bandwidth score of the worker node based on the instantaneous bandwidth and historical bandwidth scores reduces drastic fluctuations in the bandwidth score caused by single probe errors, thus improving the accuracy of bandwidth assessment.
[0053] This embodiment reuses the existing heartbeat channel, eliminating the need to establish an additional independent probe connection, which significantly reduces system overhead. The probe behavior is triggered on demand by the scheduling node, providing controllability and flexibility. The probe payload can be dynamically adjusted to avoid measurement distortion caused by data that is too small or compressed. At the same time, since the probe traffic and heartbeat messages share the same connection, the transmission behavior of the probe traffic is closer to the real business scenario, and the measurement results are more representative.
[0054] Please refer to Figure 3 Based on the above technical concept, this embodiment also provides a node bandwidth evaluation method, applied to a working node, including steps S310 to S330. It should be noted that the numbering of the steps in this embodiment is only for ease of review and understanding, and not to limit the execution order of the steps. The details of each step are described below: S310. In response to the scheduling node returning a heartbeat response message containing the probe command, parse the probe command to obtain the probe switch identifier and the target fill size; S320. When the detection switch indicator is turned on, extract data segments from the pre-configured static buffer and encapsulate them into a detection payload. The size of the data segment is related to the target filling size. S330. The probe payload is placed in the second heartbeat request message and sent to the scheduling node so that the scheduling node can determine the instantaneous bandwidth and update the bandwidth score.
[0055] For example, in a distributed system, the master node and worker nodes maintain communication and state synchronization through a periodic heartbeat mechanism. This embodiment uses gRPC as the communication framework and defines the data structure of heartbeat messages based on Protocol Buffers (PBuffers). gRPC, as a modern, open-source, high-performance remote procedure call (RPC) framework, has cross-platform compatibility, low latency, and support for streaming transmission, making it suitable for microservice communication within and across data centers. Meanwhile, Protocol Buffers, as an efficient and compact binary serialization format, has advantages such as fast serialization speed, small data size, and strong compatibility, making it very suitable for high-frequency, low-overhead heartbeat message transmission.
[0056] In traditional heartbeat mechanisms, heartbeat request and response messages typically only contain basic information such as node status and timestamps to determine whether a node is alive. However, this embodiment extends the heartbeat protocol. While maintaining the original functionality, it adds message fields and adjusts the responses and requests of both communicating parties. This achieves bandwidth detection while retaining the heartbeat detection function, resulting in an integrated "heartbeat + detection" communication technology.
[0057] Specifically, a new field has been added to the heartbeat response message to carry a probe instruction. The probe instruction is generated and issued by the scheduling node and is used to control whether the worker node executes the bandwidth probe task. A new field has been added to the heartbeat request message to carry a probe payload. The probe payload is a piece of random or pseudo-random data of configurable size, used to simulate the transmission behavior of real business traffic.
[0058] After receiving a heartbeat response message containing a probe command, the worker node parses the probe command to obtain the probe switch identifier and the target fill size. If the probe switch identifier is "on", it extracts a data segment of the corresponding size from the pre-configured static buffer as probe data according to the target fill size, and encapsulates the data segment into a probe payload through the established gRPC connection and sends it back to the scheduling node so that the scheduling node can determine the instantaneous bandwidth and update the bandwidth score.
[0059] This embodiment reuses the existing heartbeat channel, eliminating the need to establish an additional independent probe connection, which significantly reduces system overhead. The probe behavior is triggered on demand by the scheduling node, providing controllability and flexibility. The probe payload can be dynamically adjusted to avoid measurement distortion caused by data that is too small or compressed. At the same time, since the probe traffic and heartbeat messages share the same connection, the transmission behavior of the probe traffic is closer to the real business scenario, and the measurement results are more representative.
[0060] Therefore, the scheduling node encapsulates the probe instructions used for bandwidth probing in the heartbeat response message, and the worker node encapsulates the probe payload in the second heartbeat request message. This allows the scheduling node and worker nodes to reuse the existing long-connection heartbeat channel for bandwidth probing without establishing a new TCP connection, which helps reduce resource consumption. Moreover, the worker node extracts data fragments from the pre-configured static buffer and encapsulates them into probe payloads, and then puts the probe payloads into the second heartbeat request message. This avoids frequently requesting large blocks of memory, which helps reduce the load and minimizes interference with normal business operations.
[0061] Please refer to Figure 4 This invention provides a node bandwidth evaluation device, including a scheduling node 110 and a worker node 120. The scheduling node 110 is used to respond to the first heartbeat request message of the worker node 120 by returning a heartbeat response message containing probe instructions, including probe switch identifier and target fill size; Work node 120 is used to respond to heartbeat response messages, and when the probe switch flag is indicated to be on, to extract data fragments from a pre-configured static buffer and encapsulate them into probe payloads. The size of the data fragments is related to the target fill size. Work node 120 is also used to put the probe payload into a second heartbeat request message and send it to schedule node 110; The scheduling node 110 is also used to respond to the second heartbeat request message, determine the instantaneous bandwidth based on the time taken and the amount of data received from the probe payload, and update the bandwidth score of the working node 120 based on the instantaneous bandwidth and the historical bandwidth score.
[0062] In this embodiment of the invention, the scheduling node encapsulates the probe instruction for bandwidth probing in a heartbeat response message, and the worker node encapsulates the probe payload in a second heartbeat request message. This allows the scheduling node and worker nodes to reuse the existing long-connection heartbeat channel for bandwidth probing without establishing a new TCP connection, which helps reduce resource consumption. Furthermore, the worker node extracts data fragments from a pre-configured static buffer and encapsulates them into a probe payload, then places the probe payload into the second heartbeat request message. This avoids frequently requesting large blocks of memory, which helps reduce load and interference with normal business operations.
[0063] Please refer to Figure 5 This embodiment provides a node bandwidth assessment system, including a processor 210 and a memory 220. The memory 220 stores a computer program, and the processor 210 executes the computer program to implement the aforementioned node bandwidth assessment method. The specific content of the node bandwidth assessment method can be found above and will not be repeated here. The scheduling node encapsulates the probe instructions for bandwidth probing in a heartbeat response message, and the worker node encapsulates the probe payload in a second heartbeat request message. This allows the scheduling node and worker nodes to reuse existing long-connection heartbeat channels for bandwidth probing without establishing new TCP connections, thus reducing resource consumption. Furthermore, the worker node extracts data fragments from a pre-configured static buffer and encapsulates them into probe payloads, placing the probe payloads into the second heartbeat request message. This avoids frequent requests for large blocks of memory, reducing load and interference with normal business operations.
[0064] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is run, it implements the node bandwidth assessment method described above. The specific content of the node bandwidth assessment method can be found above and will not be repeated here. The scheduling node encapsulates the probe instructions for bandwidth probing in a heartbeat response message, and the worker node encapsulates the probe payload in a second heartbeat request message. This allows the scheduling node and worker nodes to reuse existing long-lived heartbeat connection channels for bandwidth probing, eliminating the need to establish new TCP connections and reducing resource consumption. Furthermore, the worker node extracts data fragments from a pre-configured static buffer, encapsulates them into probe payloads, and places the probe payloads into the second heartbeat request message, avoiding frequent allocation of large memory blocks, which helps reduce load and interference with normal business operations.
[0065] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A method of node bandwidth assessment, the method comprising: include: In response to the worker node's first heartbeat request message, the scheduling node returns a heartbeat response message containing a probe instruction, which includes a probe switch identifier and a target fill size; In response to the heartbeat response message, when the probe switch identifier is indicated as on, the working node extracts a data segment from a pre-configured static buffer and encapsulates it into a probe payload, the size of which is related to the target fill size; The working node places the probe payload into a second heartbeat request message and sends it to the scheduling node; In response to the second heartbeat request message, the scheduling node determines the instantaneous bandwidth based on the time taken and the amount of data received from the probe payload, and updates the bandwidth score of the working node based on the instantaneous bandwidth and the historical bandwidth score.
2. The node bandwidth assessment method of claim 1, wherein, The static buffer stores high-entropy pseudo-random byte sequences. The step of extracting data fragments from the pre-configured static buffer and encapsulating them into a probe payload includes: High-entropy pseudo-random byte sequence fragments are extracted from a pre-configured static buffer using a zero-copy method and encapsulated as a probe payload.
3. The node bandwidth assessment method of claim 1, wherein, The step of updating the bandwidth score of the working node based on the instantaneous bandwidth and historical bandwidth score includes: The bandwidth score of the working node is updated by performing an exponential moving average process based on the instantaneous bandwidth and historical bandwidth score.
4. The node bandwidth assessment method of claim 1, wherein, The node bandwidth evaluation method also includes: The scheduling node increments the target filling size within consecutive heartbeat cycles; If the heartbeat round-trip delay exceeds a preset threshold at any stage, the issuance of the detection command will be terminated.
5. The node bandwidth assessment method of claim 1 or 4, wherein, The node bandwidth evaluation method also includes: The scheduling node monitors local load characteristics and stops generating the detection command if any load characteristic exceeds a preset threshold. Alternatively, the scheduling node may stop generating the detection command if the overall heartbeat timeout rate of the cluster exceeds a preset threshold.
6. A node bandwidth evaluation method, applied to scheduling nodes, characterized in that, include: In response to the worker node's first heartbeat request message, return a heartbeat response message containing probe instructions, and wait for the worker node to send a heartbeat request message again; In response to a second heartbeat request message from the working node, the instantaneous bandwidth is determined based on the time taken and the amount of data received from the probe payload contained in the second heartbeat request message, and the bandwidth score of the working node is updated based on the instantaneous bandwidth and the historical bandwidth score.
7. A node bandwidth evaluation method, applied to a working node, characterized in that, include: In response to the scheduling node returning a heartbeat response message containing the probe command, the probe command is parsed to obtain the probe switch identifier and the target fill size; When the detection switch indicator is set to ON, data segments are extracted from a pre-configured static buffer and encapsulated into a detection payload, the size of which is related to the target fill size; The probe payload is placed into a second heartbeat request message and sent to the scheduling node so that the scheduling node can determine the instantaneous bandwidth and update the bandwidth score.
8. A node bandwidth evaluation device, characterized in that, Including scheduling nodes and worker nodes, The scheduling node is used to respond to the first heartbeat request message from the worker node by returning a heartbeat response message containing a probe instruction, the probe instruction including a probe switch identifier and a target fill size; The working node is used to respond to the heartbeat response message, and when the probe switch identifier is indicated as on, to extract data segments from a pre-configured static buffer and encapsulate them into a probe payload, wherein the size of the data segment is associated with the target fill size; The working node is also used to put the probe payload into a second heartbeat request message and send it to the scheduling node; The scheduling node is also configured to respond to the second heartbeat request message, determine the instantaneous bandwidth based on the time taken and the amount of data received from the probe payload, and update the bandwidth score of the working node based on the instantaneous bandwidth and the historical bandwidth score.
9. A node bandwidth evaluation system, comprising a processor and a memory, wherein the memory stores a computer program, characterized in that, When the processor runs the computer program, it is used to implement the node bandwidth evaluation method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is run, it implements the node bandwidth evaluation method as described in any one of claims 1 to 7.