Communication method, communication system, storage medium and program product
By connecting devices in series by address size in the communication system, and adopting directional forwarding and step-by-step forwarding mechanisms, the bottleneck problems in the centralized communication architecture are solved, communication efficiency and reliability are improved, forwarding logic is simplified, and network performance is monitored.
Patent Information
- Application Number
- CN202510498374.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-04-21
AI Technical Summary
Centralized communication architectures are prone to form communication bottlenecks when the number of devices increases, and the data processing load of the central controller increases sharply, resulting in a high risk of single point failure and low communication efficiency.
In the communication system, devices are connected in series according to the size of their own address. Through the first serial port, data packets whose device address is smaller than their own address are forwarded through the second serial port, data packets whose device address is larger than their own address are forwarded through the second serial port. Directed forwarding mechanism is adopted to introduce routing path information and device address sequences, forward step by step and monitor cache queues and transmission delays.
It avoids bottleneck problems in traditional centralized architectures, reduces the risk of single point of failure, improves communication efficiency and reliability, simplifies forwarding logic, reduces invalid forwarding and network congestion, and realizes accurate data forwarding path planning and network performance monitoring.
Smart Images

Figure CN120281823A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a communication method, a communication system, a storage medium, and a program product. Background Art
[0002] With the rapid development of communication technologies, the demand for data interaction between various devices in a communication system is increasing day by day. In application scenarios such as industrial control and the Internet of Things, real-time data exchange and information sharing are often required between multiple devices to achieve collaborative control and linkage operations.
[0003] Currently, the device communication method adopts a centralized communication architecture, that is, a central controller is used to uniformly manage and forward data between various devices. Specifically, all devices establish communication connections with the central controller. When a certain device needs to perform data interaction with other devices, it first sends a data packet to the central controller, and then the central controller forwards the data packet to the corresponding 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, when the number of devices in the communication system increases, the data processing load of the central controller will increase sharply, easily forming a communication bottleneck. Summary of the Invention
[0005] This application provides a communication method, a communication system, a storage medium, and a program product for realizing the directional forwarding of data, reducing invalid forwarding, and improving communication efficiency.
[0006] In a first aspect, this application provides a communication method applied to a communication system. The communication system includes a number of devices, and the number of devices are connected in series in ascending order of their own addresses. The method includes: obtaining a first data frame of a requesting device, the first data frame including a first source address and a first destination address, the first source address being used to represent the address from which the requesting device sends data, and the first destination address being used to represent the address at which the responding device receives data; determining the magnitude relationship between the first source address and the first destination address; if the first source address is greater than the first destination address, sending the first data frame step by step to the responding device through a first serial port, the first serial port being used to forward data packets with device addresses smaller than its own address; obtaining a 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 from which the responding device sends data, and the second destination address being used to represent the address at which the requesting device receives data; sending the second data frame step by step to the requesting device through a second serial port, the second serial port being used to forward data packets with device addresses larger than its own address.
[0007] By adopting the above technical solution, several devices in the communication system are serially connected in sequence according to the size order of their own addresses. When the requesting device sends the first data frame, the communication system selects different serial ports to forward the first data frame according to the size relationship between the source address and the destination address. After the responding device receives the first data frame, it sends the second data frame, and the communication system selects different serial ports to forward the second data frame according to the size relationship between the source address and the destination address. This method avoids the bottleneck problem that all data needs to be forwarded through the central controller in the traditional centralized architecture, and significantly reduces the risk of single point of failure. At the same time, by forwarding the data packets with device addresses smaller than its own address through the first serial port and forwarding the data packets with device addresses larger than its own address through the second serial port, the directional forwarding of data is realized, the invalid forwarding is reduced, and the communication efficiency is improved.
[0008] Combined 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, sending the first data frame to the responding device step by step through the second serial port; obtaining 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 of the responding device sending data, and the second destination address is used to represent the address of the requesting device receiving data; 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 two-way communication mechanism is formed with the forwarding scheme when the source address is greater than the destination address, ensuring that no matter what the size relationship between the source address and the destination address is, the data can find the correct forwarding path. At the same time, since different serial ports are used for forwarding when the data goes and returns, the problem of data packets circulating and forwarding in the network is effectively avoided, the reliability of communication is improved, and the possibility of network congestion is reduced.
[0010] Combined with some embodiments of the first aspect, in some embodiments, if the first source address is greater than the first destination address, sending the first data frame to the responding device step by step through the first serial port specifically includes: based on the first source address and the first destination address, determining the routing path information of the first data frame, the routing path information includes the device address sequence from the requesting device to the responding device; according to the device address sequence, determining the intermediate forwarding device from the requesting device to the responding device; sending the first data frame from the requesting device to the intermediate forwarding device through the first serial port of the requesting device; 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 responding device.
[0011] By adopting the above technical solution, the routing path information and the device address sequence are introduced, realizing the precise planning of the data forwarding path, making the forwarding of the first data frame more controllable, and avoiding the resource waste caused by blind forwarding. At the same time, through the step-by-step forwarding mechanism, each intermediate forwarding device only needs to pay attention to the next-hop device directly connected to itself, simplifying the forwarding logic and improving the maintainability of the communication system.
[0012] Combined 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 according to the device address sequence, the method further includes: if there is no intermediate forwarding device between the requesting device and the responding device, sending the first data frame to the responding device through the first serial port of the requesting device.
[0013] By adopting the above technical solution, it is judged whether there is an intermediate forwarding device between the requesting device and the responding device, and the communication system thus determines whether to directly forward or indirectly forward the first data frame. When 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 the communication delay and network load and improving the communication efficiency.
[0014] Combined 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 for packets with a forwarding device address larger than its own address, the method further includes: obtaining the cache queue of each 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.
[0015] By adopting the above technical solution, the communication system monitors the occupancy of the cache queue of the intermediate forwarding device and sets an early warning mechanism, so as to be able to detect and prevent network congestion problems in a timely manner. This active congestion control mechanism not only protects the forwarding device from cache overflow, but also maintains the stable operation of the entire network.
[0016] Combined 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 for packets with a forwarding device address larger than its own address, the method further includes: obtaining the forwarding timestamp of each forwarding device; based on the forwarding timestamp, calculating the transmission delay between the adjacent first forwarding device and the adjacent second forwarding device; if the transmission delay exceeds a preset delay threshold, marking the adjacent second forwarding device as an abnormal device.
[0017] By adopting the above technical solution, the communication system records and analyzes the forwarding timestamps of each forwarding device to establish a complete transmission delay monitoring mechanism, that is, calculates the transmission delay between adjacent forwarding devices and compares it with a preset delay threshold, so as to quickly identify abnormal devices, accurately locate problem nodes in the network, and provide accurate guidance for network maintenance and troubleshooting.
[0018] Combined with some embodiments of the first aspect, in some embodiments, after the step of sequentially sending the second data frame to the requesting device through the second serial port, where the second serial port is used for data packets with a forwarding device address larger than its own address, the method further includes: recording the data transmission information between the requesting device and the responding device, where the data transmission information includes the data transmission start time, the data transmission end time, the total amount of transmitted data, and the average transmission rate; generating a data transmission quality evaluation report based on the data transmission information, where the data transmission quality evaluation report includes the transmission success rate, the end-to-end transmission delay, and the data packet loss rate.
[0019] By adopting the above technical solution, the communication system comprehensively records data transmission information and generates a data transmission quality evaluation report, realizing a complete network performance monitoring and evaluation mechanism, which can not only help administrators understand the real-time operation status of the network, but also provide a decision-making basis for network optimization and upgrade.
[0020] In a second aspect, an embodiment of the present application provides a communication system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the communication system to execute the method described in the first aspect and any possible implementation manner in the first aspect.
[0021] In a third aspect, an embodiment of the present application provides a computer program product containing instructions, when the above computer program product runs on a communication system, enabling the above communication system to execute the method described in the first aspect and any possible implementation manner in the first aspect.
[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions, when the above instructions run on a communication system, enabling the above communication system to execute the method described in the first aspect and any possible implementation manner in the first aspect.
[0023] It can be understood that the communication system provided in the second aspect above, 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 method provided in the embodiments of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, and will not be elaborated here.
[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. By adopting the above technical solution, several devices in the communication system are connected in series in the order of the size of their own addresses. When the requesting device sends the first data frame, the communication system selects different serial ports to forward the first data frame according to the size relationship between the source address and the target address. After receiving the first data frame, the responding device sends the second data frame, and the communication system selects different serial ports to forward the second data frame according to the size relationship between the source address and the target address. This method avoids the bottleneck problem that all data needs to be forwarded by the central controller in the traditional centralized architecture, significantly reducing the risk of single-point failure. At the same time, by forwarding the data packets with device addresses smaller than its own address through the first serial port and forwarding the data packets with device addresses larger than its own address through the second serial port, the directional forwarding of data is realized, reducing the ineffective forwarding and improving the communication efficiency.
[0025] 2. By adopting the above technical solution, a complete two-way communication mechanism is formed with the forwarding scheme when the source address is greater than the target address, ensuring that no matter what the size relationship between the source address and the target address is, the data can find the correct forwarding path. At the same time, since different serial ports are used for forwarding when the data is going and coming back, the problem of data packets circulating and forwarding in the network is effectively avoided, improving the reliability of communication and reducing the possibility of network congestion.
[0026] 3. By adopting the above technical solution, the routing path information and the device address sequence are introduced, realizing the precise planning of the data forwarding path, making the forwarding of the first data frame more controllable and avoiding the resource waste caused by blind forwarding. At the same time, through the step-by-step forwarding mechanism, each intermediate forwarding device only needs to pay attention to the next-hop device directly connected to itself, simplifying the forwarding logic and improving the maintainability of the communication system. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a schematic diagram of the connection of a device in the communication system according to an embodiment of the present application; Figure 2 is a schematic flowchart of a communication method according to an embodiment of the present application; Figure 3 is another schematic flowchart of a communication method according to an embodiment of the present application; Figure 4 is a schematic structural diagram of an entity device in the communication system according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] The terms used in the following embodiments of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. As used in the specification of this application, the singular forms "a", "an", "the above", "the", and "this" are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in this application refers to any or all possible combinations including one or more of the listed items.
[0029] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and should not be construed as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of this application, unless otherwise specified, the meaning of "a plurality" is two or more.
[0030] The following introduces the schematic diagram of device connections in the communication system of the embodiments of this application. Please refer to Figure 1 .
[0031] The communication system includes multiple devices, and each device is assigned a unique address number (ranging from 0001 to 000n). All devices are connected in series in ascending order of their own addresses, and a complete communication loop is formed through TX (transmission) and RX (reception) signal lines.
[0032] The following describes the process of the method provided in this embodiment. Please refer to Figure 2 , which is a schematic diagram of a process of the communication method in the embodiments of this application.
[0033] S201. Obtain the first data frame of 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 from which the requesting device sends data, and the first destination address is used to represent the address at which the responding device receives data; Among them, the requesting device refers to the device that actively initiates a data communication request in the communication system; the data frame is used to represent the data packet unit transmitted in serial communication and contains control information and data content. For example, the format is <source address, destination address, data length, data, check value>; 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 identification address of the device sending data in the network; the destination address refers to the unique identification 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; the responding device refers to the device that receives the first data frame and needs to return a response.
[0034] Specifically, first, the communication system detects the validity of the data communication request. Then, the communication system reads the complete first data frame from the sending buffer of the requesting device. 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 the first destination address contained in the first data frame. These address information will be used for subsequent routing decisions. If the format of the first data frame is incorrect or the address information is invalid, the communication system will request the requesting device to resend the first data frame.
[0035] S202. Determine the size relationship between the first source address and the first destination address; Among them, determination refers to determining the size relationship through comparison operations; size refers to the relative size between the first source address and the first destination address.
[0036] Specifically, the communication system makes a numerical comparison between the first source address and the first destination address parsed from the first data frame. Since the devices in the communication system are connected in series in the order of their own address sizes, 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.
[0037] S203. If the first source address is greater than the first destination address, send the first data frame to the responding device step by step through the first serial port. The first serial port is used to forward data packets whose device addresses are smaller than its own address; Among them, the first serial port is used to forward data packets whose device addresses are smaller than its own address; step - by - step sending is used to indicate that the first data frame passes through the intermediate forwarding devices in turn according to the preset first forwarding order until it is sent to the responding device. Figure 1 For example, assume that 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, and the first destination address refers to the address 0005 of the responding device. Device 1 sends the first data frame, which passes through the intermediate forwarding devices: device 2, device 3, and device 4, and finally is sent to device 5; the own address refers to the address of each device itself.
[0038] Specifically, first, the communication system determines the complete forwarding path from the requesting device to the responding device, including all intermediate forwarding devices that need to be passed through. Then, the communication system starts the data forwarding process through the first serial port of the requesting device. After each intermediate forwarding device receives the first data frame, it verifies its integrity and continues to forward 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.
[0039] S204, obtaining a second data frame of the answering device, the second data frame including a second source address and a second target address, the second source address is used to indicate an address of the answering device to send data, and the second target address is used to indicate an address of the requesting device to receive data; Among them, the answering 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 answering data frame that the answering device replies to the requesting device; the second source address is used to indicate the address where the answering device sends data; and the second target address is used to indicate the address where the requesting device receives data.
[0040] Specifically, first, the communication system detects whether the answering device has generated response data, and then the communication system reads the complete second data frame from the sending buffer of the answering device. The communication system will verify the format of the second data frame to ensure that it complies with the communication protocol specification. During the verification process, the communication system will focus on checking whether the second source address and the second target address in the second data frame are correct, that is, the second source address should be the first target address in the original first data frame, and the second target address should be the first source address in the original first data frame. If it is found that the address information does not match, the communication system requires the answering device to regenerate the second data frame. At the same time, the communication system will also verify the integrity and validity of the second data frame to ensure the reliability of data transmission.
[0041] S205 , 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 larger than its own address.
[0042] The second serial port is used to forward data packets whose device addresses are larger than its own address; sending step by step is used to indicate that the second data frame passes through the intermediate forwarding devices in sequence according to the preset second forwarding order until it is sent to the requesting device; following the example of step S203, Figure 1 For example, at this time, device 5 sends the second data frame, which passes through the intermediate forwarding devices: device 4, device 3 and device 2, and is finally sent to device 1.
[0043] Specifically, first, the communication system determines the complete return path from the answering device to the requesting device based on the network topology and address distribution. Since the second data frame needs to be sent from the answering device with a smaller address to the requesting device with a larger address, the communication system chooses to use the second serial port for data forwarding. After each intermediate forwarding device receives the second data frame, it will perform a data integrity check and determine whether to continue forwarding or process it as the final recipient by comparing the address.
[0044] By adopting the above technical solution, several devices in the communication system are connected in series in the order of the size of their own addresses. When the requesting device sends the first data frame, the communication system selects different serial ports to forward the first data frame according to the size relationship between the source address and the destination address. After the responding device receives the first data frame, it sends the second data frame, and the communication system selects different serial ports to forward the second data frame according to the size relationship between the source address and the destination address. This method avoids the bottleneck problem that all data needs to be forwarded through the central controller in the traditional centralized architecture, and significantly reduces the risk of single-point failure. At the same time, by forwarding the data packets with device addresses smaller than its own address through the first serial port and forwarding the data packets with device addresses larger than its own address through the second serial port, directional forwarding of data is achieved, reducing ineffective forwarding and improving communication efficiency.
[0045] The following further describes the more specific process of the method provided in this embodiment. Please refer to Figure 3 , which is another process schematic diagram of the communication method in the embodiment of the present application.
[0046] S301. Obtain the first data frame of the requesting device, where the first data frame includes a first source address and a first destination address. The first source address is used to represent the address from which the requesting device sends data, and the first destination address is used to represent the address at which the responding device receives data; Specifically, refer to step S201, which will not be elaborated here.
[0047] S302. Determine the size of the first source address and the first destination address; Specifically, refer to step S202, which will not be elaborated here.
[0048] S303. If the first source address is greater than the first destination address, based on the first source address and the first destination address, determine the routing path information of the first data frame. The routing path information includes the device address sequence from the requesting device to the responding device; Among them, the routing path information refers to the complete transmission path that the first data frame needs to pass through 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.
[0049] Specifically, first, the communication system obtains the address information and connection relationships of all devices in the network and constructs a complete network topology diagram. Then, the communication system performs path search in the network topology diagram based on the first source address and the first destination address, and determines the routing path information according to the serial connection order and address size relationship of the devices. For an example, refer to step S203. The determined routing path information will be converted into a device address sequence arranged in the actual transmission order for subsequent data forwarding. If it is found that an effective transmission path cannot be established, the communication system will return an error message.
[0050] S304. Determine the intermediate forwarding devices from the requesting device to the responding device according to the device address sequence; Among them, the intermediate forwarding devices refer to all devices participating in data forwarding between the requesting device and the responding device. Continuing with the example in step S203, the intermediate forwarding devices are devices 2, 3, and 4. Continuing with the example in step S205, the intermediate forwarding devices are devices 4, 3, and 2.
[0051] Specifically, first, the communication system removes the first source address and the first destination address from the device address sequence, and the remaining addresses are the address set of the intermediate forwarding devices. The communication system will verify 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, etc. If a certain intermediate forwarding device is unavailable, the communication system will re-plan the routing path.
[0052] S305. Obtain the cache queue of the intermediate forwarding device; Specifically, first, the communication system obtains the cache queue of each intermediate forwarding device. The cache queue refers to the memory space in the device used to temporarily store packets to be processed. The communication system will read detailed information such as the total capacity, used space, and free space of the cache queue. At the same time, the communication system will also obtain the real-time processing status of the cache queue, including parameters such as the packet enqueue rate, dequeue rate, and average waiting time. If the cache queue of a certain intermediate forwarding device cannot be obtained, the communication system will mark this intermediate forwarding device as a potential risk node.
[0053] S306. If the occupancy rate of the cache queue exceeds the preset occupancy rate threshold, send a congestion notification frame to the requesting device; 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 the predefined maximum allowable occupancy ratio; the congestion notification frame is a special data frame used to warn of the network congestion status.
[0054] Specifically, first, the communication system calculates the occupancy rate of the cache queue of each intermediate forwarding device, that is, the used space divided by the total space. Then, the communication system compares the calculated occupancy rate with the preset occupancy rate threshold. If the occupancy rate of a certain intermediate forwarding device exceeds the preset occupancy rate threshold, the communication system will immediately construct a congestion notification frame, which contains information such as the address of the congested device, the current occupancy rate, and the recommended traffic control parameters.
[0055] 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 through the first serial port of the intermediate forwarding device in sequence until the first data frame is sent to the responding device; 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 received data 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.
[0056] S308. If there is no intermediate forwarding device between the requesting device and the responding device, send the first data frame to the responding device through the first serial port of the requesting device; Specifically, first, the communication system verifies the physical connection status between the requesting device and the responding device to confirm that there is no intermediate forwarding device. Here, no intermediate forwarding device means that the requesting device and the responding device are directly connected. Then, the communication system checks the working status of the first serial port of the requesting device, including whether parameters such as communication rate and data format match those of the responding device. The communication system directly writes the first data frame into the sending buffer of the requesting device and sends it to the responding device through the first serial port.
[0057] S309. 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 from which the responding device sends data, and the second destination address is used to represent the address at which the requesting device receives data; Specifically, refer to step S204, which will not be elaborated here.
[0058] S310. Send the second data frame to the requesting device step by step through the second serial port. The second serial port is used to forward data packets whose device address is larger than its own address; Specifically, refer to step S205, which will not be elaborated here.
[0059] S311. If the first source address is less than the first destination address, send the first data frame to the responding device step by step through the second serial port; The specific implementation principle is the same as that in step S203, which will not be elaborated here.
[0060] 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 from which the responding device sends data, and the second destination address is used to represent the address at which the requesting device receives data; The specific implementation principle is the same as that in step S204, which will not be elaborated here.
[0061] S313. Send the second data frame to the requesting device step by step through the first serial port; The specific implementation principle is the same as that in step S205, which will not be elaborated here.
[0062] S314. Obtain the forwarding timestamps of each forwarding device; based on the forwarding timestamps, calculate the transmission delay between an adjacent first forwarding device and an adjacent second forwarding device; if the transmission delay exceeds a preset delay threshold, then mark the adjacent second forwarding device as an abnormal device; Among them, the forwarding timestamp refers to the specific moment when the data frame passes through each intermediate forwarding device; the transmission delay refers to the time required for the data frame to be transmitted from one device to the next device; the adjacent first forwarding device refers to the previous device in the transmission path; the adjacent second forwarding device refers to the next device in the transmission path; the preset delay threshold refers to the maximum allowable transmission delay time; the abnormal device refers to a device whose transmission performance does not meet the requirements.
[0063] Specifically, first, the communication system collects the timestamp information of data frame processing from each intermediate forwarding device, including the reception time and the transmission time. Then, the communication system calculates the transmission delay between adjacent forwarding devices in sequence by subtracting the transmission time of the previous device from the reception time of the next device. The communication system compares the calculated transmission delay with the preset delay threshold. If the transmission delay exceeds the preset delay threshold, it means that there is a transmission bottleneck in the transmission path. The communication system will mark the receiving device as an abnormal device and record the specific delay data and possible reasons.
[0064] S315. Record the data transmission information between the requesting device and the responding device. The data transmission information includes the data transmission start time, the data transmission end time, the total amount of transmitted data, and the average transmission rate; based on the data transmission information, generate a data transmission quality evaluation report, which includes the transmission success rate, the end-to-end transmission delay, and the data packet loss rate.
[0065] Among them, the data transmission information refers to the statistical data of the complete communication process; the data transmission start time refers to the moment when the first data packet is transmitted; the data transmission end time refers to the moment when the last data packet is received; the total amount of transmitted data refers to the number of bytes of all transmitted data; the average transmission rate refers to the amount of data transmitted per unit time; the data transmission quality evaluation report refers to the comprehensive analysis of the communication performance; the transmission success rate is used to represent the proportion of successfully transmitted data packets; the end-to-end transmission delay refers to the total time taken for the data to travel from the source to the destination; the data packet loss rate is used to represent the proportion of data packets lost during the transmission process.
[0066] Specifically, preferably, the communication system collates and records basic data transmission information, including accurate start and end timestamps, and the cumulative number of data bytes transmitted. The communication system calculates the average transmission rate by dividing the total data volume by the transmission time. Then, the communication system starts to generate a data transmission quality assessment report: it calculates the ratio of the number of successfully transmitted data packets to the total number of transmitted packets to obtain the transmission success rate. At the same time, it analyzes the start and end timestamps to obtain the total end-to-end delay time, records the number of lost packets detected during the transmission process, and calculates the packet loss rate.
[0067] The following describes the communication system in the embodiment of the present invention application from the perspective of hardware processing. Please refer to Figure 4 , which is a schematic structural diagram of an entity device of the communication system in the embodiment of the present application.
[0068] It should be noted that Figure 4 the structure of the communication system shown is only an example and should not bring any limitations to the functions and usage scope of the embodiments of the present invention.
[0069] As Figure 4 shown, the communication system includes a Central Processing Unit (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the Read-Only Memory (ROM) 402 or the program loaded from the storage section 408 into the Random Access Memory (RAM) 403, such as executing the method described in the above embodiments. In the RAM 403, various programs and data required for system operation are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An Input / Output (I / O) interface 405 is also connected to the bus 404.
[0070] The following components are connected to the I / O interface 405: an input section 406 including an audio input device, a button switch, etc.; an output section 407 including a Liquid Crystal Display (LCD), an audio output device, an indicator light, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed so that the computer program read from it can be installed into the storage section 408 as needed.
[0071] Specifically, according to an embodiment of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, various functions defined in the present invention are executed.
[0072] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections with 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 fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0073] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above module, program segment, or part of code includes one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings.
[0074] Specifically, the communication system of this embodiment includes a processor and a memory, and a computer program is stored on the memory. When the computer program is executed by the processor, the communication method provided in the above embodiment is implemented.
[0075] As 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 may exist alone without being assembled into the communication system. The above storage medium carries one or more computer programs, and when the one or more computer programs are executed by a processor of the communication system, the communication system implements the communication method provided in the above embodiments.
[0076] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present application.
[0077] As used in the above embodiments, depending on the context, the term "when..." can be interpreted to mean "if...", or "after...", or "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if detecting (the stated condition or event)" can be interpreted to mean "if determining...", or "in response to determining...", or "when detecting (the stated condition or event)", or "in response to detecting (the stated condition or event)".
[0078] Those of ordinary skill in the art can understand all or part of the processes in the above method embodiments. These processes can be completed by relevant hardware instructed by a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The foregoing storage medium includes: various media such as ROM or random access memory RAM, magnetic disk, or optical disc that can store program codes.
Claims
1. A communication method, characterized in that, Applied to a communication system, the communication system includes a number of devices, and the number of devices are serially connected in turn according to the order of the sizes of their own addresses. The method includes: Obtain a first data frame of a 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 from which the requesting device sends data, and the first destination address is used to represent the address at which the responding device receives data; Judge the sizes of the first source address and the first destination address; If the first source address is greater than the first destination address, send the first data frame to the responding device step by step through a first serial port. The first serial port is used to forward data packets with device addresses smaller than its own address; Obtain a 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 from which the responding device sends data, and the second destination address is used to represent the address at which the requesting device receives data; Send the second data frame to the requesting device step by step through a second serial port. The second serial port is used to forward data packets with device addresses larger than its own address.
2. The method according to claim 1, wherein After the step of judging the sizes 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, send the first data frame to the responding device step by step through the second serial port; Obtain a 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 from which the responding device sends data, and the second destination address is used to represent the address at which the requesting device receives data; Send the second data frame to the requesting device step by step through the first serial port.
3. The method according to claim 1, wherein The step of if the first source address is greater than the first destination address, then send the first data frame to the responding device step by step through a first serial port specifically includes: Based on the first source address and the first destination address, determine the routing path information of the first data frame. The routing path information includes the device address sequence from the requesting device to the responding device; According to the device address sequence, determine the intermediate forwarding device from the requesting device to the responding device; Send the first data frame from the requesting device to the intermediate forwarding device through the first serial port of the requesting device; Forward the first data frame through the first serial port of the intermediate forwarding device in turn until the first data frame is sent to the responding device.
4. The method according to claim 3, wherein After the step of according to the device address sequence, determine the intermediate forwarding device from the requesting device to the responding device, the method further includes: If there is no intermediate forwarding device between the requesting device and the responding device, send the first data frame from the requesting device to the responding device through the first serial port of the requesting device.
5. The method according to claim 3, wherein After the step of according to the device address sequence, determine the intermediate forwarding device from the requesting device to the responding device, the method further includes: Obtain the cache queue of the intermediate forwarding device; If the occupancy rate of the cache queue exceeds a preset occupancy rate threshold, a congestion notification frame is sent to the requesting device.
6. The method according to claim 1, characterized in that, After the step of successively sending the second data frame to the requesting device through the second serial port, where the second serial port is used to forward data packets with a device address larger than its own address, the method further includes: Obtain the forwarding timestamps of each forwarding device; Based on the forwarding timestamps, calculate the transmission delay between an adjacent first forwarding device and an adjacent second forwarding device; If the transmission delay exceeds a preset delay threshold, mark the adjacent second forwarding device as an abnormal device.
7. The method according to claim 1, wherein After the step of successively sending the second data frame to the requesting device through the second serial port, where the second serial port is used to forward data packets with a device address larger than its own address, the method further includes: Record the data transmission information between the requesting device and the responding device, where the data transmission information includes the data transmission start time, data transmission end time, total amount of transmitted data, and average transmission rate; Based on the data transmission information, generate a data transmission quality assessment report, where the data transmission quality assessment report includes the transmission success rate, end-to-end transmission delay, and data packet loss rate.
8. 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, and the memory is used to store computer program code, where the computer program code includes computer instructions, and the one or more processors call the computer instructions to cause the communication system to execute the method according to any one of claims 1-7.
9. A computer-readable storage medium, comprising instructions, characterized in that, When the instruction runs on the communication system, it causes the communication system to execute the method according to any one of claims 1-7.
10. A computer program product, characterized in that, When the computer program product runs on the communication system, it causes the communication system to execute the method according to any one of claims 1-7.
Citation Information
Patent Citations
Serial bus memory, serial bus transmission system and method
CN102609376A
Address allocation method for serial port communication equipment, communication device and storage medium
CN112905508A
Bidirectional address allocation method and system
CN117560352A
Communication method and system of serial port network, storage medium and program product
CN120151410A
Single wire serial communication method and single wire serial communication system
US20240333677A1