Cascading system, data processing method and device and computer equipment
By setting the initialization order of the downstream port of the slave device in the cascade system to be earlier than the initialization order of the upstream port, the expected communication parameters are obtained and reported, which solves the problem of fixed communication strategy in the traditional cascade system, realizes dynamic communication data configuration, and improves the flexibility and adaptability of the system.
Patent Information
- Application Number
- CN202510816049.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-09-12
AI Technical Summary
The traditional cascade system has a fixed communication method, which makes it difficult to adapt to complex industrial scenarios and lacks communication flexibility and scalability.
By setting the initialization time of the first protocol stack of the downstream port in the slave device earlier than the initialization time of the second protocol stack of the upstream port, the slave device obtains the expected communication parameters of the slave device in the next layer after the first protocol stack is initialized, and reports it to the upper layer after the second protocol stack is initialized, so that the master device dynamically configures the global communication data.
The flexibility and scalability of the cascade system are improved, making it adaptable to various complex industrial scenarios and enabling dynamic communication data configuration.
Smart Images

Figure CN120639728A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a cascade system, a data processing method, an apparatus, and a computer device. Background Art
[0002] In traditional industrial automation communication systems, in order to improve the flexibility and scalability of communication, a cascade system is generally adopted, that is, a cascade master station can communicate with multiple layers of cascade slave devices.
[0003] Currently, cascade systems typically use a fixed communication strategy to achieve communication between the cascade master station and multiple layers of cascade slave devices. However, this communication method is relatively limited, making cascade systems difficult to adapt to complex industrial scenarios. Summary of the Invention
[0004] Based on this, it is necessary to provide a cascade system, a data processing method, an apparatus and a computer device that can improve the adaptability of the cascade system in order to address the above technical problems.
[0005] In a first aspect, the present application provides a cascade system, comprising a master station device and at least two layers of slave station devices cascaded in sequence; the slave station device in the first layer communicates with the uplink port of the slave station device in the second layer via a downlink port;
[0006] For any slave device, the initialization time of the first protocol stack of the downlink port in the slave device is earlier than the initialization time of the second protocol stack of the uplink port in the slave device;
[0007] The slave device is used to obtain the expected communication parameters of the slave device in the next layer when the first protocol stack is initialized, and report the expected communication parameters to the slave device in the upper layer when the second protocol stack is initialized;
[0008] The master station device is used to configure communication data between the master station device and the first-layer slave station device based on the expected communication parameters reported by the first-layer slave station device.
[0009] In some embodiments, the at least two layers of slave station devices include a first layer of slave station devices and multiple second layer of slave station devices; the first layer of slave station devices are cascaded to the second layer of slave station devices through different downlink ports.
[0010] In some embodiments, the at least two layers of slave station devices further include a plurality of third layer slave station devices; any second layer slave station device is cascaded to different third layer slave station devices through different downlink ports.
[0011] In a second aspect, the present application further provides a data processing method, which is applied to the above-mentioned cascade system, wherein the system includes a master station device and at least two layers of slave station devices cascaded in sequence; the slave station device in the first layer communicates with the uplink port of the slave station device in the second layer via a downlink port, and the method includes:
[0012] For any slave device, when the first protocol stack of the downstream port in the slave device completes initialization, the slave device obtains the expected communication parameters of the slave device in the next layer through the slave device;
[0013] When the second protocol stack of the upstream port in the slave device is initialized, the slave device reports the expected communication parameters to the upper-layer slave device; the initialization time of the first protocol stack is earlier than the initialization time of the second protocol stack;
[0014] The master device configures communication data between the master device and the first-layer slave devices based on the expected communication parameters reported by the first-layer slave devices.
[0015] In some embodiments, when the second protocol stack of the uplink port in the slave device is initialized, reporting the expected communication parameters to the upper-layer slave device through the slave device includes:
[0016] When the second protocol stack of the upstream port in the slave device is initialized, the slave device aggregates the expected communication parameters of the slave device in the next layer with the expected communication parameters of the slave device to obtain target communication parameters;
[0017] The target communication parameters are reported to the upper-layer slave device through the slave device.
[0018] In some embodiments, the data processing method further includes:
[0019] If the slave device does not obtain the expected communication parameters of the slave device on the next layer within the preset time, it obtains its own port configuration information;
[0020] In a case where the port switching mode exists in the port configuration information, the current port mode of the downstream port in the slave device is adjusted to the port switching mode.
[0021] In some embodiments, the data processing method further includes:
[0022] When the master device completes the communication data configuration, the communication data is sent to the first-layer slave devices through the master device;
[0023] The first-layer slave station device extracts the communication data that matches the first-layer slave station device from the communication data, and sends the remaining communication data to the second-layer slave station device.
[0024] In some embodiments, the expected communication parameters reported by the first-layer slave devices include the expected communication data volume required by each slave device; and the data processing method further includes:
[0025] When the sum of the expected communication data volumes of the slave devices does not exceed the maximum allowable communication data volume of the master device, the first-layer slave devices report the sum of the expected communication data volumes to the master device;
[0026] The master device configures communication data between the master device and the first-tier slave devices based on the expected communication parameters reported by the first-tier slave devices, including:
[0027] The master device configures communication data between the master device and the first-layer slave devices based on the sum of the expected communication data amounts.
[0028] In a second aspect, the present application further provides a data processing device. The device includes:
[0029] A communication parameter acquisition module is used to obtain, for any slave device, the expected communication parameters of the slave device at the next layer through the slave device when the first protocol stack of the downlink port of the slave device is initialized;
[0030] A communication parameter reporting module is used to report the expected communication parameters to the upper-layer slave device through the slave device when the second protocol stack of the upstream port in the slave device is initialized; the initialization time of the first protocol stack is earlier than the initialization time of the second protocol stack;
[0031] The communication data configuration module is used to configure the communication data between the master station device and the first-layer slave station device based on the expected communication parameters reported by the first-layer slave station device through the master station device.
[0032] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned data processing method when executing the computer program.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned data processing method when executed by a processor.
[0034] In a fifth aspect, the present application further provides a computer program product, which includes a computer program that implements the above-mentioned data processing method when executed by a processor.
[0035] The above-described cascade system, data processing method, apparatus, and computer device comprise a master device and at least two layers of slave devices, each cascaded in sequence. A slave device in the first layer communicates with an upstream port of a slave device in the next layer via a downstream port. For any slave device, the initialization time of the first protocol stack of the downstream port of the slave device is earlier than the initialization time of the second protocol stack of the upstream port of the slave device. Consequently, once the first protocol stack has been initialized, the slave device can interact with the slave device in the next layer via the downstream port to proactively obtain the desired communication parameters of the slave device in the next layer. Once the second protocol stack has been initialized, the slave device can report the desired communication parameters to the slave device in the previous layer. By reporting layer by layer, the master device can, based on the desired communication parameters reported by the first layer of slave devices after aggregation, pre-determine the actual communication requirements of each slave device, thereby dynamically configuring global communication data and distributing it to the slave devices in the first layer. This overcomes the communication limitations imposed by traditional fixed communication strategies, effectively improving the flexibility and scalability of the cascade system and adapting it to various complex industrial scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of the structure of a traditional cascade system in one embodiment;
[0037] Figure 2 is an architectural diagram of a cascade module in one embodiment;
[0038] Figure 3 Schematic diagram of a daisy chain topology structure of a cascade system in one embodiment;
[0039] Figure 4 A schematic diagram of a linear topology structure of a cascade system in one embodiment;
[0040] Figure 5 1 is a flow chart of a data processing method in one embodiment;
[0041] Figure 6 A schematic diagram of a process for reporting communication parameters in one embodiment;
[0042] Figure 7 Schematic diagram of the process of port mode switching in one embodiment;
[0043] Figure 8 A schematic diagram of a process for sending communication data in one embodiment;
[0044] Figure 9 is a structural block diagram of a data processing device in one embodiment;
[0045] Figure 10 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0047] It should be noted that the terms "first," "second," etc. used in this application may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "including," "having," and any variations thereof used in this application are intended to cover non-exclusive inclusions. The term "plurality" used in this application refers to two or more.
[0048] In traditional industrial automation communication systems, cascade systems are commonly used to improve communication flexibility and scalability. Figure 1 The figure shows a schematic diagram of the structure of a traditional cascade system, in which the master device can be understood as the control center of the cascade system. The master device communicates with the slave devices through cascade modules to process data from them and control their operations. The master device can specifically be a PLC (Programmable Logic Controller) or a CNC (Computer Numerical Control). Slave devices are devices connected to the master device via cascade ports and can include, but are not limited to, sensors and actuators. It can be understood that the cascade module is a special slave device that supports multi-port forwarding and can be considered an intermediate node used to expand the topology of the cascade system. Figure 2 The cascade module architecture is shown. The cascade module's microcontroller unit (MCU) uses a first communication processor to establish communication between the upstream port and the master device, and multiple second communication processors to establish communication between the multiple downstream ports and multiple slave devices. Each second communication processor corresponds one-to-one with each downstream port, and vice versa. The MCU can also be connected to input and output indicator lights to display the status of input and output signals.
[0049] Currently, due to imperfect signal processing logic within microcontrollers, cascade modules rigidly define communication protocol parameters such as data transmission volume and slave device type. For example, by default, cascade modules transmit only 2 bytes of data. This means that regardless of the requirements of the underlying slave devices, the cascade module is mechanically constrained to 2-byte transmissions. This design leads to problems such as limited data transmission, a limited number of cascade layers, and decreased communication efficiency when the system needs to transmit multiple bytes of data or connect to other types of slave devices. This significantly restricts the scalability and flexibility of the cascade system, making it difficult to adapt to various complex industrial scenarios.
[0050] In order to solve the above problems, the embodiment of the present application provides a cascade system, such as Figure 3 As shown, the cascade system includes a master station device cascaded in sequence, and at least two layers of slave station devices; the slave station device of the previous layer communicates with the upstream port of the slave station device of the next layer through the downstream port; for any slave station device, the initialization time of the first protocol stack of the downstream port in the slave station device is earlier than the initialization time of the second protocol stack of the upstream port in the slave station device; the slave station device is used to obtain the expected communication parameters of the slave station device of the next layer when the first protocol stack is initialized, and report the expected communication parameters to the slave station device of the upper layer when the second protocol stack is initialized; the master station device is used to configure the communication data between the master station device and the slave station device of the first layer based on the expected communication parameters reported by the slave station device of the first layer.
[0051] The master device is the control core of the cascade system, responsible for coordinating the communication behavior of all slave devices and making global parameter decisions. It receives communication requirements reported by first-tier slave devices, dynamically configures communication rules between itself and these devices, and monitors the communication status of each slave device. Slave devices are the execution units of the cascade system, distributed hierarchically and responsible for exchanging data with the master and other slaves. They have both uplink and downlink ports. The uplink port connects to upper-tier devices and is used to communicate with them after the second protocol stack is initialized. This allows them to aggregate and report parameter requirements from lower-tier slave devices and devices in their own layer. The downlink port connects to lower-tier devices and is used to communicate with lower-tier slave devices after the first protocol stack is initialized. This allows them to receive parameter requirements reported by these devices. The first protocol stack is the communication protocol used by the downlink port. Once initialized, it enables communication with lower-tier slave devices. The second protocol stack is the communication protocol used by the uplink port. Once initialized, it enables communication with upper-tier devices. The first and second protocol stacks are identical, such as the IO-Link communication protocol, RS485 communication protocol, RS232 communication protocol, CAN (Controller Area Network) communication protocol, or CAN-FD (CAN with Flexible Data-Rate) communication protocol. The IO-Link communication protocol is a point-to-point, bidirectional communication protocol for industrial automation. The RS485 communication protocol is a differential signal serial communication standard that supports long-distance, multi-point communication. The RS232 communication protocol is an early single-ended signal serial communication standard used for short-distance device interconnection. The CAN communication protocol is a high-reliability, multi-master controlled serial bus protocol. The CAN-FD communication protocol is an upgraded version of the CAN protocol, supporting higher data rates and larger data payloads.
[0052] The initialization time refers to the startup time of the protocol stacks of the upstream port and the downstream port in the slave device. It should be noted that if the upstream port of the slave device is initialized first, then after the upstream port of the slave device is ready, it may immediately try to communicate with the upper-layer device, but at this time the downstream port of the slave device has not been initialized, and it is impossible to obtain the information of the lower-layer slave device. Therefore, the slave device cannot know the parameter requirements of the lower-layer slave device in advance, and then the master device cannot obtain the information of each slave station in the initialization phase to dynamically configure the communication data. The entire cascade system can still only use a fixed communication strategy. Based on this, in this embodiment, for any slave device, the initialization time of the first protocol stack of the downstream port in the slave device is set earlier than the initialization time of the second protocol stack of the upstream port in the slave device, so as to ensure that the slave device first obtains the parameter requirements of the lower-layer slave device and then passes them to the upper-layer device. The expected communication parameters can be understood as the communication rules required for the operation of the slave device of the next layer, which can include but are not limited to at least one of the communication data volume, configuration parameter volume, device type identification, etc. The first-layer slave device refers to the slave device located at the first layer of the cascade in the entire cascade system, and can also be understood as Figure 1 The cascade module in the master station. The first-layer slave station device can have multiple cascade ports (downstream ports), which can be extended downward to connect multiple slave station devices. Therefore, the first-layer slave station device can obtain the expected communication parameters of each slave station device in other cascade layers through each cascade port, and summarize these expected communication parameters and report them to the master station device. The master station device can dynamically configure the communication data based on these communication parameters. Communication data refers to the data sent by the master station device to the slave station device, such as output process data (Process Data Output, PDOUT), configuration parameters of the slave station device, etc., and can also be control instructions such as ISDU (Indexed Service Data Unit) instructions, which are used to implement functions such as parameter reading and writing, device control, etc. of the slave station device.
[0053] Exemplarily, for each slave device, the first protocol stack of the slave device's downlink port is first initialized. After the first protocol stack is initialized, the slave device can obtain the expected communication parameters of the slave device in the next layer through the downlink port. The second protocol stack of the slave device's uplink port is then initialized. When the second protocol stack is initialized, the expected communication parameters of the slave device in the next layer are combined with the slave device's own expected communication parameters and then reported to the slave device's upper layer device via the uplink port. In this way, parameter acquisition and reporting are performed sequentially in a cascade order from bottom to top, ultimately passing them to the first-layer slave device. The first-layer slave device then combines its own expected communication parameters with the received expected communication parameters and reports them to the master device. The master device configures communication data based on these expected communication parameters and sends the communication data to the first-layer slave devices.
[0054] In some embodiments, after receiving communication data from the master, the first-tier slave devices can distribute the communication data according to the desired communication parameters of each slave. After distribution, the first-tier slave devices can continue to periodically receive Process Data Input (PDIN) from each slave device, i.e., data generated during operation by the slave devices, and aggregate and report this data to the master.
[0055] In some embodiments, when any slave device detects a fault, such as a short circuit, communication timeout, etc., it can generate corresponding diagnostic information and pass it to the upper-level slave device. The diagnostic information may include at least one information such as an error code, a fault type, and a fault level. If the upper-level slave device also has a fault, its own diagnostic information can be summarized with the diagnostic information reported by the next slave device and then continued to be reported. If the upper-level slave device does not have a fault, the current level information such as the current level identifier, the current level slave device identifier, etc. can be added to the diagnostic information reported by the next slave device, and the report can be continued after the addition is completed. In this way, the master device can eventually receive a diagnostic report containing the complete fault link, thereby accurately locating the fault location.
[0056] For ease of understanding, the following Figure 3The following cascade system structure diagram is provided as an example. First, parameter reporting begins at the third cascade layer. Downlink port 3.1 of slave device 3-1 is initialized to obtain the expected communication parameters reported by a slave device (not shown) connected to slave device 3-1 in the fourth cascade layer. These acquired expected communication parameters are then combined with slave device 3-1's own expected communication parameters to obtain new expected communication parameters. After upstream port 3.1 is initialized, slave device 3-1 reports these new expected communication parameters to slave device 2-1 in the second cascade layer. At this point, for slave device 2-1, its downlink port 2.1 is initialized earlier than its uplink port 2.1, allowing it to receive the new communication parameters reported by slave device 3-1. Following these steps, slave device 2-1 then combines its own expected communication parameters with the new communication parameters and reports them to slave device 1-1 via the communication link between uplink port 2.1 and downlink port 1.1. Similarly, slave device 1-1 can receive the expected communication parameters reported by slave devices 2-2, 2-3, and 2-n through downlink port 1.2, downlink port 1.3, and downlink port 1.n, respectively. Slave device 1-1 combines all received expected communication parameters with its own expected communication parameters and ultimately reports them to the master device through uplink port 1.1.
[0057] In some embodiments, for any slave device, the initialization time of its downlink port is earlier than the initialization time of the uplink port of the slave device at the next layer. Figure 3 The downlink port 2.1 of the slave device 2-1 is initialized earlier than the uplink port 3.1 of the slave device 3-1. In this case, the downlink port 2.1 can enter a waiting state after initialization is completed, waiting for the uplink port 3.1 to complete initialization and receive the expected communication parameters reported by the slave device 3-1.
[0058] In some embodiments, all downstream ports can be initialized simultaneously after the cascade system is powered on, and enter a waiting state after initialization is completed. After all upstream ports are initialized, they begin to receive the expected communication parameters of the next layer of slave devices and report them to the upper layer of slave devices.
[0059] In some embodiments, if a slave station device does not have a downstream port, or has no slave station device in the next layer connected downward, it only needs to report its own expected communication parameters to the slave station device in the previous layer.
[0060] In some embodiments, in addition to Figure 3 In addition to the daisy chain topology shown, the cascade system in this embodiment can also be a linear topology, such as Figure 4As shown, a linear chain structure is formed between the master device and each slave device (Slave 1, Slave 2, ..., Slave n). Similarly, for each slave device, the initialization time of the downstream port is earlier than the initialization time of the upstream port. Therefore, the desired configuration parameters of each slave device are reported step by step, and finally, slave device 1 summarizes and reports them to the master device, which then configures the communication data based on these desired configuration parameters.
[0061] The cascade system in this embodiment includes a master device and at least two layers of slave devices, each cascaded in sequence. The slave devices in the first layer communicate with the upstream ports of the slave devices in the next layer via their downstream ports. For any slave device, the initialization time of the first protocol stack on the downstream port of the slave device is earlier than the initialization time of the second protocol stack on the upstream port of the slave device. Consequently, once the first protocol stack has completed initialization, the slave device can interact with the slave devices in the next layer via its downstream port, proactively obtaining the desired communication parameters of the slave devices in the next layer. Once the second protocol stack has completed initialization, the slave device can report the desired communication parameters to the slave devices in the previous layer. By reporting layer by layer, the master device can, based on the expected communication parameters reported by the first layer of slave devices, obtain the actual communication requirements of each slave device in advance. It can then dynamically configure global communication data and transmit it to the slave devices in the first layer. This overcomes the communication limitations imposed by traditional fixed communication strategies, effectively improving the flexibility and scalability of the cascade system and adapting it to various complex industrial scenarios.
[0062] In some embodiments, the at least two layers of slave station devices include a first layer of slave station devices and multiple second layer of slave station devices; the first layer of slave station devices are cascaded to the second layer of slave station devices through different downlink ports.
[0063] Among them, the first-tier slave devices are slave devices that communicate directly with the master devices. The second-tier slave devices are located at the next level of the first-tier slave devices. They can be cascade devices that can continue to cascade slave devices, or they can be terminal devices such as sensors and actuators. The second-tier slave devices can be multiple devices, such as Figure 3 The daisy chain topology shown in the figure, of course, the second-level slave device can also be a device, corresponding to Figure 4 A linear topology. The first-tier slave device has multiple independent downstream ports, each of which can connect to a second-tier slave device. For example, a first-tier slave device has three downstream ports (downstream port 1.1, downstream port 1.2, and downstream port 1.3), each of which connects to three different second-tier slave devices (slave device 2-1, slave device 2-2, and slave device 2-3).
[0064] For example, a first-tier slave device can cascade each second-tier slave device through different downlink ports. This allows the first-tier slave device to aggregate the desired communication parameters of all second-tier slave devices and report them to the master device through its uplink port. Communication data sent by the master device can also be received through the uplink port of the first-tier slave device and distributed to the corresponding second-tier slave devices through each downlink port.
[0065] In this embodiment, multiple cascade ports on first-layer slave devices can be used to expand the access capacity of second-layer slave devices, enabling parallel management of multiple second-layer slave devices. Furthermore, different cascade ports can be connected to different slave devices, effectively improving the device compatibility of the cascade system and further enhancing the adaptability of the cascade system.
[0066] In some embodiments, the at least two layers of slave station devices further include a plurality of third layer slave station devices; any second layer slave station device is cascaded to different third layer slave station devices through different downlink ports.
[0067] A Layer 3 slave device is located below a Layer 2 slave device. A Layer 3 slave device can be a cascade device capable of further cascading slave devices, or it can be a terminal device such as a sensor or actuator. Any Layer 2 slave device can be further cascaded to different Layer 3 slave devices through different downstream ports.
[0068] In some embodiments, if a second-layer slave device meets a cascading condition, a third-layer slave device may be cascaded. The cascading condition may refer to hardware or software conditions that support downward expansion of the second-layer slave device, such as at least one of the following: the second-layer slave device has multiple downlink ports and the second-layer slave device supports transparent data forwarding. The specific cascading condition may be determined based on actual needs and is not limited in this embodiment.
[0069] For example, if any Layer 2 slave device meets the cascading conditions, it means that the Layer 2 slave device has cascading capabilities and supports further cascading to other slave devices. In this case, different Layer 3 slave devices can be cascaded through each downstream port of the Layer 2 slave device. Similarly, if any Layer 3 slave device meets the cascading conditions, it can be further cascaded to form a deeper cascade topology. This embodiment is particularly suitable for complex industrial scenarios with large-scale device access, improving the adaptability of the cascade system.
[0070] In some embodiments, as Figure 5 As shown, a data processing method is also provided, which is applied to the above cascade system, and the method includes the following steps:
[0071] Step S502 : for any slave device, when the first protocol stack of the downlink port in the slave device completes initialization, the slave device obtains the desired communication parameters of the slave device in the next layer through the slave device.
[0072] Illustratively, for any slave device in the cascade system, when the first protocol stack of the downstream port in the slave device completes initialization, the desired communication parameters of the slave device in the next layer can be obtained through the slave device.
[0073] In some embodiments, when the first protocol stack of a downstream port in any slave device is initialized and the upstream port of a slave device in the next layer is initialized, the slave device can obtain the expected communication parameters reported by the slave device in the next layer through the slave device. In this case, the initialization time of the first protocol stack of the downstream port in the slave device can be earlier than the initialization time of the second protocol stack of the upstream port in the slave device in the next layer.
[0074] Step S504: When the second protocol stack of the upstream port in the slave device is initialized, the slave device reports the expected communication parameters to the upper-layer slave device; the initialization time of the first protocol stack is earlier than the initialization time of the second protocol stack.
[0075] For example, once the second protocol stack of the upstream port on a slave device has been initialized, the slave device can aggregate the expected communication parameters of the slave devices in the next layer, along with its own expected communication data, and then report them to the slave device in the previous layer. Following this step-by-step reporting process, the expected communication parameters of all slave devices will eventually be transmitted to the first-layer slave devices. The first-layer slave devices will aggregate all received expected communication parameters and their own expected communication parameters before reporting them to the master device.
[0076] Step S506 : The master device configures communication data between the master device and the first-layer slave device based on the desired communication parameters reported by the first-layer slave device.
[0077] For example, after receiving the expected communication parameters reported by the first-layer slave devices, the master device can configure communication data between the master device and the first-layer slave devices based on the expected communication parameters. The master device can then send the communication data to the first-layer slave devices. The first-layer slave devices can then further distribute the communication data to each of the lower-layer slave devices based on their respective expected communication parameters.
[0078] In this embodiment, for any slave device in a cascaded system, when the first protocol stack on the slave device's downstream port completes initialization, the slave device obtains the desired communication parameters of the slave device in the next layer. Furthermore, when the second protocol stack on the slave device's upstream port completes initialization, the slave device reports the desired communication parameters to the slave device in the previous layer. The initialization time of the first protocol stack is earlier than that of the second protocol stack. Thus, once the first protocol stack has completed initialization, the slave device can interact with the slave device in the next layer through the downstream port to proactively obtain the desired communication parameters of the slave device in the next layer. Furthermore, once the second protocol stack has completed initialization, the slave device reports the desired communication parameters to the slave device in the previous layer. By reporting layer by layer, the master device can, based on the expected communication parameters reported by the first-layer slave devices after aggregation, pre-determine the actual communication requirements of each slave device. This allows the master device to dynamically configure global communication data and distribute it to the first-layer slave devices. This overcomes the communication limitations imposed by traditional fixed communication strategies, effectively improving the flexibility and scalability of the cascaded system and adapting it to various complex industrial scenarios.
[0079] In some embodiments, as Figure 6 As shown, when the second protocol stack of the uplink port in the slave device is initialized, the slave device reports the expected communication parameters to the upper-layer slave device, including:
[0080] Step S602: When the second protocol stack of the upstream port in the slave device is initialized, the slave device aggregates the expected communication parameters of the slave device in the next layer with the expected communication parameters of the slave device to obtain target communication parameters.
[0081] Step S604: Report the target communication parameters to the upper-layer slave device through the slave device.
[0082] The target communication parameter is the communication parameter obtained by summing the expected communication parameters of the slave device on the next layer and the slave device on the current layer. For example, if the expected communication parameter is the communication data volume, and the expected communication data volume of the slave device on the next layer is 2 bytes and the expected communication data volume of the slave device on the current layer is 3 bytes, then the target communication parameter is 5 bytes.
[0083] For example, when the second protocol stack of the upstream port of the slave device is initialized, the slave device can aggregate the desired communication parameters of the slave device in the next layer with the desired communication parameters of the slave device itself to obtain aggregated target communication parameters. The slave device can then send the target communication parameters to the slave device in the next layer via the upstream port.
[0084] In some embodiments, after receiving the desired communication parameters from a slave device in the next layer, a slave device may first combine the desired communication parameters with its own desired communication parameters to obtain the target communication parameters. Once the second protocol stack on the upstream port of the slave device is initialized, the target communication parameters can be directly reported to the slave device in the next layer. This reduces parameter transmission time and improves communication speed.
[0085] In this embodiment, the expected communication parameters of each slave device are summarized and reported to the master device, so that the master device can know the communication requirements of each slave device in advance, thereby dynamically configuring the communication data, significantly improving the data configuration flexibility of the cascade system and making it more suitable for various complex industrial scenarios.
[0086] In some embodiments, as Figure 7 As shown, the data processing method further includes:
[0087] Step S702: If the slave device fails to obtain the expected communication parameters of the slave device at the next layer within a preset time, it obtains its own port configuration information.
[0088] The preset time can be a pre-set time threshold, such as 3 seconds or 5 seconds, depending on the actual situation. The preset time can be used to determine whether the slave device successfully obtains the expected communication parameters of the next-level slave device within the specified time. Port configuration information is information used to describe the port configuration of the slave device, such as at least one of the following information: port mode switching conditions, port switching mode, and port protocol stack. The port mode switching condition can refer to the prerequisite for triggering the port mode switch, that is, the slave device fails to obtain the expected communication parameters of the next-level slave device within the preset time. Of course, in actual applications, other port mode switching conditions can also be set as needed. The port switching mode is the specific port mode to be switched, such as IO-link mode, SIO (Standard I / O) mode, and so on.
[0089] For example, if a slave device fails to obtain the desired communication parameters of the slave device in the next layer within a preset time, this means that the slave device is not connected to the slave device in the next layer, or the slave device in the next layer is not powered on, or there is a communication link failure between the slave device and the slave device in the next layer. In this case, the slave device MCU can further obtain its own port configuration information to switch the port mode, aiming to downgrade to a low-performance but stable port mode to maintain basic communication functions. At this point, the slave device can no longer continue to obtain the desired communication parameters of the slave device in the next layer.
[0090] In some embodiments, if the slave device obtains the expected communication parameters of the slave device at the next layer within a preset time, there is no need to switch the port mode.
[0091] Step S704: When the port switching mode exists in the port configuration information, the current port mode of the downlink port in the slave device is adjusted to the port switching mode.
[0092] The current port mode refers to the current mode of the downstream port in the slave device.
[0093] For example, if the port switching mode exists in the port configuration information, the slave device may automatically adjust the current port mode of the downstream port to the port switching mode. If the port switching mode does not exist in the port configuration information, or if the port switching mode is consistent with the current port mode, the current port mode remains unchanged and the desired communication parameters of the slave device at the next level are obtained.
[0094] In some embodiments, the slave device MCU may pre-store port configuration information. Thus, if a slave device fails to obtain the desired communication parameters of the next-level slave device within a preset time, the slave device MCU can directly retrieve the port switching mode from the port configuration information and perform port mode switching. Alternatively, a user can trigger a port mode modification command via the cascade system's HMI (Human Machine Interface). The slave device MCU can then extract the user-indicated port mode from the command and perform port mode switching.
[0095] For example, assume that the current port mode of a downstream port on a slave device is IO-Link. If the slave device fails to obtain the expected communication parameters from the next-level slave device within a preset time, and the port switching mode is SIO, the IO-Link mode can be automatically switched to SIO. If no port switching mode exists, or the port switching mode is also IO-Link, the current port mode remains unchanged.
[0096] In this embodiment, when the slave device fails to obtain the expected communication parameters of the slave device in the next layer within the preset time, the port mode is switched to a low-performance but stable port mode to maintain basic communication functions, thereby saving communication resources.
[0097] In some embodiments, as Figure 8 As shown, the data processing method further includes:
[0098] Step S802: When the master station device completes the communication data configuration, the communication data is sent to the first-layer slave station devices via the master station device.
[0099] For example, when the master device completes the communication data configuration based on the expected communication parameters reported by the first-layer slave devices, the master device can send the configured global communication data to the first-layer slave devices, and the first-layer slave devices will distribute the communication data.
[0100] Step S804: The first-layer slave station device extracts communication data that matches the first-layer slave station device from the communication data, and sends the remaining communication data to the second-layer slave station device.
[0101] The remaining communication data refers to the communication data excluding the communication data matching the first-tier slave devices. For example, assume the total expected communication data volume of each slave device is 6 bytes, including 2 bytes of the first-tier slave device's own expected communication data volume, 2 bytes of the second-tier slave device A connected to the first-tier slave device via downstream port 1, and 2 bytes of the second-tier slave device B connected to the first-tier slave device via downstream port 2. In this case, the master device can configure 5 bytes of communication data. This communication data is first transmitted to the first-tier slave devices. The first-tier slave devices extract the 2 bytes of data they need. The data is then distributed to the second-tier slave devices A and B via downstream port 1 and downstream port 2, respectively, according to their respective expected communication data volumes. Specifically, 2 bytes of data are transmitted to the second-tier slave device A via downstream port 1, and 2 bytes of data are transmitted to the second-tier slave device B via downstream port 2. In other words, the communication data sent by the master device matches the target communication parameters reported by the first-layer slave devices. In this way, the master device can accurately send communication data according to the communication needs of each slave device, thereby improving the communication efficiency of the cascade system.
[0102] In some embodiments, the expected communication parameters reported by the first-layer slave station device include the expected communication data volume required by each slave station device; the data processing method also includes: when the sum of the expected communication data volume of each slave station device does not exceed the maximum allowable communication data volume of the master station device, the sum of the expected communication data volume is reported to the master station device through the first-layer slave station device.
[0103] The maximum allowable communication data volume may refer to the upper limit of the total data volume that can be processed by the master station device in a single communication cycle. For example, the master station device allows a maximum of 32 bytes of communication data to be transmitted in a single time.
[0104] For example, when a first-tier slave device receives the expected communication data volumes reported by each slave device in its lower tier, it can first perform a data verification, specifically checking whether the sum of the expected communication data volumes exceeds the upper limit of the total data volume that the master device can process within a single communication cycle. If it does not exceed the upper limit, meaning the sum of the expected communication data volumes is less than or equal to the maximum allowable communication data volume of the master device, the verification is considered passed, and the sum of the expected communication data volumes can be reported to the master device. If it exceeds the upper limit, meaning the sum of the expected communication data volumes is greater than the maximum allowable communication data volume of the master device, the verification is considered failed, and the reporting strategy can be dynamically adjusted, such as by reporting in batches based on the priority of each slave device.
[0105] In some embodiments, the above verification process can also be performed by the master device. That is, after receiving the sum of the expected communication data volumes reported by the first-layer slave devices, the master device verifies whether it exceeds its own maximum allowable communication data volume. If it does not exceed, the communication data is directly configured based on the sum of the expected communication data volumes. If it does exceed, the communication data of the slave devices with higher priority is preferentially configured according to the priority of each slave device.
[0106] In some embodiments, the communication data between the master station device and the first-layer slave station device is configured by the master station device based on the expected communication parameters reported by the first-layer slave station device, including: configuring the communication data between the master station device and the first-layer slave station device based on the sum of the expected communication data volumes by the master station device.
[0107] Exemplarily, the master station device may configure communication data that matches the sum of the expected communication data volumes of the slave station devices based on the sum of the expected communication data volumes, and send the communication data to the first-layer slave station devices.
[0108] In this embodiment, by checking whether the sum of the communication data volume required by each slave device exceeds the maximum allowable communication data volume of the master device, the master device can be prevented from being overloaded, thereby ensuring the stability of the cascade system.
[0109] In a specific embodiment, the cascade system is an IO-Link cascade system, which includes IO-Link master devices and at least two layers of IO-Link slave devices connected in sequence. The at least two layers of slave devices include a first-layer slave device and multiple second-layer slave devices. The first-layer slave device is an IO-Link hub. The IO-Link hub communicates with the IO-Link master device through an IO-Link upstream port and with multiple second-layer slave devices through multiple IO-Link downstream ports. The second-layer slave devices can be sensors, actuators, and other devices. The slave devices in the previous layer communicate with the upstream ports of the slave devices in the next layer through the downstream ports.
[0110] For any IO-link slave device, the initialization time of the first protocol stack of its IO-link downstream port is earlier than the initialization time of the second protocol stack of its IO-link upstream port, and the first protocol stack and the second protocol stack can both be IO-link communication protocol stacks. When the first protocol stack completes initialization, the IO-link slave device obtains the process data volume required by the IO-link slave device of the next layer. If the IO-link slave device does not obtain the process data volume of the IO-link slave device of the next layer within the preset time, it automatically switches its downstream port from the current IO-link mode to the SIO mode and no longer obtains data downward. When the second protocol stack completes initialization, the IO-link slave device reports the process data volume to the IO-link slave device of the upper layer. The IO-link slave device of the upper layer will aggregate the process data volume required by the IO-link slave device of the next layer with the process data volume required by itself to obtain a new process data volume, and continue to report it to the IO-link slave device of the upper layer. Finally, the IO-Link Hub aggregates the process data volume it needs with the process data volume received through the IO-Link downstream port, and reports the total process data volume to the IO-Link master device if the total process data volume does not exceed the upper limit of the total data volume that the IO-Link master can process in a single communication cycle.
[0111] Based on the total process data volume reported by the IO-Link hub, the IO-Link master configures output process data or control instructions that match the total process data volume and sends these to the IO-Link hub. The IO-Link hub distributes these output process data or control instructions to each IO-Link slave device based on the process data volume required by each IO-Link slave device. The IO-Link hub also collects the input process data reported by each IO-Link slave device, aggregates it, and feeds it back to the IO-Link master.
[0112] In the IO-link cascade system of this embodiment, for any IO-link slave device, the initialization time of the first protocol stack of its downstream port is earlier than the initialization time of the second protocol stack of the upstream port. Therefore, when the first protocol stack is initialized, the IO-link slave device can interact with the IO-link slave device of the next layer through the downstream port and actively obtain the process data volume of the IO-link slave device of the next layer. And when the second protocol stack is initialized, the process data volume is reported to the IO-link device of the upper layer. By reporting layer by layer, the IO-link master device can eventually know the actual communication needs of each IO-link slave device in advance based on the sum of the process data volume reported after the IO-link HUB is aggregated, so as to dynamically configure the global output process data or control instructions and send them to the IO-link HUB. It breaks the communication limitations brought by traditional fixed communication strategies, effectively improves the flexibility and scalability of the IO-link cascade system, and can adapt to various complex industrial scenarios.
[0113] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0114] Based on the same inventive concept, the present application also provides a data processing device for implementing the aforementioned data processing method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more data processing device embodiments provided below can be found in the above-mentioned limitations on the data processing method and will not be repeated here.
[0115] In some embodiments, as Figure 9 As shown, a data processing device is provided, comprising:
[0116] The communication parameter acquisition module 902 is configured to acquire, for any slave device, the desired communication parameters of the slave device at the next layer through the slave device when the first protocol stack of the downlink port of the slave device is initialized;
[0117] The communication parameter reporting module 904 is configured to report the desired communication parameters to the upper-layer slave device through the slave device when the second protocol stack of the upstream port in the slave device is initialized; the initialization time of the first protocol stack is earlier than the initialization time of the second protocol stack;
[0118] The communication data configuration module 906 is configured to configure the communication data between the master device and the first-layer slave devices based on the desired communication parameters reported by the first-layer slave devices through the master device.
[0119] In some embodiments, the communication parameter reporting module 904 is also used to: when the second protocol stack of the upstream port in the slave station device is initialized, the expected communication parameters of the next layer of slave station devices and the expected communication parameters of the slave station device are summarized through the slave station device to obtain the target communication parameters; and the target communication parameters are reported to the upper layer of slave station devices through the slave station device.
[0120] In some embodiments, the data processing device is also used to: if the slave station device fails to obtain the expected communication parameters of the next-layer slave station device within a preset time, obtain its own port configuration information; if there is a port switching mode in the port configuration information, adjust the port switching mode of the current port mode of the downstream port in the slave station device.
[0121] In some embodiments, the data processing device is also used to: when the master station device completes the communication data configuration, send the communication data to the first-layer slave station device through the master station device; the first-layer slave station device extracts the communication data that matches the first-layer slave station device from the communication data, and sends the remaining communication data to the second-layer slave station device.
[0122] In some embodiments, the expected communication parameters reported by the first-layer slave station device include the expected communication data volume required by each slave station device; the data processing device is also used to: when the sum of the expected communication data volume of each slave station device does not exceed the maximum allowable communication data volume of the master station device, report the sum of the expected communication data volume to the master station device through the first-layer slave station device.
[0123] In some embodiments, the communication data configuration module 906 is further configured to: configure the communication data between the master device and the first-layer slave devices based on the sum of the expected communication data volumes through the master device.
[0124] Each module in the above-mentioned data processing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0125] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. Among them, the processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and passing capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the above-mentioned data processing process. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method is implemented.
[0126] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0127] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above method embodiment when executing the computer program.
[0128] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method embodiment are implemented.
[0129] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the above method embodiment when executed by a processor.
[0130] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of such data must comply with the relevant laws, regulations, and standards of the relevant regions and areas. Furthermore, the user may choose not to authorize the use of such information and related data, or may refuse or conveniently refuse to receive push notifications.
[0131] In this application, when collecting and processing relevant data in actual applications, the requirements of relevant local laws and regulations should be strictly followed to obtain the informed consent or separate consent of the personal information subject, and subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0132] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processors (GPUs), digital signal processors (DSPs), programmable logic devices (PLCs), and the like.
[0133] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0134] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A cascade system, characterized in that: The system includes a master station device and at least two layers of slave station devices connected in cascade order; the slave station device in the first layer communicates with the upstream port of the slave station device in the second layer via the downstream port; For any of the slave station devices, the initialization time of the first protocol stack of the downlink port in the slave station device is earlier than the initialization time of the second protocol stack of the uplink port in the slave station device; The slave device is configured to obtain expected communication parameters of a slave device in a next layer when the first protocol stack is initialized, and report the expected communication parameters to a slave device in an upper layer when the second protocol stack is initialized; The master station device is used to configure communication data between the master station device and the slave station device based on the expected communication parameters reported by the first-layer slave station device.
2. The system according to claim 1, wherein: The at least two layers of slave station devices include a first layer of slave station devices and a plurality of second layer of slave station devices; the first layer of slave station devices are cascaded to the second layer of slave station devices respectively through different downlink ports.
3. The system according to claim 2, characterized in that The at least two layers of slave station devices further include a plurality of third layer slave station devices; any of the second layer slave station devices is cascaded to different third layer slave station devices via different downlink ports.
4. A data processing method, characterized in that: Applicable to the cascade system according to any one of claims 1 to 3, the system comprising a master station device and at least two layers of slave station devices cascaded in sequence; The slave station device of the previous layer communicates with the upstream port of the slave station device of the next layer via the downstream port, and the method includes: For any of the slave station devices, when the first protocol stack of the downlink port in the slave station device completes initialization, obtaining the expected communication parameters of the slave station device in the next layer through the slave station device; When the second protocol stack of the uplink port in the slave device is initialized, the expected communication parameters are reported to the upper-layer slave device through the slave device; the initialization time of the first protocol stack is earlier than the initialization time of the second protocol stack; The master station device configures communication data between the master station device and the slave station device based on the expected communication parameters reported by the first-layer slave station device.
5. The method according to claim 4, characterized in that When the second protocol stack of the uplink port in the slave device is initialized, reporting the expected communication parameter to an upper-layer slave device through the slave device includes: When the second protocol stack of the uplink port in the slave device is initialized, the slave device aggregates the expected communication parameters of the slave device in the next layer with the expected communication parameters of the slave device to obtain target communication parameters; The target communication parameter is reported to an upper-layer slave device through the slave device.
6. The method according to claim 4, characterized in that The method further comprises: If the slave device fails to obtain the expected communication parameters of the slave device at the next layer within a preset time, the slave device obtains its own port configuration information; In a case where a port switching mode exists in the port configuration information, the current port mode of the downlink port in the slave device is adjusted to the port switching mode.
7. The method according to claim 4, characterized in that The method further comprises: When the master station device completes the communication data configuration, the communication data is sent to the first-layer slave station device through the master station device; The first-layer slave station device extracts the communication data that matches the first-layer slave station device from the communication data, and sends the remaining communication data to the second-layer slave station device.
8. The method according to claim 4, characterized in that The expected communication parameters reported by the first-layer slave device include the expected communication data volume required by each of the slave devices; the method further includes: When the sum of the expected communication data volumes of the slave station devices does not exceed the maximum allowable communication data volume of the master station device, reporting the sum of the expected communication data volumes to the master station device through the first-layer slave station device; Configuring communication data between the master device and the first-layer slave device based on the expected communication parameters reported by the first-layer slave device by the master device includes: The master device configures communication data between the master device and the first-layer slave devices based on the sum of the expected communication data amounts.
9. A data processing device, characterized in that: Applied to the data processing method according to claim 4, the apparatus comprises: a communication parameter acquisition module, configured to acquire, for any of the slave station devices, expected communication parameters of a slave station device at a next layer through the slave station device when the first protocol stack of the downlink port in the slave station device completes initialization; a communication parameter reporting module, configured to report the expected communication parameters to an upper-layer slave device through the slave device when the second protocol stack of the uplink port in the slave device is initialized; the initialization time of the first protocol stack is earlier than the initialization time of the second protocol stack; The communication data configuration module is used to configure the communication data between the master station device and the first-layer slave station device based on the expected communication parameters reported by the first-layer slave station device through the master station device.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 4 to 8 are implemented.