Distributed IO backplane bus protocol implementation method and device based on double-link architecture
The distributed I/O backplane bus protocol with dual-link architecture solves the problems of bandwidth bottleneck and single point of failure in existing technologies, and realizes efficient and reliable data transmission and fault self-healing and fault tolerance, which is suitable for high-density industrial applications.
Patent Information
- Application Number
- CN202511239218.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-12-19
AI Technical Summary
Existing distributed input/output backplane bus protocols suffer from bandwidth bottlenecks, communication delays, single-point failure risks, complex configurations, and delayed fault detection in high-density field applications, making it difficult to meet the demands of modern industry for high bandwidth, low latency, and high reliability.
It adopts a dual-link architecture, with the data link being a differential full-duplex link and the control link being a cascaded unidirectional link. Parallel data transmission and fault self-healing are achieved through address and device discovery, frame structure and packet division rules, periodic communication control and non-periodic communication scheduling.
It achieves high-bandwidth, low-latency data transmission, self-healing fault tolerance for link failures, parallel collaboration of periodic and non-periodic services, simplifies configuration and maintenance, and is suitable for efficient and reliable industrial application scenarios.
Smart Images

Figure CN121173618A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of industrial automation and control systems, and in particular to a distributed IO backplane bus protocol implementation method and device based on a dual-link architecture. BACKGROUND
[0002] Under the promotion of Industry 4.0 and intelligent manufacturing, modular distributed input and output systems have become the core components of programmable controllers, robots and process control devices. The backplane bus is responsible for the real-time data and control signal interaction between the coupler and each functional module, and its communication performance directly affects the response speed and reliability of the entire production line.
[0003] Existing distributed input and output backplanes mostly use single-link bus structures, such as half-duplex multi-point serial buses based on RS485, differential buses based on CAN or custom interfaces based on parallel backplanes. Some solutions expand the bandwidth by increasing the baud rate or adding relays, but the overall transmission of all periodic data, aperiodic data and control signaling still relies on a single physical channel. Address allocation mostly uses manual dialing or master broadcast writing table methods, and device scanning and fault diagnosis are usually completed offline by the host computer tool during maintenance.
[0004] The above traditional solutions have exposed multiple deficiencies in large-scale, high-density field applications: first, data and control multiplexing on a single link can cause bus conflicts, leading to bandwidth bottlenecks and communication delays; second, the single-link structure has obvious single-point failure risks, and once the link is damaged, the entire row of modules will be offline; third, there is a lack of plug-and-play mechanism, and address configuration and module expansion require manual intervention, resulting in long downtime; fourth, periodic and aperiodic traffic cannot be managed hierarchically, and firmware upgrades or remote diagnostics often block periodic data, affecting production real-time performance; fifth, fault detection relies on master station timeout polling, and offline determination and recovery lag, making it difficult to meet the demand for millisecond-level rapid diagnosis. In summary, existing technologies have been unable to meet the requirements of modern industrial field for high bandwidth, low latency, high reliability and easy maintenance, and a new backplane bus protocol is needed to solve the above problems. SUMMARY
[0005] Therefore, the embodiments of the present application provide a distributed IO backplane bus protocol implementation method and device based on a dual-link architecture to solve the problems of bandwidth limitation and large delay, single-link failure risk, and periodic and aperiodic traffic mutual blocking in the prior art.
[0006] The first aspect of the embodiment of the application provides a distributed IO backplane bus protocol implementation method based on a dual-link architecture, comprising: establishing dual-link communication, which is used for establishing a data link and a control link in parallel on a backplane, wherein the data link is a differential full-duplex link, and the control link is a cascaded unidirectional link; performing address and device discovery, which is used for transmitting an address seed on the control link and forwarding it from station to station in a cascaded order, and a hit slave station writes a local station address and reports information containing a device identifier, a version, and an input / output length on the data link; defining a frame structure and a packeting rule, which is used for setting a function identifier, an address, a length, data, a check, and an end field for a service frame, and setting different function identifiers and packeting upper limits for periodic services and aperiodic services respectively; periodic communication control, which is used for a master station to issue output data frames in address order on the data link, and to send a token from station to station on the control link, so that a slave station that obtains the token transmits input data on the data link and forwards the token to a next slave station until polling is completed; aperiodic communication scheduling, which is used for a master station to send an aperiodic request to a target slave station on the data link in a periodic communication gap, and to complete response interaction in queue order, and a slave station that does not complete processing returns a short response to maintain order; and implementing a protocol application process, which is used for completing transmission of input data, output data, and management data in a distributed input / output backplane according to dual-link communication, address and device discovery, a frame structure and a packeting rule, periodic communication control, and aperiodic communication scheduling.
[0007] The second aspect of the embodiment of the application provides a distributed IO backplane bus protocol implementation device based on a dual-link architecture, comprising: a dual-link communication establishment module, which is used for establishing a data link and a control link in parallel on a backplane, wherein the data link is a differential full-duplex link, and the control link is a cascaded unidirectional link; an address and device discovery execution module, which is used for transmitting an address seed on the control link and forwarding it from station to station in a cascaded order, and a hit slave station writes a local station address and reports information containing a device identifier, a version, and an input / output length on the data link; a frame structure and packeting rule definition module, which is used for setting a function identifier, an address, a length, data, a check, and an end field for a service frame, and setting different function identifiers and packeting upper limits for periodic services and aperiodic services respectively; a periodic communication control module, which is used for a master station to issue output data frames in address order on the data link, and to send a token from station to station on the control link, so that a slave station that obtains the token transmits input data on the data link and forwards the token to a next slave station until polling is completed; an aperiodic communication scheduling module, which is used for a master station to send an aperiodic request to a target slave station on the data link in a periodic communication gap, and to complete response interaction in queue order, and a slave station that does not complete processing returns a short response to maintain order; and a protocol application process implementation module, which is used for completing transmission of input data, output data, and management data in a distributed input / output backplane according to dual-link communication, address and device discovery, a frame structure and a packeting rule, periodic communication control, and aperiodic communication scheduling.
[0008] In a third aspect, the present application provides a computer readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above method.
[0009] The above at least one technical scheme adopted by the embodiments of the present application can achieve the following beneficial effects:
[0010] By establishing a dual-link communication, a data link and a control link are established in parallel on a backplane, wherein the data link is a differential full-duplex link, and the control link is a cascaded unidirectional link; address and device discovery are performed to transmit an address seed on the control link and forward it from station to station in a cascaded order, a hit slave station writes the address of the current station and reports information containing a device identifier, a version, and an input / output length on the data link; frame structure and packeting rules are defined to set a function identifier, an address, a length, data, a check, and an end field for a service frame, and different function identifiers and packeting upper limits are set for periodic services and aperiodic services respectively; periodic communication control is performed to have a master station send output data frames in address order on a data link, and send a token from station to station on a control link, so that a slave station that obtains the token transmits input data on the data link and forwards the token to a next slave station until polling is completed; aperiodic communication scheduling is performed to have a master station send an aperiodic request to a target slave station on a data link in a periodic communication gap, and complete response interaction in queue order, and a slave station that does not complete processing returns a short response to maintain order; a protocol application process is implemented to complete transmission of input data, output data, and management data in a distributed input / output backplane according to dual-link communication, address and device discovery, frame structure and packeting rules, periodic communication control, and aperiodic communication scheduling. The present application can achieve high-bandwidth low-latency transmission, link fault self-healing fault tolerance, and parallel cooperation of periodic and aperiodic services. BRIEF DESCRIPTION OF DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort.
[0012] Figure 1 is a flowchart of a distributed IO backplane bus protocol implementation method based on a dual-link architecture provided by the embodiments of the present application;
[0013] Figure 2 is a structural diagram of a distributed IO backplane bus protocol implementation device based on a dual-link architecture provided by the embodiments of the present application;
[0014] Figure 3Fig. 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0015] In the following description, for the purpose of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
[0016] With the development of Industry 4.0 and intelligent manufacturing, there is an increasing demand for efficient and reliable data transmission. Traditional distributed IO systems usually use single link or simple bus structure for communication, which has the problems of limited bandwidth, high risk of single point failure, large delay and complex configuration, and is difficult to meet the requirements of high data volume transmission, real-time and reliability in modern industrial environment.
[0017] To overcome the above limitations, the present application proposes a distributed IO backplane bus protocol based on dual-link full-duplex communication, token control mechanism, hand-in-hand connection mode and automatic scanning and identification of slave station function. The protocol not only ensures high bandwidth, low delay data exchange and high reliability of the system, but also simplifies configuration and maintenance through flexible interframe interval setting, significantly improves the overall performance of the distributed IO system, and is particularly suitable for industrial application scenarios that require high bandwidth, low delay and high reliability.
[0018] The present application proposes an implementation method of a distributed IO backplane bus protocol based on a dual-link architecture, which realizes efficient and reliable data interaction through optimization of frame format design, dynamic address allocation mechanism and layered communication strategy. The present application mainly includes the following contents:
[0019] I. Dual-link communication architecture
[0020] UART1 link (RS422 differential): full-duplex mode, supporting 8Mbps high-speed communication, used for periodic data (such as IO input and output) and aperiodic data (such as firmware upgrade, remote diagnosis) interaction;
[0021] UART2 link (TTL level): one-way hand-in-hand mode, supporting 6Mbps communication, used for address setting, device scanning and forwarding of permission control commands.
[0022] II. Layered frame format design
[0023] Periodic communication frame:
[0024] Long frame format: contains function code (0x68), slave address (1-64), data length (1 byte), data area (max 32 bytes) and CRC check;
[0025] Short frame format: used for response when no data interaction (function code 0xE5), reduce invalid data transmission.
[0026] Non-periodic communication frame:
[0027] Double-byte mode: support 250 bytes of packet transmission, including non-periodic command (such as 0x01 remote diagnosis, 0x03 firmware upgrade), total packet number and packet number;
[0028] Single-byte mode: used for fast instructions (such as sending permission command 0xE5).
[0029] Three, dynamic address allocation and scanning mechanism
[0030] Address setting process:
[0031] The master station sends an address setting command (such as 0x9D + target address) through the UART2 link;
[0032] After the slave station receives the address setting packet, if the address matches, it updates the local address and reports the device information (ID, version, IO length) through the UART1 link;
[0033] The slave station that does not match the address forwards the address value + 1 to the next level, realizing chain address allocation.
[0034] Device scanning mechanism:
[0035] The master station sends a scanning command (0x10 + start address), and the slave station responds in turn and reports the device information, and the master station judges the online state of the slave station according to the response time difference.
[0036] Four, periodic and non-periodic communication coordination
[0037] Periodic communication:
[0038] The master station sends permission command (0xE5) through UART2 link polling, triggering the slave station to upload input data in order;
[0039] Support online verification of configuration data (correct response 0x03, error response 0x0C).
[0040] Non-periodic communication:
[0041] The master station handles non-periodic tasks (such as firmware upgrade) during the idle period of periodic communication
[0042] When the slave station handles non-periodic requests, if it is not completed, it returns a short frame (0xE5) to avoid blocking periodic communication.
[0043] V. Fault handling mechanism
[0044] Communication watchdog: master station monitors slave station response timeout, determines slave station offline and records address;
[0045] Slave station re-online: offline slave station reports to address 126 after reset, triggers master station to re-allocate address and synchronize configuration.
[0046] The technical solution of the application at least includes the following advantages:
[0047] Efficient communication: dual-link architecture separates control and data, UART2 link implements fast command forwarding, and UART1 link supports 6Mbps high-speed data transmission;
[0048] Flexible expansion: dynamic address allocation mechanism supports plug-and-play, and slave station offline does not affect communication of other nodes;
[0049] Reliable transmission: packet transmission (periodic 32 bytes / aperiodic 250 bytes) combined with CRC check ensures the integrity of large data transmission;
[0050] Real-time diagnosis: communication watchdog and state machine cooperate to achieve millisecond-level detection and automatic recovery of slave station offline.
[0051] The application is a distributed IO backplane bus protocol based on a dual-link architecture, which realizes efficient and reliable data interaction by optimizing frame format, address allocation and communication strategy. The application has the following key technical points:
[0052] I. Dual-link architecture: UART1 (RS422 differential, full duplex, 8Mbps) is used for periodic (such as IO data) and aperiodic (such as firmware upgrade) data interaction; UART2 (TTL level, one-way handshaking, 6Mbps) is used for address setting, device scanning and permission command forwarding.
[0053] II. Layered frame format
[0054] Periodic frame: long frame contains function code 0x68, slave station address 1-64, 1 byte data length, maximum 32 byte data area and CRC check; short frame function code 0xE5 is used for no data response.
[0055] Aperiodic frame: double-byte mode supports 250-byte packet, including command, total packet number and packet number; single-byte mode is used for fast command 0xE5.
[0056] III. Dynamic address allocation and scanning
[0057] Address setting: the master station sends 0x9D+target address through UART2, the matched slave station updates the address and reports information through UART1, and the unmatched slave station forwards by 1.
[0058] Device scanning: the master station sends 0x10+start address, the slave station responds and reports, and the master station judges the online state according to the response time difference.
[0059] Four, communication coordination
[0060] Periodic communication: the master station sends 0xE5 through UART2 to trigger the slave station to upload data, and supports online verification of configuration data (correct 0x03, error 0x0C).
[0061] Non-periodic communication: the master station processes tasks in the periodic idle period, and the slave station returns 0xE5 to avoid blocking if the request is not completed.
[0062] Fault handling: the master station monitors the response timeout through the watchdog, judges that the slave station is offline, and records it, the offline slave station resets to 126 to report, and triggers the master station to redistribute the address and synchronize the configuration.
[0063] The technical scheme of the present application at least has the following innovative technical points:
[0064] Dual-link architecture application: protection of the distributed IO backplane bus dual-link architecture based on UART1 and UART2 links and application in different data interaction and instruction forwarding.
[0065] Layered frame format: protection of the specific design of the periodic frame length, short format and non-periodic frame double-byte, single-byte mode.
[0066] Address allocation and scanning mechanism: protection of the chain address allocation and device scanning method based on the response time difference.
[0067] Communication coordination method: protection of the periodic communication trigger, configuration verification and non-periodic communication and periodic communication coordination method.
[0068] Fault handling strategy: protection of the communication watchdog monitoring and offline slave station reset address and synchronization configuration after redistribution.
[0069] The content of the technical scheme of the present application will be described in detail below in combination with the drawings and specific embodiments.
[0070] Figure 1 is the flowchart of the distributed IO backplane bus protocol implementation method based on the dual-link architecture provided by the embodiment of the present application. As Figure 1 shown, the distributed IO backplane bus protocol implementation method based on the dual-link architecture can specifically include:
[0071] S101, establishing dual-link communication, for establishing data link and control link on the backplane in parallel, wherein the data link is a differential full-duplex link, and the control link is a cascaded unidirectional link;
[0072] S102, performing address and device discovery, for transmitting an address seed on the control link and forwarding it station by station in the cascaded order, and a hit slave station writes the address of the current station and reports information containing device identification, version and input / output length on the data link;
[0073] S103, defining frame structure and packeting rule, for setting function identification, address, length, data, check and end fields for service frames, and setting different function identification and packeting upper limit for periodic service and aperiodic service respectively;
[0074] S104, periodic communication control, for the master station to issue output data frames in address order on the data link, and to send tokens station by station on the control link, so that a slave station obtaining the token transmits input data on the data link and forwards the token to the next slave station until the polling is completed;
[0075] S105, aperiodic communication scheduling, for the master station to send an aperiodic request to a target slave station on the data link in the gap of periodic communication, and to complete response interaction in queue order, and a slave station not completing processing returns a short response to maintain the order;
[0076] S106, implementing protocol application flow, for completing transmission of input data, output data and management data in the distributed input / output backplane according to dual-link communication, address and device discovery, frame structure and packeting rule, periodic communication control and aperiodic communication scheduling.
[0077] In some embodiments, establishing dual-link communication includes:
[0078] Physical and topological configuration, for setting differential full-duplex pairs of the data link and cascaded unidirectional wires of the control link on the backplane connector respectively, and establishing corresponding ports between the master station and each slave station;
[0079] Channel and role setting, for configuring the data link of the master station as a transceiving channel with parallel sending and receiving, configuring the control link as a unidirectional forwarding channel from top to bottom, and enabling the receiving and sending channels of the data link and the only downward forwarding channel of the control link on the side of each slave station;
[0080] Link synchronization and delimiting setting, for sending synchronization and start-stop delimiting information by the master station on the data link and the control link, so that each slave station completes bit synchronization and frame synchronization on the access side and enters the working state;
[0081] Timing and buffer parameter setting, used to set bit clock, frame interval and transceiver buffer threshold, and to configure control message time slot on control link and service frame time slot on data link in parallel;
[0082] Token and address channel preset, used to reserve sending permission token and address seed transmission channel on control link, and to reserve input data uplink and output data downlink on data link.
[0083] Specifically, in the embodiment, the establishment of dual-link communication includes the following interrelated configuration and initialization processes. First, the differential full-duplex pair of lines of the data link and the cascaded unidirectional wires of the control link are respectively arranged on the backplane connector, and the transceiver ports and the cascade ports are correspondingly led out at the backplane interfaces of the master station and each slave station, the terminal matching and common ground loop are set at both ends of the data link, and the control link is unidirectionally connected in sequence along the modules.
[0084] Secondly, channel and role setting: the master station side enables the parallel transceiving channels of the data link for sending and receiving, and enables the downward level sending channel of the control link; each slave station side enables the sending and receiving channels of the data link, and only enables the downward level forwarding channel of the control link, which is guaranteed by the hardware gate or the firmware forwarding unit to be unidirectional cascaded.
[0085] Thirdly, link synchronization and delimiting setting: the master station sends synchronization sequences and start-stop delimiting information on the data link and the control link in turn, and each slave station enters standby state after completing bit synchronization, frame synchronization and start-stop boundary alignment.
[0086] Subsequently, timing and buffer parameter setting is completed: the master station issues bit clock parameters, frame interval and transceiver buffer threshold, and each slave station sets the receiving buffer, the sending buffer and the frame reorganization buffer accordingly; at the same time, control message time slots are divided on the control link, and service frame time slots are divided on the data link, so that the two links are occupied in parallel and do not overlap with each other.
[0087] Finally, token and address channel presetting: sending permission token and address seed transmission channel are reserved on the control link, and input data uplink and output data downlink are reserved on the data link, which completes the basic configuration for subsequent periodical communication control and address and device discovery.
[0088] The concepts of important technical terms involved in the embodiment are explained as follows:
[0089] Differential full-duplex pair of lines: refers to arranging two pairs of differential wires for uplink and downlink on the backplane for the data link, so that receiving and sending are performed simultaneously.
[0090] Cascaded unidirectional wires: refers to the unidirectional transmission channel of the control link, which is output from the master station, input from the upper-level slave station and only forwarded to the next-level slave station.
[0091] Transmit and forward channel: the transmit channel is used for transmitting and receiving service frames on the data link; the forward channel is used for cascading forwarding of tokens and address messages on the control link, and the state machine is limited to only transferring downstream.
[0092] Synchronization and delimiting: the synchronization sequence is used to establish bit and code group alignment; the start and end delimiting information is used to identify the service frame boundary for the frame parsing unit of each slave station to complete delimiting and error discarding.
[0093] Slot configuration: the control message slot is used to transmit tokens and address seeds; the service frame slot is used to carry input data, output data and management data, both of which are arranged in parallel on the time axis to avoid mutual preemption.
[0094] Send permission token and address seed: the former is used to authorize the sending order of each station in the upstream phase; the latter is used to allocate addresses and trigger information reporting of each station in the network building phase.
[0095] For example, in some examples, on a backplane, the master station and a plurality of slave stations are connected in physical order. The data link uses two pairs of differential wires to bear the upstream and downstream channels respectively, and terminal matching is provided at the master station end and the end terminal; the control link uses a single-end cascading wire to be connected in sequence from top to bottom, and each slave station is configured with an input end and a forwarding end on the control link, and the forwarding end realizes the forwarding of tokens and address messages by buffering and gating. After the master station is powered on, it successively performs synchronization and delimiting distribution, and the physical layer interface and frame parsing unit of each slave station enter the working state; then the master station distributes the frame interval, the receive buffer threshold and the send buffer threshold, and each slave station sets the buffer level and registers the maximum packet number and single packet length allowed in the reassembly buffer. The control message slot of the control link and the service frame slot of the data link are uniformly configured in the master station timing control unit and notified to each slave station in a broadcast manner, ensuring that the access side clock domain and frame processing beat of each slave station are consistent.
[0096] To ensure unidirectional cascading and orderly transmission, each slave station enables a forwarding logic only to the next level on the control link side: when a send permission token is received, the slave station sends input data in the frame structure on the upstream channel of the data link, and after completion, forwards the token to the next slave station; when an address seed is received, if the local is in an unconfigured state, the local address is written and device information is sent on the data link, and if it has been configured, it is incremented according to the preset rule and then forwarded. To avoid the influence of control link jitter on the data link, each slave station sets independent queues for control message and service frame processing in the firmware, the service frame queue uses the length field combined with the delimiting information to trigger the frame, and the control message queue uses the time slot to trigger the queue, both of which are pushed forward in the local clock domain through the scheduling unit.
[0097] In the backplane layout of the embodiment, the master station and each slave station are each configured with three types of buffers, i.e., a receiving buffer, a sending buffer and a reassembly buffer, on the data link side. The receiving buffer is used to queue complete frames, the sending buffer is used to schedule outgoing frames, and the reassembly buffer is used to temporarily store frames before packet reassembly and verification. When the buffer level exceeds a threshold, each slave station suspends reception of new service frames and only processes control messages, and resumes reception of service frames after the buffer level falls back. To improve the stability of the delimitation, the frame parsing unit completes parsing in the order of function identifier, address, length, data, verification and end after detecting the start delimitation, and discards the frame if the verification fails and records the abnormal count in the local state machine, which is read by the master station in the management data channel. Through the cooperation of the above physical and topological configurations, channel and role settings, synchronization and delimitation, timing and buffer parameters, and token and address channel presets, parallel establishment and stable operation of the data link and the control link in the backplane are achieved.
[0098] In some embodiments, performing address and device discovery includes:
[0099] address seed generation and initial setting, for generating an address seed from a preset initial address by the master station and sending it from an upstream node on the control link;
[0100] station-by-station forwarding and incrementing rule, for each slave station to increment the address seed according to a preset rule and relay it to a next level when a hit is not made, and stop forwarding when a hit is made;
[0101] local writing and allocation confirmation, for a hit slave station to write the address into a local address storage and return an allocation confirmation identifier on the control link;
[0102] device information reporting, for a hit slave station to send device information on the data link, the device information at least including device identifier, version and input / output length;
[0103] timeout and fallback control, for the master station to reinitiate the address seed or adjust the initial address according to a preset time interval when no allocation confirmation is received.
[0104] Specifically, in the embodiment, performing address and device discovery includes address seed generation and initial setting on the master station side, station-by-station forwarding and incrementing rule on the control link, local writing and allocation confirmation on the slave station side, device information reporting on the data link, and timeout and fallback control on the master station side. The master station generates an address seed from a preset initial address and sends it from an upstream node on the control link; each slave station receives the address seed in the order of physical concatenation, increments the address seed according to a preset rule and relays it to a next level when a hit is not made, and writes the address into a local address storage and returns an allocation confirmation identifier on the control link when a hit is made, while sending device information on the data link; when no allocation confirmation is received within a preset time interval, the master station reinitiates the address seed or adjusts the initial address according to a fallback strategy, until a round of address allocation and device discovery is completed.
[0105] The concepts of important technical terms involved in the present embodiment are explained as follows:
[0106] Address seed generation and initial setting: the master station generates the first address seed according to the initial address, the maximum number of slave stations and the allocated table, and records the starting point and the end point of the present round to define the scanning range of the present round.
[0107] Station-by-station forwarding and increment rule: the control link adopts one-way cascade transmission, and each slave station forwards the address seed after incrementing the address seed according to the local increment rule when a hit is not made; the increment rule supports sequential increment and wrap-around increment to cover the entire address space.
[0108] Hit criterion and single write: the hit condition is that the station is in the unconfigured state and the received address seed is not occupied; after a hit is made, the subsequent address seed is latched and shielded to ensure that only one slave station writes in the same round.
[0109] Allocation confirmation identification: the hit slave station sends the allocation confirmation identification back on the control link, which at least contains the station address and the allocation state bit, and is used for the master station to complete address registration.
[0110] Device information reporting: the hit slave station sends the device information on the data link, which at least contains the device identification, version and input / output length, and is registered together with the local address.
[0111] Timeout and backoff control: the master station sets an independent time slot for each address seed, and triggers the backoff strategy if the allocation confirmation is not received within the time slot, including re-sending the current address seed, skipping the current address or adjusting the initial address to re-scan.
[0112] For example, in some examples, the master station reads the allocated table and the initial address after power-on, generates an address seed and sends it to the upstream node on the control link. The first-level slave station receives the address seed and checks the local configuration flag. If the station is not configured and the address is not occupied, a hit is determined, the station address is written and the local configuration flag is set. Then, the allocation confirmation identification is sent back to the upstream direction on the control link, and the device information is sent on the data link, which contains the device identification, version and input / output length. If the first-level slave station does not hit, the address seed is incremented according to the sequential increment rule and then relayed to the next slave station. The second-level and subsequent slave stations repeat the above processing until a hit is made by a slave station or the present round of scanning is completed.
[0113] To ensure unique hit, each slave station enables address write latch immediately after hit write, and masks address seed in the rest time of this round; to prevent repeated write caused by link jitter, each slave station sets minimum silence window after returning allocation confirmation mark, and only forwards without re-determining hit in the window. The master station starts time slot counting after sending each address seed, if allocation confirmation mark is received within the time slot, the address and corresponding device information are registered in the allocated table, and the next address seed is sent; if no allocation confirmation mark is received, the backoff strategy is executed, the current address seed is re-sent once, if still not confirmed, the current address is skipped, and if necessary, the starting address is adjusted to supplement the uncovered interval.
[0114] In the case of slave station re-powering or off-line re-online, the slave station enters the unconfigured state and waits for address seed hit; the master station triggers a supplementary scan in the periodic communication gap, generates and sends address seed from the latest starting address, and each slave station completes station-by-station forwarding and increment according to the predetermined rule, the hit slave station writes the address and reports the device information. To avoid address conflict, the master station compares the allocated table with the current online table before supplementary scan, sets a skip flag for the address registered but not online, and only issues address seed to unoccupied address. Through the above configuration, the embodiment completes the cooperation of address seed generation, station-by-station forwarding and increment, local write and allocation confirmation, device information reporting, and timeout and backoff control, and realizes the complete process of address and device discovery.
[0115] In some embodiments, defining frame structure and packeting rules includes:
[0116] Field delimiting and order specification, for using fixed start and end delimiting, and specifying the order organization of function identification, address, length, data, check and end, and indicating the data area and packeting related parameters by the length field;
[0117] Service category mapping rule, for setting function identification sets that do not cross each other for periodic service and aperiodic service respectively, and reserving extended identification to support new service type;
[0118] Packeting and recombination rule, for setting packeting identification, total sequence number and sub-sequence number in the data field, and completing packeting transmission and recombination by the master station or the slave station according to the identification, and defining packeting boundary by the length field and the end field;
[0119] Check rule, for performing cyclic redundancy check from function identification to data field, and determining whether the service frame is received and processed according to the check result;
[0120] Direction adaptation rule, for carrying uplink input data and downlink output data respectively under unified frame structure, and being compatible with token control.
[0121] Specifically, in the embodiment, the frame structure and the packeting rule are defined in terms of five aspects, i.e., unified frame format, service class mapping, packeting recombination, check and direction adaptation. The unified frame format adopts fixed start-stop delimiting, and is organized in the order of fields of function identification, address, length, data, check, and end. The service class mapping divides periodic services and aperiodic services into function identification sets that do not cross each other, and reserves an extended identification. The packeting recombination carries packeting identification, total sequence number, and sub-sequence number in the data field, and the master station or the slave station completes packeting sending and recombination according to the packeting identification, the total sequence number, and the sub-sequence number, and the packeting boundary is jointly constrained by the length field and the end field. The check performs a cyclic redundancy check on the function identification to the data field, and determines whether to receive and process according to the check result. The direction adaptation simultaneously supports uplink input data and downlink output data under the same frame structure, and is compatible with the order control of sending permission tokens.
[0122] The concepts of important technical terms involved in the embodiment are explained as follows.
[0123] Fixed start-stop delimiting: refers to using fixed delimiters at the frame head and the frame tail, so that the receiving end can restore the frame boundary through double constraints of delimiting and length even when there is jitter and sticking.
[0124] Function identification set: allocates non-overlapping identification ranges for different service classes, and the periodic services and the aperiodic services are directly routed to corresponding processing channels by the function identification in the analysis stage, and the extended identification is reserved for subsequent new service types.
[0125] Length field: in addition to indicating the number of bytes of the data area, also carries the validity bit of the packeting related parameter, so that the receiving end can determine whether to enable the packeting recombination process.
[0126] Packeting identification, total sequence number, and sub-sequence number: the packeting identification is used to announce that the frame is a packet fragment, the total sequence number identifies the aggregation attribution of the same complete message, and the sub-sequence number identifies the relative order of the fragment in the message.
[0127] Cyclic redundancy check: takes the function identification to the data field as the check range, and the check field is independent of the end field, so as to ensure that the frame can be rejected when the delimiting is correct but the content is disturbed.
[0128] Direction adaptation: under the unified frame structure, the uplink input and the downlink output are distinguished by the combination of the address and the function identification, and the uplink order of sending permission tokens is followed, without introducing additional conflict points.
[0129] For example, in some examples, the master station and the slave station load a uniform frame description in a protocol initialization stage: the receiving end first enters a parsing state according to a start delimiter, reads a function identifier and an address, and then determines a service type according to a function identifier set and selects a processing channel; then, a length field is read, if the length field indicates that packetization is enabled, a packetization identifier, a total sequence number and a subsequence number are parsed at the beginning of a data segment and are registered to a reassembly buffer, otherwise, a data length is directly used to guide enqueuing. The receiving end performs a cyclic redundancy check after extracting the data, and only when the check passes can the data be submitted to a service layer, if the check fails, the frame is discarded and a local state machine is counted. An end field is used for final delimiter confirmation, and a length field forms a head-tail double constraint to avoid out-of-bound reading due to a byte loss in the middle.
[0130] In a periodic service, the master station generates a downlink output frame in address order and sends it; in an uplink stage, a slave station that obtains a sending permission token sends an input frame according to a uniform frame structure. Since the uplink and the downlink both use the same field order and check rules, a hardware transceiver unit and a frame parsing unit can be reused, and only a function identifier and a direction route are used for shunting. In a non-periodic service, when the data volume exceeds an upper limit of a single frame, the master station or the slave station splits a complete message into several packets, sends the packets one by one, and completes reassembly according to a total sequence number and a subsequence number at a receiving end. After reassembly is completed, the data can be submitted to an upper layer for processing; if all subsequence numbers are not received within a specified window, the receiving end cleans up a corresponding reassembly buffer and reports loss information, and a scheduling unit triggers retransmission in a subsequent window. In order to prevent a packet and a token from colliding, packet sending in the uplink is only continuously completed in a station that obtains a token, if the station cannot complete sending in the current window, a placeholder response is returned and sending is continued in the next window.
[0131] When the receiving end detects a start delimiter but does not receive an end delimiter within a byte range indicated by a length field, the frame is considered abnormal and is discarded; when a function identifier does not hit any service set, the function identifier is considered to be reserved or unknown type, and is recorded and ignored according to a preset strategy; when a packet with the same total sequence number has a repeated subsequence number, only the first valid fragment is retained. Through the above uniform frame structure, strict category mapping and packet reassembly, coverage check and direction adaptation, the embodiment completes reliable bearing of the periodic and non-periodic services in the same frame system without changing a token order control.
[0132] In some embodiments, periodic communication control includes:
[0133] A token unique holding rule is used for single issuance of a sending permission token in address order, and limits that only one slave station holds at the same time;
[0134] A token forwarding and placeholder response rule is used for a slave station that obtains a token to forward the token to a next address after completing sending of input data, and to return a placeholder response and then forward if there is no input data;
[0135] Timeout skip and state maintenance rule, for skipping current address and recording state for later processing when preset time slot is not completed for uplink;
[0136] Frame consistency and packet completion constraint, for forwarding token only when unified frame structure is met and packet reassembly is completed;
[0137] Polling reset and cooperative scheduling rule, for recycling token to master station to start next round of polling after end station completes, and for coordinating with non-periodic communication scheduling in time without interrupting token order.
[0138] Specifically, in the embodiment, periodic communication control is started after double-link establishment, address and device discovery, and frame structure and packet rule configuration are completed. The master station generates a send permission token on the control link after a round of downlink output is completed on the data link according to address order, and sends the token to the first address node. Each slave station performs uplink and token transfer according to the local state machine and unified frame structure.
[0139] Illustratively, the master station maintains a single token strategy, and only one valid token exists in the transmission link at any time. The master station sends the token to the starting address of the current polling, and the slave station that does not obtain the token remains silent. Token ownership is unidirectionally transferred by the cascading direction of the control link, avoiding simultaneous possession and reverse flow.
[0140] Illustratively, the slave station that obtains the token sends input data on the data link according to the unified frame structure. If packetization is enabled, the input data is continuously sent in the order in the reassembly buffer until the station completes data transmission; if there is no input data in the current round or only the order needs to be maintained, the station returns a placeholder response to declare the placeholder and immediately forwards the token to the next address. To prevent delay, the station releases the token immediately after completing transmission or returning the placeholder response, and does not remain locally.
[0141] Illustratively, the master station sets a preset time slot for each token holding stage. When no compliant uplink frame or placeholder response is received from the token holding station within the preset time slot, the master station considers it as a timeout and marks the address as abnormal, skips to the next address to continue sending the token, and records the type and number of exceptions in the state table for subsequent compensation and maintenance. If timeout occurs for multiple rounds in succession, the output to the address is suspended in the downlink stage until the station reenters the network and passes the configuration check.
[0142] Illustratively, token forwarding is subject to frame consistency. The slave station holding the token can only forward the token when the submitted uplink frame meets the fixed start and end delimiting, field order, and cyclic redundancy check, and packet reassembly has been completed at the local end. If frame parsing failure or packet unavailability is detected, the station immediately returns a placeholder response and forwards the token, avoiding blocking the uplink order of subsequent nodes due to local exceptions.
[0143] Exemplarily, when the end station completes the uplink, the token is recycled to the master station through the control link, and the master station resets the polling pointer and starts the next round of cycle according to this. The master station schedules non-periodic communication within the time window between two tokens, and the request and response are completed on the data link without changing the token order and forwarding rhythm of the control link; when there are packets to be transmitted or management transactions to be processed, the scheduling unit inserts them in the adjacent window according to the priority, but cannot cross the token transmission boundary.
[0144] For example, in a backplane, slave stations from address 1 to address N are cascaded in physical order. After the master station completes the downlink output, the token is sent to address 1. If slave station 1 has input data to be reported, it sends directly according to the frame structure; if there is no data to be sent, it returns a placeholder response and forwards the token to address 2. If address k does not return a valid uplink or placeholder response within the preset time slot, the master station marks address k as abnormal and points the token to address k+1 to continue polling. When address N completes the uplink, the token returns to the master station, and the next round begins. If a slave station fails to complete packet reassembly, it only returns a placeholder response to release the link, and the non-periodic scheduling triggers retransmission or compensation in the subsequent window.
[0145] The embodiment forms a verifiable ordered uplink and continuous polling mechanism through single-token sequential control, placeholder response rapid release, timeout skipping based on a preset time slot, token transfer with a unified frame structure as a threshold, and time coordination of tokens and non-periodic windows, ensuring that each slave station completes input data transmission in address order and does not interfere with each other, realizing deterministic timing control of the uplink channel, rapid bypass of abnormal nodes, and parallel bearing of periodic and non-periodic services.
[0146] In some embodiments, the non-periodic communication scheduling includes:
[0147] The non-periodic task queue and priority rules are used to establish a non-periodic task queue by the master station and schedule according to a preset priority order, and only a single target slave station is initiated for interaction at a time;
[0148] The window selection and non-interference rules are used to initiate non-periodic requests within the periodic communication window without occupying token transmission, and keep the token order unchanged;
[0149] The packet and integrity constraints are used to transmit non-periodic data according to the frame structure and packet rules, and return the response after completing the packet reassembly;
[0150] The placeholder response and retransmission rules are used for the target slave station to return a placeholder response when it cannot complete processing temporarily, and the master station retains the task and retransmits or retries in the subsequent window;
[0151] The timeout and backoff rules are used to perform backoff, retry or skip when a complete response is not obtained within a preset time slot, and record the state;
[0152] Mode switching rule for suspending periodic communication when performing special aperiodic service such as firmware upgrade, leaving only aperiodic communication channel.
[0153] Specifically, in this embodiment, the aperiodic communication scheduling is realized by the coordination of six parts: task queue management, window selection and timing control, packetization and integrity guarantee, placeholder response and continuation, timeout and fallback, and mode switching on the master station side. The master station carries aperiodic load on the data link and maintains the specified order of sending permission tokens on the control link, ensuring that aperiodic requests are executed outside the periodic communication window and do not change the token delivery rhythm.
[0154] Illustratively, the master station maintains an aperiodic task queue, which sorts tasks such as remote diagnosis, log reading, parameter issuance, firmware upgrade, etc. according to pre-set priorities. The queue scheduling follows the single-target slave principle, i.e. only one target slave is selected for aperiodic interaction at a time, and multiple tasks for the same slave are combined into one batch to reduce window occupancy. The queue supports two ways of entering the queue: expiration triggering and external event triggering, and checks the online state and configuration state of the target slave when scheduling.
[0155] Illustratively, the master station initiates aperiodic requests within the time window between two rounds of token delivery. The window is demarcated by the master station timing control unit after completing a round of downlink output and uplink input, and only carries aperiodic data in the window, without occupying token delivery time slots. If the current aperiodic batch is not expected to be completed within the window, the master station only sends the necessary starting segment and records the continuation indication, while retaining the priority of the next window, and does not insert additional segments across the token delivery boundary.
[0156] Illustratively, when the aperiodic data exceeds the single-frame upper limit, the master station splits the complete message into several sub-frames according to the frame structure and packetization rules, and carries the packetization identifier, total sequence number and sub-sequence number in the data field. The receiver merges them according to the total sequence number and sorts them according to the sub-sequence number in the reassembly buffer, and submits them to the aperiodic processing unit after all sub-frames are received and the cyclic redundancy check is passed. If the reassembly is not completed at the end of the window, the receiver keeps the reassembly buffer from being emptied, and the master station continues the remaining sub-frames in the next window; if it is still incomplete after the reassembly survival time limit, the buffer is cleared and an incomplete indication is returned to the master station.
[0157] Illustratively, when the target slave cannot generate a complete response within the current window due to local resource occupation, storage writing or incomplete security check, it returns a placeholder response to declare the order and reception status, and the master station retains the task and continues or retries it in the subsequent window. The placeholder response can carry minimal progress information to guide the master station to continue from the specified sub-sequence number, without requiring the return of a large amount of load.
[0158] Exemplarily, the master station sets independent time slot for each non-periodic batch. When no complete response is obtained within the preset time slot, a fallback strategy is executed: one, preferentially retrying the same batch and limiting the number of retries; two, downgrading the task to a lower priority to avoid long-term occupation of the window; three, recording the abnormal state and skipping to the next task in the queue. The skipped task can be re-queued after a cooling period. For a target slave station with multiple timeouts, the master station suspends the parameter class non-periodic request for it in the downlink stage, only retaining the necessary diagnostic query.
[0159] Exemplarily, when there is a firmware upgrade or a large load task that needs to exclusively occupy the channel in the queue, the master station switches to a dedicated non-periodic mode, suspending periodic communication and token passing, and only retaining the non-periodic channel on the data link. Before switching, the master station issues a mode switching indication on the control link, and the slave station enters a receiving state and clears the uncompleted periodic uplink buffer; after the upgrade is completed or the dedicated task is completed, the master station issues a recovery indication and re-includes the periodic communication according to the address and device discovery and configuration verification process.
[0160] For example, in one running period, after the master station completes the downlink output to each slave station and the token sequential uplink, a window is drawn and the highest priority diagnostic task is taken out of the task queue, and a non-periodic request is sent to the target slave station. Due to local verification time consumption, the target slave station returns a placeholder response and informs the received subsequence range, and the master station continues transmission of the remaining fragments in the next window; if it is still not completed for two consecutive windows, the master station reduces the priority of the task and places the log reading task in front of execution. When a firmware upgrade task appears in the queue, the master station switches to a dedicated non-periodic mode after the window ends, sequentially sends the packaged image, and restores the periodic communication and verifies the device information and configuration state of the target slave station after receiving the completion indication.
[0161] Through the above non-periodic communication scheduling mechanism, without changing the order of sending the allowed token and without occupying the token time slot, controllable insertion of non-periodic load, ordered sequential transmission of packaged data, and abnormal fallback are realized, ensuring decoupling of non-periodic tasks and periodic communication, ensuring stable uplink order, controllable window utilization, and exclusive processing of large load tasks.
[0162] In some embodiments, the protocol application process includes:
[0163] Channel mapping and category binding are used to map input data, output data, and management data to the uplink, downlink, and management sub-channels of the data link, and to reserve token and address passing sub-channels on the control link;
[0164] Configuration issuance and consistency verification are used to issue configurations on the data link and receive configuration state identifiers, and only stations that pass the verification are included in input, output, and management data transmission;
[0165] Packet reassembly and check constraint, used for transmitting three types of data according to frame structure and packet rule, and confirming reception only when reassembly is completed and check is passed;
[0166] State machine maintenance and abnormal switching, used for maintaining communication state of slave station by master station, stopping downlink to corresponding address when timeout or disconnection occurs, and triggering address and device discovery and configuration issuing again when slave station reports preset online address;
[0167] Cooperative scheduling and window allocation, used for completing input data transmission in token order and scheduling management data interaction in periodic communication gap, and maintaining order by placeholder response when processing is not completed;
[0168] Fault safety and mode switching, used for suspending periodic communication and broadcasting entry into fault safety state when receiving fault safety indication, and switching to only management data mode when executing special management task.
[0169] Specifically, in the embodiment, the protocol application flow is based on dual-link communication, and is executed in the order of channel mapping and category binding, configuration issuing and consistency check, packet reassembly and check constraint, state machine maintenance and abnormal switching, cooperative scheduling and window allocation, and fault safety and mode switching. The data link is divided into uplink input sub-channel, downlink output sub-channel and management sub-channel, and the control link reserves transmission permission token and address transmission sub-channel; only when the slave station completes configuration and passes consistency check, it is included in transmission and scheduling of three types of data.
[0170] The key technical features and concepts of the terms involved in the embodiment are explained as follows:
[0171] Channel mapping and category binding: input data is bound to uplink sub-channel, output data is bound to downlink sub-channel, and management data is bound to management sub-channel in data link; control link only carries token and address messages, which are independent of management data.
[0172] Configuration issuing and consistency check: master station issues configuration, and slave station returns configuration state identifier; slave station that does not pass check is excluded from input, output and management data transmission.
[0173] Packet reassembly and check constraint: three types of data all follow unified frame structure and packet rule, and receiving end only executes confirmation when reassembly is completed and check is passed.
[0174] State machine maintenance and abnormal switching: master station maintains communication state of each slave station, and stops downlink to corresponding address when timeout or disconnection occurs; when slave station reports preset online address, reentry process of address and device discovery and configuration issuing is triggered.
[0175] Coordinated scheduling and window allocation: Token order is used for timing control of uplink input data; Management data is scheduled in periodic communication slots, and unfinished processing is kept in order by placeholder responses and continued in subsequent windows.
[0176] Fault safety and mode switching: Pause periodic communication and broadcast entering fault safety state when receiving fault safety indication; Switch to management data only mode when performing dedicated management tasks, and restore according to established procedures after task completion.
[0177] For example, in some examples, after the master station completes address and device discovery, it first establishes the mapping relationship of the three types of sub-channels in the data link, and confirms that the token and address sub-channel are in an available state in the control link. Then, it sequentially issues configurations to online slave stations, receives configuration state identifiers returned by each slave station; For slave stations that return abnormal identifiers, the master station marks them as disabled in the mapping table and excludes their input and output transmission, while retaining a query entry in the management sub-channel for subsequent diagnosis. For slave stations that pass the verification, the master station loads their input length and output length parameters, establishes the upper limit of packet splitting and the water level of reassembly buffer.
[0178] After the start of periodic communication, the master station sends output frames in address order in the downlink output sub-channel; It issues sending permission tokens in the control link, and the slave stations that obtain the tokens send input frames in the uplink input sub-channel. If the input data of a station exceeds the single frame carrying capacity, it is sent continuously according to the packet splitting rule, and the receiving end merges it in the reassembly buffer according to the total sequence number and sub-sequence number; If the remaining packets cannot be sent in the current window, the station returns a placeholder response to release the token, and the master station continues the transmission of the remaining packets in the next window. In parallel, the master station schedules the management sub-channel in the gap between two tokens, for example, triggering remote diagnosis or log reading; If the target slave station processing is not completed, it returns a placeholder response, and the master station records the progress and continues in the subsequent window. For addresses that do not return valid uplink or placeholder responses within a preset time slot, the master station sets their state to abnormal and suspends subsequent downlink; When the station reports with a preset online address, the master station immediately triggers supplementary address and device discovery and configuration issuance, so that it is re-included in the three types of data transmission.
[0179] When the upper layer issues a fault safety indication, the master station broadcasts a fault safety command through the control link, and each slave station switches to the fault safety state; The master station suspends token issuance and downlink output, and only retains the management sub-channel for necessary state query or recovery instruction. If there is a management task such as firmware upgrade that needs to exclusively occupy the channel, the master station switches to the management data only mode, and restores the configuration verification, token polling and mapping relationship of the three types of sub-channels in order after task completion.
[0180] The above embodiment realizes clear division of three types of data through channel mapping and category binding, ensures that only compliant slave stations participate in transmission through configuration verification and state machine maintenance, realizes continuous bearing of large load through packet recombination and placeholder response under unified frame structure, realizes timing coordination of periodic communication and management interaction through token order and window allocation, and completes smooth switching between running state and dedicated management state under fault safety and mode switching mechanism. The overall process ensures that the slave station access, data transmission and management operation run in order within the same protocol system.
[0181] In some embodiments, the method further comprises:
[0182] Configuration and consistency verification are used for the master station to issue a configuration request under the data link and receive a configuration state identifier returned by the slave station, and the state identifier is used for parameter reference in subsequent communication processes;
[0183] Offline and re-networking processing is used for the master station to maintain the state of the slave station on the control link and the data link according to the reception timeout, stop outputting downward to the address determined to be offline, and trigger the address and device discovery mechanism and the configuration and consistency verification mechanism again when the slave station reports at a preset online address.
[0184] Specifically, in the embodiment, the master station issues a configuration request to the slave station that has completed address and device discovery on the data link, and the configuration request carries communication parameters such as input length, output length, management channel parameter, packet upper limit and buffer water level associated with the slave station. To avoid occupying the token delivery time slot, the slave station returns a placeholder response to confirm that it has been received after receiving the configuration request, and then enters a local verification stage. The verification content includes: consistency comparison of the input length and the output length in the configuration with the length reported in the device information; verification of the packet parameter and the buffer water level according to the preset upper limit; verification whether the frame structure field is complete and consistent with the unified frame format; verification whether the management channel parameter is consistent with the master station mapping table. After completing the verification, the slave station returns a configuration state identifier on the data link, which indicates two states of pass or exception, and carries exception field positioning information. The master station updates the mapping table accordingly: for the slave station that returns pass, its communication parameters are loaded for subsequent input, output and management data transmission; for the slave station that returns exception, it is marked as disabled and excluded from periodic communication, and only the management channel is reserved for subsequent review.
[0185] In the scene example, the master station sequentially issues configurations to a number of slave stations that are continuously plugged in. The first slave station returns a configuration status identifier as passed, the master station registers its input length and output length in a mapping table, and sets a packet upper limit and a cache threshold; the second slave station returns an exception, the exception field is located as inconsistent output length, the master station automatically removes the slave station from the token polling set, and records the to-be-corrected item in the management channel; the third slave station returns passed, and the master station immediately includes it in subsequent period communication. To ensure the consistency of parameter reference, the master station only issues downstream output and issues a sending permission token to the slave station with a passed configuration status identifier, and uses the length parameter and packet upper limit in the configuration as the basis for recombination and verification when parsing the upstream.
[0186] The master station maintains the slave station status in the control link and the data link respectively, and sets a receiving timeout threshold and a maximum number of retries. When an upstream frame or a placeholder response of a certain address is not received within a preset time slot, the address is marked as timed out; when the timeout exceeds the threshold continuously, the slave station status is set as offline, and the output frame is immediately stopped from being issued to it, and the token is removed from the token polling set, and the token skips the address in the address order to ensure that the upstream of the subsequent slave station is not hindered. The master station records the offline time and the latest configuration status identifier in the status table for comparison after re-entering the network.
[0187] When the offline slave station is reset or re-powered, the master station sends an online indication in the data link according to a preset online address. After receiving the online indication, the master station triggers a supplementary address and device discovery mechanism, reassigns a working address to the slave station and obtains device information; then immediately executes a configuration and consistency verification mechanism to issue communication parameters matching the current topology to it. If the configuration status identifier is passed, the master station re-adds it to the mapping table and the token polling set; if the configuration status identifier is abnormal, only the interaction is maintained in the management channel for subsequent adjustment. In this process, the master station does not change the on-the-way token and the predetermined window, ensuring the continuity of the period communication beat.
[0188] For example, in a backplane, the master station completes configuration and verification of the first to third slave stations and enters period communication. During operation, the second slave station appears to have a receiving exception and continuously times out, the master station sets it as offline and stops sending downstream output to the address, and the token is transferred from the first slave station to the third slave station in the control link in order, without waiting for the second slave station. Subsequently, the second slave station is reset and reported with a preset online address, the master station immediately triggers a supplementary address and device discovery and configuration issuance, the second slave station returns a configuration status identifier as passed, and the master station restores it to the token polling set and includes it in the input upstream according to the current period timing.
[0189] By performing configuration and consistency check on the data link and taking the configuration state identification as the subsequent parameter reference basis, parameter closed loop and channel screening can be completed before entering periodic communication; by maintaining state on the control link and the data link and implementing offline and re-entry network processing, fast bypass and orderly recovery of abnormal slave stations can be realized without interrupting token sequence and changing window allocation, ensuring parameter consistency, channel controllability and time sequence continuity.
[0190] The address setting process of the application will be described in detail below in conjunction with specific embodiments, which can specifically include the following contents:
[0191] Address setting frame
[0192] Address setting packet sent on the UART2 link:
[0193] Single byte mode:
[0194] Bit 7-6 Bit 5-0 FC = 10b Addr = 0-63
[0195] Double byte mode:
[0196]
[0197] Address setting response packet sent on the slave station UART1 link:
[0198]
[0199] The data contains the ID, version, input length information and output length information of the slave station.
[0200] In some examples, the master station sets the slave station address through the UART2 link, and the slave station responds to the master station through the UART1 link and returns the device information of the set slave station.
[0201] The communication process is as follows:
[0202] Double byte mode:
[0203] 1. The master station sends a set station address data packet with address 1: function code (0x9D) + station address (0x01)
[0204] 2. After the slave station receives the set station address data packet, if the address value is inconsistent with the original address, the slave station sends the slave station device information on the UART1 link; if the address is the same, the original data transmission on the UART1 link continues.
[0205] 3. The slave station adds 1 to the address value and forwards it to the next slave station
[0206] 4. By analogy, set all slave stations.
[0207] The master station can communicate with the slave station after a set timeout time (calculated according to the baud rate and the maximum number of slave stations allowed).
[0208] Single byte mode:
[0209] 1. The master station sends a set station address data packet with address 0:
[0210] 2. After receiving the set station address data packet, the slave station sets Addr+1 as the new address value. If the new address value is inconsistent with the original address, the slave station sends the slave station device information on the UART1 link; if the new and old addresses are the same, the slave station continues to transmit the original data on the UART1 link.
[0211] 3. The slave station forwards the address value Addr+1 to the next slave station
[0212] 4. By analogy, all slave stations are set.
[0213] The master station can communicate with the slave station in the next round after a set timeout time (TSlottime=100Tbit).
[0214] Note:
[0215] 1) If a module is offline and then online, or is powered off and then powered on during communication, the slave station address needs to be reconfigured.
[0216] 2) If the master station does not receive the response data of the slave station within a specified timeout time (TSlottime=100Tbit), it is determined that the slave station and the subsequent slave stations are offline, and the master station records the offline slave station address.
[0217] The device scanning process of the application will be described in detail below in combination with specific embodiments, which can specifically include the following contents:
[0218] Device scanning frame
[0219] Device scanning packet sent on the UART2 link:
[0220] Single byte mode:
[0221] Bit 7-6 Bit 5-0 FC = 01b Addr = 0-63
[0222] Double byte mode:
[0223]
[0224] The slave station sends a scanning response packet on the UART1 link, and the device scanning frame is as follows:
[0225]
[0226] The data contains ID, version and other information of the slave station, input length information and output length information.
[0227] In some examples, the master station receives a scanning command of an application layer, and a device scanning process is described as follows:
[0228] Double-byte mode:
[0229] 1. The master station sends a scanning command data frame to the first-level slave station on a UART2 link: start command byte (0xA2) + station address (0x01);
[0230] 2. After receiving the scanning command data frame sent by the master station, the slave station sets the station address as the address for issuing and answers the slave station device information (containing the slave station ID, version, input and output data length, etc.) on a UART1 link.
[0231] 3. The slave station forwards the address + 1 in the scanning command data to the next-level slave station.
[0232] 4. The next-level slave station repeats the processes 2-3, and the scanning of all slave stations is completed in turn.
[0233] Single-byte mode:
[0234] 1. The master station sends a scanning command data frame (Addr=0) to the first-level slave station on a UART2 link:
[0235] 2. After receiving the scanning command data frame sent by the master station, the slave station sets the address (Addr+1) and answers the slave station device information (containing the slave station ID, version, input and output data length, etc.) on a UART1 link.
[0236] 3. The slave station forwards the address (Addr+1) to the next-level slave station.
[0237] 4. The next-level slave station repeats the processes 2-3, and the scanning of all slave stations is completed in turn.
[0238] Note: If the master and slave stations have entered the data exchange stage, the master station receives the scanning command, and after the current input data is reported, the scanning command is sent on the UART2 connection. The slave station receives the scanning command, and the scanning information is reported in the current round, and the input data is no longer reported in the current round.
[0239] The configuration process of the present application is described in detail below in combination with specific embodiments, which can specifically include the following contents:
[0240] Configuration data frame:
[0241] The configuration data request frame sent by the master station on a UART1 link is as follows:
[0242]
[0243] When the slave station has not detected the correctness of the parameters, a short response is sent on the UART1 link, as shown below as a short response frame:
[0244]
[0245] When the slave station has determined the correctness of the parameters, a configuration data response frame is sent on the UART1 link, as shown below as a configuration data response frame:
[0246]
[0247] Config_Result:
[0248] 0x03: configuration is correct
[0249] 0x0C: configuration error
[0250] The periodic communication process of the present application will be described in detail below in conjunction with specific embodiments, which can specifically include the following contents:
[0251] Periodic data frame
[0252] Transmission enable package sent on the UART2 link:
[0253] Single-byte mode:
[0254] Bit 7-6 Bit 5-0 FC = 11b Addr = 0x2A
[0255] Double-byte mode:
[0256] FuncCode 0xE5
[0257] Output data frame sent by the master station on the UART1 link, as shown below as an output data frame:
[0258]
[0259] Input data frame sent by the slave station on the UART1 link, as shown below as an input data frame:
[0260]
[0261] When the slave station has diagnostic data to report, the input data (including diagnostic data) frame is sent on the UART1 link, as shown below as a diagnostic data frame:
[0262]
[0263] The slave station without input data responds with a short response on the UART1 link, as shown below as a periodic short response frame:
[0264]
[0265] The slave station goes offline and then comes online, and sends a short response on the UART1 link. The following is an online short response frame:
[0266] FuncCode Addr 0xE5 126
[0267] In some examples, the periodic communication process is described as follows:
[0268] For output data of the downlink, the trigger is applied by the coupler. If the output period of the coupler is less than the time for the master station to send all the downlink data of all the slave stations, the master station updates the next round of output data when the first output interrupt is received after all the downlink data is sent. If the communication period of the coupler is greater than the time for the master station to poll all the slave stations, the master station is triggered by the communication period of the coupler to output data, and the periodic data is sent to the slave stations on the UART1 link in turn.
[0269] After the configuration is completed, the input data of the uplink is as follows:
[0270] 1. The master station first sends a "send permission" data packet (1 byte 0xE5) to the first slave station through the UART2 link.
[0271] 2. After the first slave station receives the "send permission" data packet on the UART2 link, the uplink data (input data) of the slave station is sent on the UART1 link.
[0272] 3. After the first slave station sends the uplink data on the UART1 link, the "send permission" data packet (1 byte 0xE5) is sent to the next slave station (downlink) on the UART2 link.
[0273] 4. The next slave station repeats the processes 2-3, and the uplink data of all the slave stations is sent in turn.
[0274] The master station receives the data of the slave station on the UART1 link, and maintains the state machine of the slave station. After the master station receives all the input data of the slave station, the process 1 is repeated to start the next input data interaction of the slave station.
[0275] If a slave station goes offline or is powered off, the slave station and its subordinate slave stations cannot communicate. The superior slave station of the slave station can continue to receive and send data. The master station sets a receiving timeout time to determine whether a slave station is offline, and starts the next polling period of the input data communication.
[0276] After a slave station goes offline, the master station no longer sends the output data of the slave station.
[0277] After a slave station comes online, the master station resets the address of the slave station, configures the slave station, and exchanges data.
[0278] The master station receives user download configuration data, and if the downloaded configuration does not match the actual scanned slave station ID, the master station does not configure and output data to the slave station.
[0279] Periodic data supports packet transmission, with a maximum of 32 bytes per packet.
[0280] If the APP application notifies the protocol stack to enter the failsafe state, the protocol stack no longer communicates with the slave station periodically and sends a broadcast packet to notify the slave station to enter the failsafe state.
[0281] The non-periodic communication process of the present application will be described in detail below in conjunction with specific embodiments, which can specifically include the following contents:
[0282] The remote diagnosis request data packet sent by the master station on the UART1 link is as follows:
[0283]
[0284] The remote diagnosis response data packet sent by the slave station on the UART1 link is as follows:
[0285]
[0286] The read slave station log data packet sent by the master station on the UART1 link is as follows:
[0287]
[0288] The read slave station log response data packet sent by the slave station on the UART1 link is as follows:
[0289]
[0290] The firmware upgrade data packet sent by the master station on the UART1 link (packet transmission) is as follows:
[0291]
[0292] The firmware upgrade response data packet sent by the slave station on the UART1 link is as follows:
[0293]
[0294] In some examples, the master station will detect whether the slave station has non-periodic data to process during the idle time of periodic communication.
[0295] For example, the process description of the non-periodic communication task of the No. 1 slave station is as follows:
[0296] 1. Master sends slave non-periodic data packet after it has finished processing periodic output data
[0297] 2. Slave sends non-periodic response data after it has finished processing periodic uplink data, after a certain time interval.
[0298] 3. Slave sends "send permission" data packet on UART2 link after it has finished sending non-periodic data.
[0299] In a communication period, the master only allows one non-periodic data interaction for one destination slave. If there are multiple destination slaves with non-periodic tasks to process, queuing is required. In the application, there is a queue responsible for scheduling the sending right of non-periodic tasks, and the master only processes one non-periodic communication at a time. In non-periodic tasks, if the destination slave has not finished processing the task, it needs to reply with a short response.
[0300] Non-periodic includes the following two:
[0301] 1. Remote diagnosis and maintenance (periodic communication + non-periodic communication)
[0302] In the remote diagnosis and maintenance phase, after the master receives a remote diagnosis command from the application layer, it adds the task to the non-periodic communication task list buffer and sets the high and low priority of the task. The master sends a remote diagnosis request frame according to the priority order, and the slave processes the remote diagnosis request frame after receiving it and sends a remote diagnosis response frame.
[0303] 2. Firmware upgrade (non-periodic communication)
[0304] In the firmware upgrade phase, the master stops all periodic communications with the slave, and at this time only non-periodic communication exists on the bus. The master sends a firmware upgrade request frame to the specified slave according to the firmware update command received from the application layer. The slave processes the firmware upgrade request frame after receiving it and sends a firmware upgrade response frame. Non-periodic data supports packet transmission, with a maximum of 250 bytes per packet.
[0305] The following is an embodiment of the device of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0306] Figure 2 is a structural schematic diagram of a device for implementing a distributed IO backplane bus protocol based on a dual-link architecture provided by an embodiment of the present application. As shown in Figure 2 , the device for implementing a distributed IO backplane bus protocol based on a dual-link architecture includes:
[0307] The dual-link communication establishment module 201 is configured to establish a data link and a control link on the backplane in parallel, wherein the data link is a differential full-duplex link, and the control link is a cascaded unidirectional link.
[0308] The address and device discovery module 202 is configured to transmit an address seed on the control link and forward it from station to station in a cascaded order, and a hit slave station writes the address of the current station and reports information containing a device identifier, a version, and an input / output length on the data link.
[0309] The frame structure and packet rule definition module 203 is configured to set a function identifier, an address, a length, data, a check, and an end field for a service frame, and set different function identifiers and packet upper limits for periodic services and aperiodic services, respectively.
[0310] The periodic communication control module 204 is configured to transmit output data frames in an address order on the data link by the master station, and transmit a token from station to station on the control link, so that a slave station that obtains the token transmits input data on the data link and forwards the token to the next slave station until the polling is completed.
[0311] The aperiodic communication scheduling module 205 is configured to transmit an aperiodic request to a target slave station on the data link by the master station in a periodic communication gap, and complete an answer interaction in a queue order.
[0312] The protocol application flow implementation module 206 is configured to complete the transmission of input data, output data, and management data in a distributed input / output backplane according to the dual-link communication, the address and device discovery, the frame structure and packet rule, the periodic communication control, and the aperiodic communication scheduling.
[0313] In some embodiments, Figure 2 The dual-link communication establishment module 201 is configured to:
[0314] Physical and topological configuration is configured to set a differential full-duplex pair of wires of the data link and a cascaded unidirectional wire of the control link on the backplane connector, and establish corresponding ports between the master station and each slave station.
[0315] Channel and role setting is configured to configure the data link of the master station as a transceiving channel with parallel transmission and reception, configure the control link as a unidirectional forwarding channel from top to bottom, and enable the reception and transmission channels of the data link and the only downward forwarding channel of the control link on the slave station side.
[0316] Link synchronization and delimiting setting is configured to transmit synchronization and start-stop delimiting information on the data link and the control link by the master station, so that each slave station completes bit synchronization and frame synchronization on the access side and enters a working state.
[0317] Timing and buffer parameter setting, for setting bit clock, frame interval and transceiver buffer threshold, and parallel configuring control message time slot on control link and service frame time slot on data link;
[0318] Token and address channel preset, for reserving sending permission token and address seed transmission channel on control link, and reserving uplink and downlink channel of input data and output data on data link.
[0319] In some embodiments, Figure 2 The execution address and device discovery module 202 is configured to:
[0320] Address seed generation and initial setting, for generating address seed by master station according to preset initial address and sending on control link upstream node;
[0321] Station-by-station forwarding and incremental rule, for each slave station to increment address seed according to preset rule and relay to next level backward when not hit, and stop forwarding when hit;
[0322] Local write and allocation confirmation, for the hit slave station to write address into local address storage and return allocation confirmation identification on control link;
[0323] Device information reporting, for the hit slave station to send device information on data link, and the device information at least contains device identification, version and input / output length;
[0324] Timeout and fallback control, for the master station to re-initiate address seed or adjust initial address according to preset time slot when not receiving allocation confirmation.
[0325] In some embodiments, Figure 2 The frame structure and packeting rule definition module 203 is configured to:
[0326] Field delimiting and order specification, for using fixed start and end delimiting, and specifying order organization of function identification, address, length, data, check and end, and indicating data area and packeting related parameters by length field;
[0327] Service category mapping rule, for setting function identification set not crossing each other for periodic service and non-periodic service respectively, and reserving extension identification to support new service type;
[0328] Packeting and recombination rule, for setting packeting identification, total sequence number and sub-sequence number in data field, and completing packeting transmission and recombination by master station or slave station according to identification, and using length field and end field to delimit packeting boundary;
[0329] Check rule, for performing cyclic redundancy check from function identification to data field, and determining whether service frame is received and processed according to check result;
[0330] Direction adaptation rule for carrying uplink input data and downlink output data respectively under unified frame structure and compatible with token control.
[0331] In some embodiments, Figure 2 The periodic communication control module 204 is configured to:
[0332] Token unique holding rule for sending permission token to be issued in sequence by address and limited to only one slave station holding at the same time;
[0333] Token forwarding and placeholder response rule for forwarding token by the slave station obtaining token to the next address after completing input data sending, and forwarding after returning placeholder response if there is no input data;
[0334] Timeout skipping and state maintenance rule for skipping the current address if the preset time slot is not completed for uplink, and recording the state for subsequent processing;
[0335] Frame consistency and packet completion constraint for forwarding token only when it is consistent with the unified frame structure and the packet reassembly is completed;
[0336] Polling reset and cooperative scheduling rule for recycling token to the master station after the last station is completed to start the next round of polling, and coordinating with the non-periodic communication scheduling in time without interrupting the token sequence.
[0337] In some embodiments, Figure 2 The non-periodic communication scheduling module 205 is configured to:
[0338] Non-periodic task queue and priority rule for establishing a non-periodic task queue by the master station and scheduling according to a preset priority order, and only initiating interaction for a single target slave station at a time;
[0339] Window selection and non-interference rule for initiating non-periodic request in the periodic communication window without occupying token delivery, and keeping the token sequence unchanged;
[0340] Packet and integrity constraint for transmitting non-periodic data according to the frame structure and packet rule, and returning response after completing packet reassembly;
[0341] Placeholder response and continuation rule for returning placeholder response when the target slave station cannot complete processing temporarily, and the master station retains the task and continues transmission or retries in the subsequent window;
[0342] Timeout and backoff rule for performing backoff, retry or skipping and recording the state when the complete response is not obtained within the preset time slot;
[0343] Mode switching rule for suspending periodic communication when performing special non-periodic services such as firmware upgrade, and only retaining the non-periodic communication channel.
[0344] In some embodiments, Figure 2 The implementation protocol application flow module 206 is used for:
[0345] The channel mapping is bound with the category, which is used for mapping the input data, output data and management data to the uplink, downlink and management sub-channels of the data link respectively, and reserving the token and address transmission sub-channels in the control link;
[0346] The configuration delivery and consistency check is used for delivering the configuration in the data link and receiving the configuration state identifier, and only the slave station passing the check is included in the input, output and management data transmission;
[0347] The packet recombination and check constraint is used for transmitting the three types of data according to the frame structure and packet rule, and only when the recombination is completed and the check passes, the reception is confirmed;
[0348] The state machine maintenance and exception switching is used for maintaining the communication state of the slave station by the master station, stopping the downlink of the corresponding address when the timeout or disconnection occurs, and retriggering the address and device discovery and configuration delivery when the slave station reports at the preset online address;
[0349] The cooperative scheduling and window allocation is used for completing the input data transmission in the token order, and scheduling the management data interaction in the periodic communication gap, and maintaining the order by the placeholder answer when the processing is not completed;
[0350] The fault safety and mode switching is used for pausing the periodic communication and broadcasting the entry into the fault safety state when the fault safety indication is received, and switching to the management data only mode when the special management task is executed.
[0351] In some embodiments, Figure 2 The device also includes:
[0352] The configuration and consistency check module is used for the master station to deliver the configuration request in the data link and receive the configuration state identifier returned by the slave station, and the state identifier is used for the parameter reference in the subsequent communication process;
[0353] The disconnection and re-entry network processing module is used for the master station to maintain the state of the slave station in the control link and data link according to the received timeout, stop the downlink output to the address determined to be disconnected, and trigger the address and device discovery mechanism and the configuration and consistency check mechanism again when the slave station reports at the preset online address.
[0354] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0355] Figure 3 is a schematic diagram of an electronic device 3 provided by an embodiment of the present application. As shown inFigure 3 As shown, the electronic device 3 of this embodiment includes a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301. The processor 301 implements the steps in each of the above method embodiments when executing the computer program 303. Alternatively, the processor 301 implements the functions of each module / unit in each of the above apparatus embodiments when executing the computer program 303.
[0356] The electronic device 3 can be a desktop computer, a notebook computer, a palm computer, a cloud server, or the like. The electronic device 3 can include but is not limited to the processor 301 and the memory 302. Those skilled in the art can understand that the electronic device 3 can include more or less components, or different components than those shown. Figure 3 The electronic device 3 is merely an example and does not constitute a limitation on the electronic device 3, which can include more or less components, or different components than those shown.
[0357] The processor 301 can be a central processing unit (CPU), or other general purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or the like.
[0358] The memory 302 can be an internal storage unit of the electronic device 3, such as a hard disk or a memory of the electronic device 3. The memory 302 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, or the like. The memory 302 can also include both an internal storage unit and an external storage device of the electronic device 3. The memory 302 is used to store computer programs and other programs and data required by the electronic device.
[0359] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0360] If the integrated module / unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (for example, a computer readable storage medium). Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program can include computer program code, which can be in the form of source code, object code, executable file or some intermediate form, etc. The computer readable storage medium can include any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0361] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method for implementing a distributed I / O backplane bus protocol based on a dual-link architecture, characterized in that, include: Establish dual-link communication to create a data link and a control link in parallel on the backplane. The data link is a differential full-duplex link, and the control link is a cascaded unidirectional link. The address and device discovery function is used to pass address seeds on the control link and forward them station by station in cascading order. The matched slave station writes its local address and reports information including device identifier, version and input / output length on the data link. Define frame structure and packet rules to set function identifier, address, length, data, verification and end fields for service frames, and set different function identifiers and packet limits for periodic and non-periodic services respectively; Periodic communication control is used by the master station to send out output data frames in address order on the data link and send tokens station by station on the control link, so that the slave station that obtains the token can transmit input data on the data link and forward the token to the next slave station, until the polling is completed. Aperiodic communication scheduling is used to send aperiodic requests from the master station to the target slave station on the data link during periodic communication gaps and complete the response interaction in the queue order. Slave stations that have not completed processing return short responses to maintain the order. The implementation protocol application process is used to complete the transmission of input data, output data, and management data in the distributed input / output backplane according to the dual-link communication, address and device discovery, frame structure and packet rules, periodic communication control and aperiodic communication scheduling.
2. The method according to claim 1, characterized in that, The establishment of dual-link communication includes: Physical and topology configuration is used to set differential full-duplex pairs for data links and cascaded unidirectional wires for control links on the backplane connectors, and to establish corresponding ports between the master station and each slave station. Channel and role settings are used to configure the master station's data link as a transmit and receive channel with parallel sending and receiving, configure the control link as a top-down unidirectional forwarding channel, and enable the data link's receive and send channels and the control link's forwarding channel to the lower level only on each slave station side. Link synchronization and delimitation settings are used by the master station to send synchronization and start / end delimitation information on the data link and control link, so that each slave station can complete bit synchronization and frame synchronization on the access side and enter the working state. Timing and buffer parameter settings are used to set the bit clock, frame interval and transmit / receive buffer thresholds, and to configure the control message time slots on the control link and the service frame time slots on the data link in parallel. The token and address channel are preset to reserve channels for sending permission tokens and address seeds on the control link, and to reserve uplink and downlink channels for input and output data on the data link.
3. The method according to claim 1, characterized in that, The execution address and device discovery include: Address seed generation and initial setting are used by the master station to generate an address seed based on a preset starting address and send it to the upstream node of the control link. The station-by-station forwarding and incrementing rules are used by each slave station to increment the address seed according to the preset rules and then forward it to the next level relay when there is a miss; when there is a hit, forwarding stops. Local write and allocation confirmation: The matching slave station writes the address to the local address storage and returns an allocation confirmation identifier on the control link; Device information reporting is used for the matched slave station to send device information on the data link. The device information includes at least the device identifier, version, and input / output length. Timeout and rollback control is used by the master station to re-initiate the address seed or adjust the starting address in a preset time slot if no allocation confirmation is received.
4. The method according to claim 1, characterized in that, The defined frame structure and packet division rules include: Field delimitation and order specification is used to adopt fixed start and end delimitation and to specify the order of function identifier, address, length, data, check and end, and the length field indicates the data area and related parameters of the sub-packet; Business category mapping rules are used to set non-overlapping sets of functional identifiers for periodic and non-periodic businesses, and reserve extended identifiers to support new business types. The rules for subpackaging and reassembly are used to set subpackaging identifiers, total sequence numbers and sub-sequence numbers in the data fields. The master station or slave station completes the subpackaging and reassembly according to the identifiers, and the subpackaging boundaries are defined by the length field and the end field. The verification rules are used to perform cyclic redundancy checks on the data fields from the function identifier to the data fields, and to determine whether the business frame is received and processed based on the verification results. Direction adaptation rules are used to carry uplink input data and downlink output data separately under a unified frame structure, and are compatible with token control.
5. The method according to claim 1, characterized in that, The periodic communication control includes: The token uniqueness rule is used to issue and send permission tokens in order of address sequence, and to limit only one slave station to holding the token at any given time; The token forwarding and placeholder response rules are used by the slave station that obtains the token to forward the token to the next address after completing the input data transmission. If there is no input data, a placeholder response is returned before forwarding. Timeout skip and status maintenance rules are used to skip the current address if the uplink is not completed in the preset time slot, and record the status for subsequent processing; Frame consistency and packet completion constraints are used to ensure that tokens are forwarded only if they conform to the uniform frame structure and packet reassembly has been completed. Polling reset and coordinated scheduling rules are used to return the token to the master station after the last station completes its work so as to start the next round of polling, and to coordinate with aperiodic communication scheduling in time so as not to interrupt the token order.
6. The method according to claim 1, characterized in that, The aperiodic communication scheduling includes: Aperiodic task queues and priority rules are used by the master station to establish aperiodic task queues and schedule them according to a preset priority order, with each interaction initiated by the slave station targeting only a single target. Window selection and non-interference rules are used to initiate non-periodic requests within a periodic communication window that does not occupy token passing, while maintaining the token order. Packetization and integrity constraints are used to transmit aperiodic data according to the frame structure and packetization rules, and to return an acknowledgment after completing packet reassembly. The placeholder response and resume rules are used to return a placeholder response when the target slave station cannot complete the processing temporarily. The master station retains the task and resumes or retryes it in a subsequent window. Timeout and rollback rules are used to perform rollback, retry, or skip and record the status when a complete response is not received within the preset time slot; The mode switching rule is used to pause periodic communication and retain only the non-periodic communication channel when performing dedicated non-periodic services such as firmware upgrades.
7. The method according to claim 1, characterized in that, The implementation protocol application process includes: Channel mapping and category binding are used to map input data, output data, and management data to the uplink, downlink, and management sub-channels of the data link, respectively, and to retain token and address passing sub-channels in the control link; Configuration distribution and consistency verification are used to distribute configurations and receive configuration status identifiers on the data link, and only slave stations that pass the verification are included in the input, output and management data transmission. Packet reassembly and verification constraints are used to transmit three types of data according to the frame structure and packet reassembly rules, and reception is confirmed only when reassembly is completed and verification is passed. State machine maintenance and fault switching are used by the master station to maintain the communication status of the slave station. When a timeout or disconnection occurs, the downlink to the corresponding address is stopped. When the slave station reports with a preset online address, the address and device discovery and configuration distribution are retried. Coordinated scheduling and window allocation are used to complete input data transmission in token order and to schedule and manage data interaction during periodic communication gaps. When processing is not completed, the order is maintained by placeholder responses. Fail-safe and mode switching is used to pause periodic communication and broadcast entry into a fail-safe state when a fail-safe indication is received, and to switch to a data-only management mode when performing dedicated management tasks.
8. The method according to claim 1, characterized in that, The method further includes: Configuration and consistency verification is used by the master station to send a configuration request on the data link and receive a configuration status identifier returned by the slave station. The status identifier is used for parameter reference in subsequent communication processes. The offline and re-entry network processing is used by the master station to maintain the slave station status on the control link and data link according to the reception timeout, stop the downlink output of the address determined to be offline, and trigger the re-execution of the address and device discovery mechanism and the configuration and consistency verification mechanism when the slave station reports with the preset online address.
9. A distributed I / O backplane bus protocol implementation device based on a dual-link architecture, characterized in that, include: The dual-link communication establishment module is used to establish data links and control links in parallel on the backplane, wherein the data link is a differential full-duplex link and the control link is a cascaded unidirectional link. The execution address and device discovery module is used to transmit address seeds on the control link and forward them station by station in cascading order. The matched slave station writes its local address and reports information including device identifier, version and input / output length on the data link. The frame structure and packet subdivision rule definition module is used to set function identifiers, addresses, lengths, data, verification and end fields for service frames, and to set different function identifiers and packet subdivision limits for periodic and non-periodic services respectively. The periodic communication control module is used by the master station to send out output data frames in address order on the data link and send tokens station by station on the control link, so that the slave station that obtains the token can transmit input data on the data link and forward the token to the next slave station, until the polling is completed. The non-periodic communication scheduling module is used to send non-periodic requests from the master station to the target slave station on the data link during periodic communication gaps and complete the response interaction in the queue order. Slave stations that have not completed processing return short responses to maintain the order. The implementation protocol application process module is used to complete the transmission of input data, output data and management data in the distributed input / output backplane according to the dual-link communication, address and device discovery, frame structure and packet rules, periodic communication control and aperiodic communication scheduling.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 8.