IO-Link slave station address dynamic allocation method and related equipment

By constructing a device feature identifier and address conflict detection method, the problem of automatic address allocation when IO-Link slave devices reconnect is solved, realizing automatic device identification and reuse of original addresses, and improving the system's plug-and-play capability and operation and maintenance efficiency.

CN122053564APending Publication Date: 2026-05-15SHENZHEN HUAMAO AOTE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN HUAMAO AOTE TECH CO LTD
Filing Date
2026-02-09
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

When existing IO-Link slave devices are reconnected or replaced, they cannot automatically identify the device and dynamically assign addresses, resulting in cumbersome and error-prone manual configuration, which reduces the system's plug-and-play capability and maintenance efficiency.

Method used

By reading device information from IO-Link slave stations, constructing device feature identifiers, performing hash operations to generate a candidate address set, detecting address conflicts, selecting available addresses for allocation, and establishing a mapping relationship between allocated addresses and device feature identifiers, automated address allocation is achieved.

Benefits of technology

It enables automatic address recognition and reuse of existing addresses when devices are reconnected, improving the system's plug-and-play capability and operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122053564A_ABST
    Figure CN122053564A_ABST
Patent Text Reader

Abstract

The invention provides an IO-Link slave station address dynamic allocation method and related equipment, and the method comprises the steps: carrying out the equipment information reading of a slave station, and constructing an equipment feature identifier comprising equipment identification information and connection information; performing operation on the device feature identifier to obtain a candidate address set; performing address conflict detection on candidate addresses in the candidate address set, selecting an available address as an allocation address according to a detection result, associating the allocation address with the device feature identifier, and generating an address allocation record; and writing the allocation address into a storage unit of the slave station according to the address allocation record, and establishing a mapping relationship between the allocation address and the equipment feature identifier at the master station. According to the method, automatic distribution of slave station addresses is realized through a deterministic address generation mechanism and a conflict detection strategy based on the equipment feature identifier, the equipment identity can be automatically identified and the original address can be reused when the equipment is reconnected, and the plug-and-play capability and the operation and maintenance efficiency of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an IO-Link slave address dynamic allocation method and related equipment. Background Technology

[0002] With the rapid development of smart manufacturing, IO-Link has been widely used as a field-level communication protocol in industrial systems. IO-Link slave devices in distributed IO systems require unique address identifiers for data communication and device management. Traditional address allocation methods mainly rely on manual configuration or fixed allocation strategies based on the physical topology of the devices. This approach requires manual intervention during device installation and replacement, making it cumbersome and prone to errors.

[0003] In existing technologies, the address allocation of IO-Link slave stations mainly has the following problems: when a device is reconnected or replaced, the system cannot automatically identify the device and assign it a suitable address, which requires manual reconfiguration or a complex device identification process to determine the address allocation scheme, reducing the system's plug-and-play capability and operation and maintenance efficiency. Summary of the Invention

[0004] The main objective of this invention is to solve the technical problem that the IO-Link slave address allocation method cannot automatically identify the device identity and dynamically allocate addresses when the device is reconnected or replaced; This invention provides a method for dynamically allocating IO-Link slave addresses, the method comprising: The device information of the IO-Link slave is read to construct a device feature identifier, which includes device identification information and connection information. The device feature identifiers are processed to obtain a set of candidate addresses; Address conflict detection is performed on the candidate addresses in the candidate address set. Based on the detection results, an available address is selected as the allocation address. The allocation address is then associated with the device feature identifier to generate an address allocation record. The allocated address is written into the storage unit of the IO-Link slave station according to the address allocation record, and a mapping relationship between the allocated address and the device feature identifier is established at the master station.

[0005] The present invention also provides an IO-Link slave address dynamic allocation device, the IO-Link slave address dynamic allocation device comprising: The feature construction module is used to read device information from the IO-Link slave station and construct a device feature identifier, which includes device identification information and connection information. The address generation module is used to perform calculations on the device feature identifiers to obtain a set of candidate addresses; The conflict detection module is used to perform address conflict detection on the candidate addresses in the candidate address set, select an available address as the allocation address based on the detection result, associate the allocation address with the device feature identifier, and generate an address allocation record. The address storage module is used to write the allocated address into the storage unit of the IO-Link slave station according to the address allocation record, and to establish a mapping relationship between the allocated address and the device feature identifier at the master station.

[0006] The present invention also provides an IO-Link slave address dynamic allocation device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; the at least one processor invokes the instructions in the memory to cause the IO-Link slave address dynamic allocation device to perform the steps of the above-described IO-Link slave address dynamic allocation method.

[0007] The present invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the above-described IO-Link slave address dynamic allocation method.

[0008] The aforementioned IO-Link slave address dynamic allocation method and related devices involve: reading device information from the slave to construct a device feature identifier including device identification and connection information; performing calculations on the device feature identifier to obtain a candidate address set; performing address conflict detection on the candidate addresses in the candidate address set; selecting an available address as the allocation address based on the detection result; associating the allocation address with the device feature identifier to generate an address allocation record; writing the allocation address into the slave's storage unit based on the address allocation record; and establishing a mapping relationship between the allocation address and the device feature identifier at the master station. This invention, through a deterministic address generation mechanism based on device feature identifiers and a conflict detection strategy, achieves automated slave address allocation. It can automatically identify the device identity and reuse the original address when the device reconnects, improving the system's plug-and-play capability and operational efficiency.

[0009] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0010] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of the first embodiment of the IO-Link slave address dynamic allocation method in this invention; Figure 2 This is a schematic diagram of a second embodiment of the IO-Link slave address dynamic allocation method in this invention. Figure 3 This is a schematic diagram of one embodiment of the IO-Link slave address dynamic allocation device in this invention; Figure 4 This is a schematic diagram of an embodiment of the IO-Link slave address dynamic allocation device in this invention. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0013] The terms "comprising" and "having," and any variations thereof, used in the embodiments of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0014] To facilitate understanding of this embodiment, a detailed description of the IO-Link slave address dynamic allocation method disclosed in this embodiment of the invention will be provided first. For example... Figure 1 As shown, this method includes the following steps: 101. Read device information from the IO-Link slave station and construct a device feature identifier, which includes device identification information and connection information; In this embodiment, the device identification information includes a supplier identifier code and a device type code, and the connection information includes a physical port number and a connection timestamp; the construction of the device feature identifier includes: concatenating the supplier identifier code, device type code, physical port number and connection timestamp according to a preset format to form the device feature identifier.

[0015] Specifically, when an IO-Link slave device connects to a distributed IO network, the master device can read device information from the slave device through the IO-Link communication protocol. It should be noted that the IO-Link protocol specifies a standard parameter reading interface, and the master device can read the slave device description information through the ISDU (Index Service Data Unit) service.

[0016] Specifically, device identification information includes a Vendor ID and a Device ID, which are stored in the slave station's device description file and conform to the standard fields defined in the IO-Link specification. Connection information includes a physical port number and a connection timestamp, where the physical port number indicates the specific port location where the slave station connects to the master station, and the connection timestamp records the moment the slave station accesses the network.

[0017] Based on this, the process of constructing a device identifier may include: after the master station reads the vendor identifier code, device type code, physical port number, and connection timestamp, it concatenates them according to a preset format. This preset format can use a string concatenation method with fixed delimiters; for example, the above four pieces of information can be combined in the format "Vendor ID-Device ID-Port-Timestamp" to form the device identifier. It can be understood that this device identifier uniquely identifies the identity information and connection status of the slave device in the current network environment.

[0018] For example, if a slave device has a vendor identifier of 0x1234, a device type code of 0x5678, is connected to port 3 of the master device, and has a connection timestamp of 1640000000, then the device characteristic identifier of this slave device can be constructed as "1234-5678-3-1640000000". In this way, by combining the device's own identity information and topology connection information, a distinctive characteristic identifier can be generated for each connected slave device.

[0019] 102. Perform calculations on the device feature identifiers to obtain a candidate address set; In this embodiment, the step of performing calculations on the device feature identifier to obtain a candidate address set includes: performing a hash operation on the device feature identifier to obtain a hash value; performing calculations based on the hash value and a preset address space range to obtain a first candidate address; generating multiple alternative candidate addresses based on the first candidate address and a preset offset parameter; and combining the first candidate address and the multiple alternative candidate addresses to form the candidate address set.

[0020] Specifically, a hash operation is performed on the device identifier to obtain a hash value. This hash operation uses a standard hash algorithm, such as MD5 or SHA-256, to convert the variable-length device identifier into a fixed-length hash value. It's important to note that the hash operation ensures that the same device identifier always produces the same hash value. This means that the same slave device can calculate a consistent candidate address when accessing the network multiple times. This characteristic is fundamental to enabling device reconnection identification.

[0021] Based on this, calculations are performed using the hash value and a preset address space range to obtain the first candidate address. IO-Link slave address spaces typically have fixed upper and lower limits; for example, the address range can be set between 1 and 63. The master station maps the hash value to this address space by performing a modulo operation. This mapping process can be represented as: dividing the hash value by the number of available addresses in the address space, taking the remainder, and adding the lower limit value to obtain the first candidate address. It can be understood that the modulo operation evenly distributes hash values ​​of arbitrary size across a finite address space, resulting in a relatively uniform distribution of the first candidate addresses across different devices within the address space.

[0022] However, since hash mapping can lead to address collisions, a single candidate address cannot meet the allocation needs of all scenarios. Therefore, this embodiment introduces a candidate address pool mechanism to generate multiple alternative candidate addresses based on a first candidate address and a preset offset parameter. This generation method can employ a linear probing strategy, that is, based on the first candidate address, subsequent addresses are generated sequentially according to a fixed offset. The offset parameter can be set to a fixed step size, such as offsetting by 3 address units each time. In this way, the generated alternative addresses maintain a certain interval within the address space, reducing the probability of simultaneous collisions between consecutive addresses.

[0023] The first candidate address and several alternative candidate addresses are then combined to form a candidate address set. The addresses in this set are arranged in the order of generation, with the first candidate address having the highest priority because it is directly calculated based on device characteristics and has the strongest correlation with device identity. Alternate candidate addresses serve as backup options and are tried sequentially when a conflict occurs with the first candidate address. The size of the candidate address set can be configured according to the device density and address space in the network; typically, a few candidate addresses are sufficient to meet allocation requirements.

[0024] 103. Perform address conflict detection on the candidate addresses in the candidate address set, select an available address as the allocation address based on the detection result, associate the allocation address with the device feature identifier, and generate an address allocation record; In this embodiment, the step of performing address conflict detection on candidate addresses in the candidate address set and selecting an available address as the allocation address based on the detection result includes: selecting a current candidate address from the candidate address set according to priority order; sending an address query message for the current candidate address to the distributed I / O network; receiving response information and determining whether the current candidate address is occupied based on the response information; if the current candidate address is not occupied, then determining the current candidate address as the allocation address; if the current candidate address is occupied, then selecting the next candidate address according to the priority order, and repeating the sending of the address query message and the receiving of the response information until the allocation address is determined.

[0025] Specifically, the current candidate address is selected from the candidate address set according to priority. In conjunction with the above embodiment, the addresses in the candidate address set have an implicit priority relationship according to their generation order. The first candidate address, since it is directly calculated based on device characteristics, has the highest priority, and the main station prioritizes selecting this address for conflict detection. The design principle of this priority strategy is that the address calculated based on device characteristics has a deterministic association with the device identity. If the address is available, it can maximize the reuse of the original address by the device during reconnection.

[0026] Based on this, an address query message for the current candidate address is sent to the distributed I / O network. This query message is broadcast to all nodes in the network, and its content includes the address information to be queried. It's important to note that upon receiving the query message, each slave device in the distributed I / O network checks whether the address in the message matches its own currently used address. If they match, it responds; otherwise, it does not. The advantage of this mechanism is that it eliminates the need to maintain a centralized address allocation table; each slave device only needs to respond to queries relevant to itself, reducing network communication overhead.

[0027] The system then receives a response message and determines whether the candidate address is currently occupied based on the response. After sending a query message, the master station waits for a preset timeout. If a response message is received within this time, it indicates that a device in the network is using the address, and the candidate address is currently occupied. If no response is received within the timeout period, it indicates that the address is not occupied in the network and can be used as an allocation address. It is understandable that this judgment mechanism relies on the reliability of network communication, and the preset timeout needs to be reasonably configured based on network size and communication latency to avoid misjudgments caused by network jitter.

[0028] If the current candidate address is not occupied, it will be designated as the assigned address. This means that the address conflict detection has passed, and the master station can assign the address to the requesting slave device.

[0029] If the current candidate address is already occupied, the next candidate address is selected according to priority, and the sending of address query messages and the receiving of response information are repeated until an allocation address is determined. This iterative detection process demonstrates the role of the candidate address pool, improving the success rate of address allocation by trying alternative addresses sequentially. Compared to a single candidate address scheme, this embodiment does not need to recalculate the address after the first conflict, but directly selects the next address from the candidate address pool for trying, reducing computational overhead and allocation delay.

[0030] After determining the assigned address, it is associated with the device's characteristic identifier to generate an address allocation record. This record contains information such as the assigned address, device characteristic identifier, and allocation time. The master station stores this record locally for subsequent address management and device reconnection verification. Thus, through distributed conflict detection and priority iteration mechanisms, this embodiment achieves efficient and reliable address allocation.

[0031] Furthermore, the step of receiving response information and determining whether the current candidate address is occupied based on the response information includes: receiving a response message returned by the device occupying the current candidate address, the response message containing the device feature identifier of the occupying device; comparing the device feature identifier of the occupying device with the device feature identifier of the current IO-Link slave station; if the device feature identifier of the occupying device is consistent with the device feature identifier of the current IO-Link slave station, it is determined to be a reconnection of the same device, and the current candidate address is determined as the allocated address; if the device feature identifier of the occupying device is inconsistent with the device feature identifier of the current IO-Link slave station, it is determined to be an address conflict between different devices, the current candidate address is marked as occupied, and the next candidate address is selected according to the priority order.

[0032] Specifically, the address conflict detection process not only determines whether an address is occupied, but also identifies the device occupying the address through a device feature comparison mechanism. This mechanism distinguishes between reconnection attempts by the same device and address conflicts between different devices based on the uniqueness of device identifiers.

[0033] When the master station sends an address query message, if a device in the network is occupying that address, the device will not only reply with the address occupancy status in its response message but also carry its own device identifier. It should be noted that traditional address conflict detection mechanisms only return binary status information, i.e., the address is occupied or not occupied, and cannot identify the occupant device. This embodiment extends the content of the response message, enabling the master station to obtain complete characteristic information of the occupant device, which lays the foundation for subsequent intelligent conflict identification.

[0034] Based on this, the master station compares the device identifier of the occupying device with the device identifier of the currently requesting IO-Link slave station. This comparison process checks each field of the two identifiers to ensure they are completely identical, including the vendor identifier code, device type code, physical port number, and connection timestamp. It's understandable that the way device identifiers are constructed determines their uniqueness; the same device will generate the same identifier when reconnecting to the same port, while different devices or the same device accessing different ports will generate different identifiers.

[0035] If the comparison results show that the device identifier of the occupying device matches the device identifier of the current IO-Link slave, it is determined to be a reconnection of the same device. This means that the slave device has previously accessed the network and been assigned the current candidate address, and this is a reconnection. In this scenario, the address conflict is actually the device itself occupying a historically assigned address, which is a reasonable address reuse situation. Therefore, the master station can directly determine the current candidate address as the assigned address, allowing the device to continue using the original address without reallocation. The advantage of this mechanism is that it can automatically restore the original address when the device reconnects, maintaining the stability of the network topology and avoiding upper-layer application configuration updates caused by address changes.

[0036] If the comparison results show that the device identifier of the occupying device is inconsistent with the device identifier of the current IO-Link slave station, it is determined to be an address conflict between different devices. This indicates that the current candidate address has been occupied by another device, which is a genuine address conflict. In this scenario, the master station marks the current candidate address as occupied and selects the next candidate address to try according to priority. In this way, through device feature comparison, this embodiment can intelligently identify the conflict type and adopt different processing strategies for reconnection of the same device and conflicts between different devices, improving the flexibility and accuracy of address allocation.

[0037] 104. Write the allocated address into the storage unit of the IO-Link slave station according to the address allocation record, and establish a mapping relationship between the allocated address and the device feature identifier at the master station.

[0038] In this embodiment, the allocated address is written to the storage unit of the IO-Link slave station according to the address allocation record. This write operation is implemented through the ISDU service of the IO-Link protocol. The master station sends a parameter write command to the slave station to write the allocated address into the slave station's non-volatile memory, such as EEPROM. It should be noted that the non-volatile memory can retain data after power failure, which ensures that the slave device can read the historically allocated address after power is restored. After receiving the write command, the slave station stores the address information in the designated storage area and returns write confirmation information to the master station, indicating that the address has been successfully saved.

[0039] Based on this, the master station establishes a mapping relationship between allocated addresses and device identifiers locally. This mapping relationship is stored in the master station's memory or database in the form of a data table, recording the device identifier corresponding to each allocated address. This mapping relationship allows the master station to quickly query the corresponding device information based on the address, and also to reverse-engineer the allocated address based on the device identifier. This bidirectional mapping mechanism plays a crucial role during device reconnection. The master station can quickly locate the address previously used by the device through the device identifier and verify whether the address stored by the slave station is consistent with the historical record, thus achieving traceability and consistency verification of address allocation.

[0040] In this embodiment, device information is read from the slave station to construct a device feature identifier including device identification information and connection information; the device feature identifier is processed to obtain a candidate address set; address conflict detection is performed on the candidate addresses in the candidate address set, and an available address is selected as the allocation address based on the detection result. The allocation address is associated with the device feature identifier to generate an address allocation record; the allocation address is written to the slave station's storage unit according to the address allocation record, and a mapping relationship between the allocation address and the device feature identifier is established at the master station. This invention achieves automated allocation of slave station addresses through a deterministic address generation mechanism based on device feature identifiers and a conflict detection strategy. It can automatically identify the device identity and reuse the original address when the device reconnects, improving the system's plug-and-play capability and operation and maintenance efficiency.

[0041] Please see Figure 2 Another embodiment of the IO-Link slave address dynamic allocation method in this application includes: 201. Read device information from the IO-Link slave station and construct a device feature identifier, which includes device identification information and connection information; 202. Perform calculations on the device feature identifiers to obtain a candidate address set; 203. Perform address conflict detection on the candidate addresses in the candidate address set, select an available address as the allocation address based on the detection result, associate the allocation address with the device feature identifier, and generate an address allocation record; In this embodiment, steps 201-203 are similar to steps 101-103 in the first embodiment, and will not be described again here.

[0042] 204. Write the allocated address into the storage unit of the IO-Link slave station according to the address allocation record, and establish a forward mapping table in the master station, using the allocated address as the index key and the device feature identifier as the mapping value; In this embodiment, after the master station completes the address allocation, in addition to persisting the address to the slave station storage unit, it also needs to establish a forward mapping table locally to realize fast query from address to device information.

[0043] Specifically, the forward mapping table uses the allocation address as the index key and the device characteristic identifier as the mapping value. The design principle of this mapping structure is that during network communication, the master station typically identifies and locates slave devices through their addresses, thus requiring the rapid retrieval of detailed characteristic information of the device based on the address. The forward mapping table employs a hash table or associative array data structure, enabling the address-to-device characteristic lookup operation to be completed in constant time complexity.

[0044] The forward mapping table plays a crucial role in address management. When a master station needs to communicate with a slave device at a specific address, it can query this table to obtain the device's complete characteristics, including vendor information, device type, and connection location. This information helps the master station authenticate the device and configure communication parameters. Furthermore, the forward mapping table also supports querying address occupancy status. When a new device requests an address, the master station can quickly determine which addresses are occupied and which are idle by traversing the table.

[0045] 205. Perform a hash operation on the device feature identifier to obtain the device index key; In this embodiment, the hash operation converts a variable-length device feature identifier into a fixed-length index key. The choice of hash algorithm needs to ensure the uniqueness and stability of the output; that is, the same device feature identifier always produces the same index key, while different device feature identifiers should produce different index keys as much as possible. It is understood that the device index key has a shorter length and higher query efficiency compared to the complete device feature identifier, making it suitable for use as an index field in a database or hash table.

[0046] It should be noted that this hash operation can use the same algorithm as the hash operation used to generate candidate addresses in step 102, ensuring consistency in system implementation. The device index key plays a crucial role in the reverse mapping table, enabling the master station to quickly locate the assigned address based on the device identity. 206. Establish a reverse mapping table on the main station, using the device index key as the index key and the allocated address as the mapping value.

[0047] In this embodiment, the reverse mapping table uses the device index key as the index key and the allocated address as the mapping value. This mapping structure complements the forward mapping table; the forward mapping table supports "finding a device with a known address," while the reverse mapping table supports "finding an address with a known device." The main application scenario for the reverse mapping table is device reconnection verification. When a slave device reconnects to the network, the master station can calculate the device index key based on the device's characteristic identifier, and then obtain the historically used addresses of the device by querying the reverse mapping table.

[0048] It's important to note that the reverse mapping table uses the device index key instead of the complete device identifier as its index, which is for query efficiency. The device index key has a fixed length and is hashed, providing faster query speeds. Understandably, the forward and reverse mapping tables together constitute the main station's address management system. The former serves device location during daily communication, while the latter serves address verification during device reconnection, thus achieving a two-way association between address and device identity.

[0049] Furthermore, after establishing the mapping relationship between the allocated address and the device feature identifier at the master station, the method further includes: when an IO-Link slave station reconnects, reading the device feature identifier of the reconnecting slave station; performing a hash operation on the device feature identifier of the reconnecting slave station to obtain a device index key; querying the corresponding historical allocated address in the reverse mapping table according to the device index key; reading the storage address in the storage unit of the reconnecting slave station; if the historical allocated address is consistent with the storage address, the verification is successful, and the storage address continues to be used; if the historical allocated address is inconsistent with the storage address, a re-address allocation process is triggered.

[0050] Specifically, after the master station establishes the mapping relationship, when a slave device reconnects to the network, the master station needs to verify the device's address to determine if it can continue using the original address. This verification mechanism leverages the uniqueness of device identifiers and the fast lookup capability of the bidirectional mapping table to achieve address consistency verification during device reconnection.

[0051] When a reconnection of an IO-Link slave is detected, the master station reads the device's characteristic identifier via the IO-Link protocol. This reading operation is the same as during the initial connection, obtaining information such as the device's vendor identifier, device type code, physical port number, and new connection timestamp. It should be noted that a reconnecting slave may be due to a power outage and restart, network failure recovery, or temporary disconnection. The master station needs to identify whether the device is a previously connected device and verify the legitimacy of its address usage.

[0052] Based on this, a hash operation is performed on the device feature identifier of the reconnected slave station to obtain the device index key. This hash operation is consistent with the algorithm in step 205, ensuring that the same device features generate the same index key. It is understandable that converting the device feature identifier into an index key through hashing enables fast lookups in the reverse mapping table, avoiding the overhead of comparing each field of the complete device feature identifier.

[0053] The system then queries the reverse mapping table for the corresponding historically allocated address based on the device's index key. The reverse mapping table records all devices that have previously connected to the network and their allocated addresses. By querying this table, the master station can determine whether the reconnecting device has been allocated an address historically. If the query result exists, it means the device has previously connected to the network, and the master station can retrieve its historically allocated address. If the query result does not exist, it means the device is connecting for the first time, and the master station can directly execute the normal address allocation process.

[0054] For devices reconnecting with historically assigned addresses, the master station also needs to read the stored address from the slave station's storage unit. This address is the address information that the slave device stored in non-volatile memory when it last connected. By reading the address stored in the slave station's memory, the master station can understand the address that the device believes it should use.

[0055] After obtaining the historically allocated address and the stored address, the master station performs a consistency check. If the historically allocated address matches the stored address, the verification passes, and the master station allows the slave station to continue using the stored address for communication. This means that the device maintains address consistency before and after reconnection, the master station does not need to reassign addresses, and the slave station can immediately resume normal operation. The advantage of this mechanism is that it can quickly restore network connectivity when the device reconnects, reduces the time overhead of address reallocation, and improves network stability and device availability.

[0056] If the historically allocated address is inconsistent with the stored address, it indicates an anomaly in the device address information. This anomaly can be caused by various reasons, such as corrupted data in the slave storage unit, address loss due to device firmware updates, or a missynchronization between the master station's historical records and the slave's actual state. In this case, the master station triggers a re-address allocation process, treating the reconnected slave as a new device and re-executing the complete address allocation process from steps 101 to 104, allocating a new address and updating the mapping relationship. Thus, through a rapid verification mechanism based on a bidirectional mapping table, this embodiment achieves intelligent address management during device reconnection.

[0057] In this embodiment, device information is read from the slave station to construct a device feature identifier including device identification information and connection information; the device feature identifier is processed to obtain a candidate address set; address conflict detection is performed on the candidate addresses in the candidate address set, and an available address is selected as the allocation address based on the detection result. The allocation address is associated with the device feature identifier to generate an address allocation record; the allocation address is written to the slave station's storage unit according to the address allocation record, and a mapping relationship between the allocation address and the device feature identifier is established at the master station. This invention achieves automated allocation of slave station addresses through a deterministic address generation mechanism based on device feature identifiers and a conflict detection strategy. It can automatically identify the device identity and reuse the original address when the device reconnects, improving the system's plug-and-play capability and operation and maintenance efficiency.

[0058] The above describes the IO-Link slave address dynamic allocation method in the embodiments of the present invention. The following describes the IO-Link slave address dynamic allocation device in the embodiments of the present invention. Please refer to [link to IO-Link slave address dynamic allocation device] for details. Figure 3 One embodiment of the IO-Link slave address dynamic allocation device in this invention includes: The feature construction module 301 is used to read device information from the IO-Link slave station and construct a device feature identifier, wherein the device feature identifier includes device identification information and connection information. Address generation module 302 is used to perform calculations on the device feature identifiers to obtain a candidate address set; The conflict detection module 303 is used to perform address conflict detection on the candidate addresses in the candidate address set, select an available address as the allocation address based on the detection result, associate the allocation address with the device feature identifier, and generate an address allocation record. Address storage module 304 is used to write the allocated address into the storage unit of the IO-Link slave station according to the address allocation record, and to establish a mapping relationship between the allocated address and the device feature identifier at the master station.

[0059] In this embodiment of the invention, the IO-Link slave address dynamic allocation device runs the aforementioned IO-Link slave address dynamic allocation method. The device reads device information from the slave station and constructs a device feature identifier including device identification information and connection information. It then performs calculations on the device feature identifier to obtain a candidate address set. Address conflict detection is performed on the candidate addresses in the candidate address set, and an available address is selected as the allocation address based on the detection result. The allocation address is then associated with the device feature identifier to generate an address allocation record. The allocation address is written to the slave station's storage unit based on the address allocation record, and a mapping relationship between the allocation address and the device feature identifier is established at the master station. This invention achieves automated slave address allocation through a deterministic address generation mechanism based on device feature identifiers and a conflict detection strategy. It can automatically identify the device identity and reuse the original address when the device reconnects, improving the system's plug-and-play capability and operational efficiency.

[0060] above Figure 3 The IO-Link slave address dynamic allocation device in this embodiment of the invention is described in detail from the perspective of unitized functional entities. The IO-Link slave address dynamic allocation device in this embodiment of the invention is described in detail from the perspective of hardware processing.

[0061] Figure 4 This is a schematic diagram of the structure of an IO-Link slave address dynamic allocation device 400 provided in an embodiment of the present invention. The IO-Link slave address dynamic allocation device 400 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 410 (e.g., one or more processors) and a memory 420, and one or more storage media 430 (e.g., one or more mass storage devices) storing application programs 433 or data 432. The memory 420 and storage media 430 can be temporary or persistent storage. The program stored in the storage media 430 may include one or more units (not shown in the diagram), each unit may include a series of instruction operations on the IO-Link slave address dynamic allocation device 400. Furthermore, the processor 410 may be configured to communicate with the storage media 430 and execute a series of instruction operations on the storage media 430 on the IO-Link slave address dynamic allocation device 400 to implement the steps of the above-described IO-Link slave address dynamic allocation method.

[0062] The IO-Link slave address dynamic allocation device 400 may also include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input / output interfaces 460, and / or one or more operating systems 431, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 4 The illustrated IO-Link slave address dynamic allocation device structure does not constitute a limitation on the IO-Link slave address dynamic allocation device provided by the present invention. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0063] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the IO-Link slave address dynamic allocation method.

[0064] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0065] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0066] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for dynamically allocating IO-Link slave addresses, characterized in that, The IO-Link slave address dynamic allocation method includes: The device information of the IO-Link slave is read to construct a device feature identifier, which includes device identification information and connection information. The device feature identifiers are processed to obtain a set of candidate addresses; Address conflict detection is performed on the candidate addresses in the candidate address set. Based on the detection results, an available address is selected as the allocation address. The allocation address is then associated with the device feature identifier to generate an address allocation record. The allocated address is written into the storage unit of the IO-Link slave station according to the address allocation record, and a mapping relationship between the allocated address and the device feature identifier is established at the master station.

2. The IO-Link slave address dynamic allocation method according to claim 1, characterized in that, The device identification information includes a supplier identification code and a device type code, and the connection information includes a physical port number and a connection timestamp. The construction device feature identifier includes: The supplier identification code, device type code, physical port number, and connection timestamp are concatenated according to a preset format to form the device feature identifier.

3. The IO-Link slave address dynamic allocation method according to claim 1, characterized in that, The process of performing calculations on the device feature identifier to obtain the candidate address set includes: Perform a hash operation on the device feature identifier to obtain a hash value; The first candidate address is obtained by performing calculations based on the hash value and a preset address space range. Based on the first candidate address and the preset offset parameter, multiple alternative candidate addresses are generated; The first candidate address and the plurality of alternative candidate addresses are combined to form the candidate address set.

4. The IO-Link slave address dynamic allocation method according to claim 1, characterized in that, The step of performing address conflict detection on candidate addresses in the candidate address set and selecting an available address as the allocation address based on the detection result includes: The current candidate address is selected from the candidate address set according to priority order; Send an address query message for the current candidate address to the distributed I / O network; Receive response information and determine whether the current candidate address is occupied based on the response information; If the current candidate address is not occupied, then the current candidate address is determined as the allocated address; If the current candidate address is already occupied, the next candidate address is selected according to the priority order, and the sending of the address query message and the receiving of the response information are repeated until the allocated address is determined.

5. The IO-Link slave dynamic address allocation method according to claim 4, characterized in that, The step of receiving response information and determining whether the current candidate address is occupied based on the response information includes: Receive a response message returned by the device occupying the current candidate address, the response message containing the device characteristic identifier of the occupying device; Compare the device feature identifier of the occupying device with the device feature identifier of the current IO-Link slave station; If the device feature identifier of the occupying device is consistent with the device feature identifier of the current IO-Link slave station, it is determined to be a reconnection of the same device, and the current candidate address is determined as the allocated address; If the device feature identifier of the occupying device is inconsistent with the device feature identifier of the current IO-Link slave, it is determined that there is an address conflict between different devices. The current candidate address is marked as occupied, and the next candidate address is selected according to the priority order.

6. The IO-Link slave address dynamic allocation method according to claim 1, characterized in that, The step of establishing the mapping relationship between the allocated address and the device feature identifier at the main station includes: A forward mapping table is established at the main station, with the allocated address as the index key and the device feature identifier as the mapping value; Perform a hash operation on the device feature identifier to obtain the device index key; A reverse mapping table is established on the main station, with the device index key as the index key and the allocated address as the mapping value.

7. The IO-Link slave address dynamic allocation method according to claim 6, characterized in that, After establishing the mapping relationship between the allocated address and the device feature identifier at the main station, the method further includes: When a reconnection of an IO-Link slave is detected, the device characteristic identifier of the reconnecting slave is read; A hash operation is performed on the device feature identifier of the reconnected slave station to obtain the device index key; The corresponding historical allocation address is retrieved from the reverse mapping table based on the device index key; Read the storage address from the storage unit of the reconnected slave station; If the historical allocation address matches the storage address, the verification is successful, and the storage address can continue to be used. If the historical allocation address is inconsistent with the storage address, a re-address allocation process is triggered.

8. An IO-Link slave address dynamic allocation device, characterized in that, The IO-Link slave address dynamic allocation device includes: The feature construction module is used to read device information from the IO-Link slave station and construct a device feature identifier, which includes device identification information and connection information. The address generation module is used to perform calculations on the device feature identifiers to obtain a set of candidate addresses; The conflict detection module is used to perform address conflict detection on the candidate addresses in the candidate address set, select an available address as the allocation address based on the detection result, associate the allocation address with the device feature identifier, and generate an address allocation record. The address storage module is used to write the allocated address into the storage unit of the IO-Link slave station according to the address allocation record, and to establish a mapping relationship between the allocated address and the device feature identifier at the master station.

9. An IO-Link slave address dynamic allocation device, characterized in that, The IO-Link slave address dynamic allocation device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the IO-Link slave address dynamic allocation device to perform the steps of the IO-Link slave address dynamic allocation method as described in any one of claims 1-7.

10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instruction is executed by the processor, it implements the steps of the IO-Link slave address dynamic allocation method as described in any one of claims 1-7.