A communication method, a communication system, a storage medium, and a program product
By serializing devices in the communication system according to their address size and adopting a directional forwarding mechanism, the problems of communication bottlenecks and single point of failure risks in centralized communication architectures are solved, communication efficiency and reliability are improved, forwarding logic is simplified, and real-time monitoring and optimization of network performance are realized.
Patent Information
- Application Number
- CN202510498374.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2045-04-21
AI Technical Summary
Centralized communication architectures are prone to creating communication bottlenecks as the number of devices increases, leading to a sharp increase in the data processing load on the central controller, resulting in a high risk of single point of failure and low communication efficiency.
In a communication system, devices are connected in series according to their own address size. Data packets with device addresses smaller than their own addresses are forwarded through the first serial port, and data packets with device addresses larger than their own addresses are forwarded through the second serial port. A directional forwarding mechanism is adopted, which introduces routing path information and device address sequence, forwards data step by step, and monitors the buffer queue and transmission delay.
It avoids the bottleneck problems of traditional centralized architecture, reduces the risk of single point of failure, improves communication efficiency and reliability, simplifies forwarding logic, enhances system maintainability, and enables real-time monitoring and optimization of network performance.
Smart Images

Figure CN120281823B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method, communication system, storage medium, and program product. Background Technology
[0002] With the rapid development of communication technology, the demand for data interaction between various devices in communication systems is increasing. In application scenarios such as industrial control and the Internet of Things, multiple devices often need to exchange data and share information in real time to achieve collaborative control and coordinated operation.
[0003] Currently, device communication methods employ a centralized communication architecture, where a central controller manages and forwards data between various devices. In practice, all devices establish a communication connection with the central controller. When a device needs to interact with other devices, it first sends a data packet to the central controller, which then forwards the packet to the appropriate device.
[0004] However, this centralized communication architecture has certain limitations in practical applications. Since all data interactions need to be relayed through the central controller, the data processing load on the central controller will increase sharply as the number of devices in the communication system increases, easily forming a communication bottleneck. Summary of the Invention
[0005] This application provides a communication method, communication system, storage medium, and program product for implementing targeted data forwarding to reduce invalid forwarding and improve communication efficiency.
[0006] In a first aspect, this application provides a communication method applied to a communication system comprising a plurality of devices connected in series according to the size of their respective addresses. The method comprises: acquiring a first data frame from a requesting device, the first data frame including a first source address and a first destination address, the first source address representing the address where the requesting device sends data and the first destination address representing the address where a responding device receives data; determining the size of the first source address and the first destination address; if the first source address is greater than the first destination address, then transmitting the first data frame to the responding device cascadingly through a first serial port, the first serial port being used to forward data packets whose device address is smaller than its own address; acquiring a second data frame from the responding device, the second data frame including a second source address and a second destination address, the second source address representing the address where the responding device sends data and the second destination address representing the address where the requesting device receives data; and transmitting the second data frame to the requesting device cascadingly through a second serial port, the second serial port being used to forward data packets whose device address is larger than its own address.
[0007] By adopting the above technical solution, several devices in the communication system are connected in series according to their own address order. When a requesting device sends a first data frame, the communication system selects a different serial port to forward the first data frame based on the relationship between the source and destination addresses. After receiving the first data frame, the responding device sends a second data frame, and the communication system selects a different serial port to forward the second data frame based on the relationship between the source and destination addresses. This method avoids the bottleneck problem in traditional centralized architectures where all data needs to be forwarded through a central controller, significantly reducing the risk of single point of failure. Simultaneously, by forwarding data packets with device addresses smaller than their own addresses through the first serial port and data packets with device addresses larger than their own addresses through the second serial port, targeted data forwarding is achieved, reducing invalid forwarding and improving communication efficiency.
[0008] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of determining the size of the first source address and the first destination address, the method further includes: if the first source address is less than the first destination address, then sending the first data frame to the response device step by step through the second serial port; obtaining the second data frame of the response device, the second data frame including a second source address and a second destination address, the second source address being used to represent the address where the response device sends data, and the second destination address being used to represent the address where the requesting device receives data; and sending the second data frame to the requesting device step by step through the first serial port.
[0009] By adopting the above technical solution, a complete bidirectional communication mechanism is formed with the forwarding scheme when the source address is greater than the destination address, ensuring that data can find the correct forwarding path regardless of the relationship between the source and destination addresses. Simultaneously, because different serial port forwarding methods are used for outbound and inbound data transmission, the problem of data packets being circulated in the network is effectively avoided, improving communication reliability and reducing the possibility of network congestion.
[0010] In conjunction with some embodiments of the first aspect, in some embodiments, if the first source address is greater than the first destination address, the first data frame is sent to the response device step by step through the first serial port. Specifically, this includes: determining the routing path information of the first data frame based on the first source address and the first destination address, the routing path information including a sequence of device addresses from the requesting device to the response device; determining an intermediate forwarding device from the requesting device to the response device based on the device address sequence; sending the first data frame to the intermediate forwarding device through the first serial port of the requesting device; and forwarding the first data frame sequentially through the first serial port of the intermediate forwarding device until the first data frame is sent to the response device.
[0011] By adopting the above technical solution, routing path information and device address sequences are introduced, enabling precise planning of data forwarding paths. This makes the forwarding of the first data frame more controllable and avoids resource waste caused by blind forwarding. Simultaneously, through a hierarchical forwarding mechanism, each intermediate forwarding device only needs to focus on the next-hop device directly connected to it, simplifying the forwarding logic and improving the maintainability of the communication system.
[0012] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of determining an intermediate forwarding device from the requesting device to the responding device based on the device address sequence, the method further includes: if there is no intermediate forwarding device between the requesting device and the responding device, then sending the first data frame to the responding device through the first serial port of the requesting device.
[0013] By employing the above technical solution, the communication system determines whether to directly or indirectly forward the first data frame by identifying whether an intermediate forwarding device exists between the requesting device and the responding device. When the two devices are adjacent, the communication system can directly send the first data frame to the responding device through the first serial port of the requesting device, reducing communication latency and network load, and improving communication efficiency.
[0014] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of determining the intermediate forwarding device from the requesting device to the responding device based on the device address sequence, the method further includes: obtaining the cache queue of the intermediate forwarding device; and if the occupancy rate of the cache queue exceeds a preset occupancy rate threshold, sending a congestion notification frame to the requesting device.
[0015] By adopting the above technical solution, the communication system monitors the buffer queue occupancy of intermediate forwarding devices and sets up an early warning mechanism, thereby enabling timely detection and prevention of network congestion problems. This proactive congestion control mechanism not only protects forwarding devices from buffer overflow but also maintains the stable operation of the entire network.
[0016] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of sending the second data frame to the requesting device step by step through the second serial port, where the second serial port is used to forward data packets whose device address is greater than its own address, the method further includes: obtaining the forwarding timestamp of each forwarding device; calculating the transmission delay between the adjacent first forwarding device and the adjacent second forwarding device based on the forwarding timestamp; and marking the adjacent second forwarding device as an abnormal device if the transmission delay exceeds a preset delay threshold.
[0017] By adopting the above technical solution, the communication system records and analyzes the forwarding timestamp of each forwarding device to establish a complete transmission delay monitoring mechanism. This mechanism calculates the transmission delay between adjacent forwarding devices and compares it with a preset delay threshold, thereby quickly identifying abnormal devices, accurately locating problem nodes in the network, and providing precise guidance for network maintenance and troubleshooting.
[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after the step of sending the second data frame to the requesting device step by step through the second serial port, whereby the second serial port is used to forward data packets whose device address is greater than its own address, the method further includes: recording data transmission information between the requesting device and the responding device, the data transmission information including data transmission start time, data transmission end time, total amount of data transmitted, and average transmission rate; and generating a data transmission quality assessment report based on the data transmission information, the data transmission quality assessment report including transmission success rate, end-to-end transmission delay, and data packet loss rate.
[0019] By adopting the above technical solutions, the communication system comprehensively records data transmission information and generates data transmission quality assessment reports, realizing a complete network performance monitoring and evaluation mechanism. This not only helps administrators understand the real-time operating status of the network, but also provides a basis for network optimization and upgrades.
[0020] In a second aspect, embodiments of this application provide a communication system comprising: one or more processors and a memory; the memory is coupled to the one or more processors and is used to store computer program code, the computer program code including computer instructions, wherein the one or more processors invoke the computer instructions to cause the communication system to perform the method described in the first aspect and any possible implementation thereof.
[0021] Thirdly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a communication system, cause the communication system to perform the method described in the first aspect and any possible implementation thereof.
[0022] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a communication system, cause the communication system to perform the method described in the first aspect and any possible implementation thereof.
[0023] Understandably, the communication system provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.
[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0025] 1. By adopting the above technical solution, several devices in the communication system are connected in series according to the order of their own addresses. When a requesting device sends a first data frame, the communication system selects a different serial port to forward the first data frame based on the relationship between the source and destination addresses. After receiving the first data frame, the responding device sends a second data frame, and the communication system selects a different serial port to forward the second data frame based on the relationship between the source and destination addresses. This method avoids the bottleneck problem in traditional centralized architectures where all data needs to be forwarded through a central controller, significantly reducing the risk of single point of failure. Simultaneously, by forwarding data packets with device addresses smaller than their own addresses through the first serial port and data packets with device addresses larger than their own addresses through the second serial port, targeted data forwarding is achieved, reducing invalid forwarding and improving communication efficiency.
[0026] 2. By adopting the above technical solution, a complete bidirectional communication mechanism is formed with the forwarding scheme when the source address is greater than the destination address, ensuring that data can find the correct forwarding path regardless of the relationship between the source and destination addresses. Simultaneously, because different serial port forwarding methods are used for outbound and inbound data transmission, the problem of data packets being forwarded in a loop within the network is effectively avoided, improving communication reliability and reducing the possibility of network congestion.
[0027] 3. By adopting the above technical solution, routing path information and device address sequences are introduced, enabling precise planning of data forwarding paths. This makes the forwarding of the first data frame more controllable and avoids resource waste caused by blind forwarding. Simultaneously, through the hierarchical forwarding mechanism, each intermediate forwarding device only needs to focus on the next-hop device directly connected to it, simplifying the forwarding logic and improving the maintainability of the communication system. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of a device connection in the communication system of this application embodiment;
[0029] Figure 2 This is a flowchart illustrating a communication method in an embodiment of this application;
[0030] Figure 3 This is another flowchart illustrating the communication method in an embodiment of this application;
[0031] Figure 4 This is a schematic diagram of the physical device structure of a communication system in an embodiment of this application. Detailed Implementation
[0032] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.
[0033] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.
[0034] The following is a schematic diagram of the device connection of the communication system in an embodiment of this application. Please refer to [link / reference]. Figure 1 .
[0035] The communication system includes multiple devices, each assigned a unique address number (ranging from 0001 to 000n). All devices are connected in series in order of their address values, forming a complete communication loop via TX (transmit) and RX (receive) signal lines.
[0036] The following describes the process of the method provided in this implementation. Please refer to [link / reference]. Figure 2 This is a flowchart illustrating a communication method in an embodiment of this application.
[0037] S201. Obtain a first data frame from the requesting device. The first data frame includes a first source address and a first destination address. The first source address is used to represent the address where the requesting device sends data, and the first destination address is used to represent the address where the responding device receives data.
[0038] In this context, the requesting device refers to the device that actively initiates a data communication request in the communication system; a data frame represents a data packet unit transmitted in serial communication, containing control information and data content, for example, in the format <source address, destination address, data length, data, checksum>; the first data frame refers to the request data frame sent by the requesting device to the responding device; the source address refers to the unique identifier address of the device sending data in the network; the destination address refers to the unique identifier address of the device receiving data in the network; the first source address is used to represent the address of the requesting device in this communication; the first destination address is used to represent the address of the responding device in this communication; and the responding device refers to the device that receives the first data frame and needs to return a response.
[0039] Specifically, first, the communication system checks the validity of the data communication request. Then, the communication system reads the complete first data frame from the requesting device's transmit buffer. The communication system verifies whether the format of the first data frame conforms to the predetermined protocol and parses out the first source address and first destination address contained in the first data frame. This address information will be used for subsequent routing decisions. If the first data frame format is incorrect or the address information is invalid, the communication system will request the requesting device to retransmit the first data frame.
[0040] S202. Determine the size of the first source address and the first destination address;
[0041] Here, "judgment" refers to determining the size relationship through comparison operations; "size" refers to the relative size of the first source address and the first destination address.
[0042] Specifically, the communication system compares the first source address and the first destination address parsed from the first data frame. Since devices in the communication system are connected in series according to their own address order, this comparison result will determine whether the first data frame is forwarded through the first serial port or the second serial port. If the address formats are inconsistent or cannot be compared, the communication system will report an error status.
[0043] S203. If the first source address is greater than the first destination address, the first data frame is sent to the responding device step by step through the first serial port. The first serial port is used to forward data packets whose device address is smaller than its own address.
[0044] The first serial port is used to forward data packets whose device address is smaller than its own address; step-by-step transmission indicates that the first data frame passes through intermediate forwarding devices sequentially according to a preset first forwarding order until it is sent to the acknowledgment device. Figure 1 For example, assuming device 1 is the requesting device and device 5 is the responding device, then the first source address refers to the address 0001 of device 1, the first destination address refers to the address 0005 of the responding device, device 1 sends the first data frame, which passes through intermediate forwarding devices: device 2, device 3 and device 4, and is finally sent to device 5; the self address refers to the address of each device itself.
[0045] Specifically, first, the communication system determines the complete forwarding path from the requesting device to the responding device, including all intermediate forwarding devices involved. Then, the communication system begins the data forwarding process through the requesting device's first serial port. Each intermediate forwarding device, upon receiving the first data frame, verifies its integrity and continues forwarding it through its own first serial port until the first data frame reaches the responding device. During the forwarding process, the communication system monitors the status of each forwarding node to ensure the reliability of data transmission.
[0046] S204. Obtain the second data frame of the responding device. The second data frame includes a second source address and a second destination address. The second source address is used to represent the address where the responding device sends data, and the second destination address is used to represent the address where the requesting device receives data.
[0047] In this context, the responding device refers to the device that receives the first data frame and needs to return the second data frame; the second data frame refers to the response data frame from the responding device to the requesting device; the second source address is used to indicate the address from which the responding device sends data; and the second destination address is used to indicate the address from which the requesting device receives data.
[0048] Specifically, first, the communication system checks whether the responding device has generated response data. Then, the communication system reads the complete second data frame from the responding device's transmission buffer. The communication system performs format verification on the second data frame to ensure it conforms to the communication protocol specifications. During the verification process, the communication system focuses on checking whether the second source address and the second destination address in the second data frame are correct; that is, the second source address should be the first destination address in the original first data frame, and the second destination address should be the first source address in the original first data frame. If an address mismatch is found, the communication system requests the responding device to regenerate the second data frame. Simultaneously, the communication system also verifies the integrity and validity of the second data frame to ensure the reliability of data transmission.
[0049] S205. The second data frame is sent to the requesting device step by step through the second serial port, which is used to forward data packets whose device address is greater than its own address.
[0050] The second serial port is used to forward data packets whose device address is greater than its own address; step-by-step transmission indicates that the second data frame passes through intermediate forwarding devices sequentially according to a preset second forwarding order until it is sent to the requesting device; Continuing from the example of step S203, Figure 1 For example, at this time, device 5 sends the second data frame, which passes through intermediate forwarding devices: device 4, device 3 and device 2, and is finally sent to device 1.
[0051] Specifically, firstly, the communication system determines the complete return path from the responding device to the requesting device based on the network topology and address distribution. Since the second data frame needs to be sent from the responding device with the smaller address to the requesting device with the larger address, the communication system chooses to use the second serial port for data forwarding. Each intermediate forwarding device, upon receiving the second data frame, performs data integrity verification and determines whether to continue forwarding or process it as the final receiver by comparing addresses.
[0052] By adopting the above technical solution, several devices in the communication system are connected in series according to their own address order. When a requesting device sends a first data frame, the communication system selects a different serial port to forward the first data frame based on the relationship between the source and destination addresses. After receiving the first data frame, the responding device sends a second data frame, and the communication system selects a different serial port to forward the second data frame based on the relationship between the source and destination addresses. This method avoids the bottleneck problem in traditional centralized architectures where all data needs to be forwarded through a central controller, significantly reducing the risk of single point of failure. Simultaneously, by forwarding data packets with device addresses smaller than their own addresses through the first serial port and data packets with device addresses larger than their own addresses through the second serial port, targeted data forwarding is achieved, reducing invalid forwarding and improving communication efficiency.
[0053] The following provides a more detailed description of the process of the method provided in this implementation. Please refer to [link / reference]. Figure 3 This is another flowchart illustrating the communication method in an embodiment of this application.
[0054] S301. Obtain a first data frame from the requesting device. The first data frame includes a first source address and a first destination address. The first source address is used to represent the address where the requesting device sends data, and the first destination address is used to represent the address where the responding device receives data.
[0055] For details, please refer to step S201, which will not be repeated here.
[0056] S302. Determine the size of the first source address and the first destination address;
[0057] For details, please refer to step S202, which will not be repeated here.
[0058] S303. If the first source address is greater than the first destination address, determine the routing path information of the first data frame based on the first source address and the first destination address. The routing path information includes a sequence of device addresses from the requesting device to the responding device.
[0059] Among them, the routing path information refers to the complete transmission path that the first data frame needs to traverse from the requesting device to the responding device; the device address sequence refers to the set of addresses of all involved devices arranged in the actual transmission order.
[0060] Specifically, first, the communication system acquires the address information and connection relationships of all devices in the network to construct a complete network topology map. Then, based on the first source address and the first destination address, the communication system performs a path search in the network topology map, determining the routing path information according to the device's serial order and address size relationship; an example can be found in step S203. The determined routing path information is converted into a sequence of device addresses arranged according to the actual transmission order for subsequent data forwarding. If a valid transmission path cannot be established, the communication system returns an error message.
[0061] S304. Based on the device address sequence, determine the intermediate forwarding device from the requesting device to the responding device;
[0062] In this context, the intermediate forwarding device refers to all devices involved in data forwarding located between the requesting device and the responding device. In the example following step S203, the intermediate forwarding devices are device 2, device 3, and device 4. In the example following step S205, the intermediate forwarding devices are device 4, device 3, and device 2.
[0063] Specifically, first, the communication system removes the first source address and the first destination address from the device address sequence, and the remaining addresses constitute the set of intermediate forwarding device addresses. The communication system verifies the current status of each intermediate forwarding device, including whether the device is online, whether the cache is sufficient, and whether the processing capacity is normal. If an intermediate forwarding device becomes unavailable, the communication system will replan the routing path.
[0064] S305. Obtain the cache queue of the intermediate forwarding device;
[0065] Specifically, first, the communication system obtains the buffer queue of each intermediate forwarding device. The buffer queue refers to the memory space in the device used to temporarily store data packets to be processed. The communication system reads detailed information such as the total capacity, used space, and free space of the buffer queue. Simultaneously, the communication system also obtains the real-time processing status of the buffer queue, including parameters such as packet enqueue rate, dequeue rate, and average waiting time. If the buffer queue of a certain intermediate forwarding device cannot be obtained, the communication system will mark that intermediate forwarding device as a potentially risky node.
[0066] S306. If the occupancy rate of the cache queue exceeds the preset occupancy rate threshold, a congestion notification frame is sent to the requesting device.
[0067] Among them, the occupancy rate refers to the ratio of the used cache space to the total cache space; the preset occupancy rate threshold is a predefined maximum allowed occupancy ratio; and the congestion notification frame is a special data frame used to warn of network congestion.
[0068] Specifically, first, the communication system calculates the occupancy rate of the buffer queue for each intermediate forwarding device, which is the used space divided by the total space. Then, the communication system compares the calculated occupancy rate with a preset occupancy rate threshold. If the occupancy rate of an intermediate forwarding device exceeds the preset occupancy rate threshold, the communication system immediately constructs a congestion notification frame, which contains information such as the address of the congested device, its current occupancy rate, and suggested flow control parameters.
[0069] S307. Send the first data frame to the intermediate forwarding device through the first serial port of the requesting device; forward the first data frame sequentially through the first serial port of the intermediate forwarding device until the first data frame is sent to the responding device;
[0070] Specifically, the communication system sends the first data frame to the first intermediate forwarding device through the first serial port of the requesting device. For each intermediate forwarding device, the communication system verifies the integrity of the data it receives, and then continues to forward it to the next intermediate forwarding device through its first serial port, until the first data frame finally reaches the responding device.
[0071] S308. If there is no intermediate forwarding device between the requesting device and the responding device, the first data frame is sent to the responding device through the first serial port of the requesting device.
[0072] Specifically, first, the communication system verifies the physical connection status between the requesting device and the responding device, confirming that there are no intermediate forwarding devices. The absence of intermediate forwarding devices means that the requesting device and the responding device are directly connected. Then, the communication system checks the operating status of the requesting device's first serial port, including whether parameters such as communication rate and data format match those of the responding device. Finally, the communication system directly writes the first data frame into the requesting device's transmit buffer and sends it to the responding device through the first serial port.
[0073] S309. Obtain the second data frame of the responding device, the second data frame including a second source address and a second destination address, the second source address being used to represent the address where the responding device sends data, and the second destination address being used to represent the address where the requesting device receives data;
[0074] For details, please refer to step S204, which will not be repeated here.
[0075] S310. The second data frame is sent to the requesting device step by step through the second serial port, which is used to forward data packets whose device address is greater than its own address.
[0076] For details, please refer to step S205, which will not be repeated here.
[0077] S311. If the first source address is less than the first destination address, the first data frame is sent to the response device step by step through the second serial port.
[0078] The specific implementation principle is the same as step S203, and will not be repeated here.
[0079] S312. Obtain the second data frame of the responding device. The second data frame includes a second source address and a second destination address. The second source address is used to represent the address where the responding device sends data, and the second destination address is used to represent the address where the requesting device receives data.
[0080] The specific implementation principle is the same as step S204, and will not be repeated here.
[0081] S313. The second data frame is sent to the requesting device step by step through the first serial port;
[0082] The specific implementation principle is the same as step S205, and will not be repeated here.
[0083] S314. Obtain the forwarding timestamp of each forwarding device; based on the forwarding timestamp, calculate the transmission delay between the adjacent first forwarding device and the adjacent second forwarding device; if the transmission delay exceeds a preset delay threshold, mark the adjacent second forwarding device as an abnormal device.
[0084] Here, forwarding timestamp refers to the specific time when a data frame passes through each intermediate forwarding device; transmission delay refers to the time required for a data frame to be transmitted from one device to the next; adjacent first forwarding device refers to the preceding device in the transmission path; adjacent second forwarding device refers to the following device in the transmission path; preset delay threshold refers to the maximum allowable transmission delay time; abnormal device refers to a device whose transmission performance does not meet the requirements.
[0085] Specifically, first, the communication system collects timestamp information of data frame processing from each intermediate forwarding device, including the reception time and transmission time. Then, the communication system calculates the transmission delay between adjacent forwarding devices sequentially by subtracting the transmission time of the preceding device from the reception time of the subsequent device. The communication system compares the calculated transmission delay with a preset delay threshold. If the transmission delay exceeds the preset threshold, it indicates a bottleneck in the transmission path. The communication system then marks the receiving device as an abnormal device and records the specific delay data and possible causes.
[0086] S315. Record the data transmission information between the requesting device and the responding device. The data transmission information includes the data transmission start time, data transmission end time, total amount of data transmitted, and average transmission rate. Based on the data transmission information, generate a data transmission quality assessment report. The data transmission quality assessment report includes the transmission success rate, end-to-end transmission delay, and data packet loss rate.
[0087] Among them, data transmission information refers to the statistical data of the complete communication process; data transmission start time refers to the moment when the first data packet is sent; data transmission end time refers to the moment when the last data packet is received; total data transmission volume refers to the number of bytes of all sent data; average transmission rate refers to the amount of data transmitted per unit time; transmission quality assessment report refers to a comprehensive analysis of communication performance; transmission success rate is used to indicate the proportion of data packets that are successfully transmitted; end-to-end transmission delay refers to the total time it takes for data to travel from the source to the destination; and data packet loss rate is used to indicate the proportion of data packets lost during transmission.
[0088] Specifically, firstly, the communication system organizes and records basic data transmission information, including precise start and end timestamps and the cumulative number of bytes transmitted. The communication system calculates the average transmission rate by dividing the total data volume by the transmission time. Then, the communication system generates a data transmission quality assessment report: it calculates the transmission success rate by calculating the ratio of successfully transmitted packets to the total number of packets sent. Simultaneously, it analyzes the start and end timestamps to obtain the total end-to-end latency and records the number of packet losses detected during transmission, calculating the packet loss rate.
[0089] The communication system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 4 This is a schematic diagram of the physical device structure of a communication system in an embodiment of this application.
[0090] It should be noted that, Figure 4 The structure of the communication system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0091] like Figure 4As shown, the communication system includes a Central Processing Unit (CPU) 401, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 402 or programs loaded from storage section 408 into Random Access Memory (RAM) 403, such as performing the methods described in the above embodiments. The RAM 403 also stores various programs and data required for system operation. The CPU 401, ROM 402, and RAM 403 are interconnected via a bus 404. An Input / Output (I / O) interface 405 is also connected to the bus 404.
[0092] The following components are connected to I / O interface 405: input section 406 including audio input devices, push-button switches, etc.; output section 407 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 408 including a hard disk, etc.; and communication section 409 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 409 performs communication processing via a network such as the Internet. Drive 410 is also connected to I / O interface 405 as needed. Removable media 411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 410 as needed so that computer programs read from them can be installed into storage section 408 as needed.
[0093] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 409, and / or installed from removable medium 411. When the computer program is executed by central processing unit (CPU) 401, it performs the various functions defined in the present invention.
[0094] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0095] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.
[0096] Specifically, the communication system in this embodiment includes a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, it implements the communication method provided in the above embodiment.
[0097] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the communication system described in the above embodiments; or it may exist independently and not assembled into the communication system. The storage medium carries one or more computer programs that, when executed by a processor of the communication system, cause the communication system to implement the communication method provided in the above embodiments.
[0098] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0099] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".
[0100] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A communication method, characterized in that, This method, applied to a communication system comprising several devices connected in series according to their own address values, includes: acquiring a first data frame from a requesting device, the first data frame including a first source address and a first destination address, the first source address representing the address where the requesting device sends data and the first destination address representing the address where a responding device receives data; determining the size of the first source address and the first destination address; if the first source address is greater than the first destination address, then transmitting the first data frame to the responding device cascadingly via a first serial port, the first serial port being used to forward data packets whose device address is smaller than its own address; acquiring a second data frame from the responding device, the second data frame including a second source address and a second destination address, the second source address representing the address where the responding device sends data and the second destination address representing the address where the requesting device receives data; transmitting the second data frame to the requesting device cascadingly via a second serial port, the second serial port being used to forward data packets whose device address is larger than its own address; If the first source address is greater than the first destination address, the first data frame is sent to the response device step by step through the first serial port. Specifically, this includes: determining the routing path information of the first data frame based on the first source address and the first destination address, the routing path information including a sequence of device addresses from the requesting device to the response device; determining intermediate forwarding devices from the requesting device to the response device based on the device address sequence; sending the first data frame to the intermediate forwarding device through the first serial port of the requesting device; and sequentially forwarding the first data frame through the first serial port of the intermediate forwarding device until the first data frame is sent to the response device.
2. The method according to claim 1, characterized in that, After the step of determining the size of the first source address and the first target address, the method further includes: if the first source address is less than the first target address, then sending the first data frame to the response device step by step through the second serial port; obtaining the second data frame of the response device, the second data frame including a second source address and a second target address, the second source address being used to represent the address where the response device sends data, and the second target address being used to represent the address where the requesting device receives data; and sending the second data frame to the requesting device step by step through the first serial port.
3. The method according to claim 1, characterized in that, After determining the intermediate forwarding device from the requesting device to the responding device based on the device address sequence, the method further includes: if there is no intermediate forwarding device between the requesting device and the responding device, then sending the first data frame to the responding device through the first serial port of the requesting device.
4. The method according to claim 1, characterized in that, After the step of determining the intermediate forwarding device from the requesting device to the responding device based on the device address sequence, the method further includes: obtaining the cache queue of the intermediate forwarding device; if the occupancy rate of the cache queue exceeds a preset occupancy rate threshold, sending a congestion notification frame to the requesting device.
5. The method according to claim 1, characterized in that, After the step of sending the second data frame to the requesting device step by step through the second serial port, where the second serial port is used to forward data packets whose device address is greater than its own address, the method further includes: obtaining the forwarding timestamp of each forwarding device; calculating the transmission delay between the adjacent first forwarding device and the adjacent second forwarding device based on the forwarding timestamp; and marking the adjacent second forwarding device as an abnormal device if the transmission delay exceeds a preset delay threshold.
6. The method according to claim 1, characterized in that, After the step of sending the second data frame to the requesting device step by step through the second serial port, whereby the second serial port is used to forward data packets whose device address is greater than its own address, the method further includes: recording data transmission information between the requesting device and the responding device, the data transmission information including data transmission start time, data transmission end time, total amount of data transmitted, and average transmission rate; and generating a data transmission quality assessment report based on the data transmission information, the data transmission quality assessment report including transmission success rate, end-to-end transmission delay, and data packet loss rate.
7. A communication system, characterized in that, The communication system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors invoke the computer instructions to cause the communication system to perform the method as described in any one of claims 1 to 6.
8. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the communication system, the communication system performs the method as described in any one of claims 1 to 6.
9. A computer program product, characterized in that, When the computer program product is run on a communication system, it causes the communication system to perform the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Communication method and system of serial port network, storage medium and program product
CN120151410A