Network system message batch addressing method and equipment

By using batch addressing operations and the ADP, ADO, and PduLen fields to clearly define the slave station range and data area, the problem of low data interaction efficiency in industrial systems is solved, and efficient and accurate data transmission is achieved.

CN121603474APending Publication Date: 2026-03-03深圳市三旺通信股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511775782.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In industrial systems, the data interaction efficiency between the master station and multiple slave stations is low, and the existing fixed protocol format results in excessively long data interaction delays.

Method used

Batch addressing is adopted, with the ADP field indicating the number of slaves, the ADO field determining the starting address of the target register, and the PduLen field determining the length of the data area. The data is divided into Area regions corresponding to the slaves, and batch addressing data frames are sent at once, simplifying the data interaction process.

Benefits of technology

It improves data interaction efficiency, reduces the number of communications and network load, shortens the overall communication time, and ensures the accuracy and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121603474A_ABST
    Figure CN121603474A_ABST
Patent Text Reader

Abstract

The invention discloses a network system message batch addressing method and device, and relates to the technical field of data processing, and the method comprises the steps: responding to a batch addressing operation, determining a target slave station range corresponding to the batch addressing operation, sending a station-by-station marking data frame to a slave station, and writing the number of target slave stations into an ADP field; writing a target register head address corresponding to the target slave station into an ADO field; according to the sum of the length values of the content data stored in the target register physical area of each target slave station or the sum of the length values of the Message message content, determining the total length of the DATA area of the batch addressing data frame, and writing the total length into a PDuLen field; dividing the DATA area into Area areas according to the total length of the DATA area, the PDuLen field, the ADP field and the relative sequence position stored by the sequence register address of the target slave station; and sending the configured batch addressing data frame to the target slave station.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method and device for batch addressing of network system messages. Background Technology

[0002] Currently, in industrial systems, data exchange between the master station and multiple slave stations uses fixed protocol formats. These protocols employ static frame structures, where field layouts, operation types, and register mappings are determined during the protocol definition phase. When simultaneously reading and writing to a set of different registers, the master station is required to split the complete mixed operation into multiple frames for independent transmission, which prolongs the overall data exchange latency and results in low data exchange efficiency in industrial systems.

[0003] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main purpose of this application is to provide a method and device for batch addressing of network system messages, which aims to solve the technical problem of low data interaction efficiency in industrial systems.

[0005] To achieve the above objectives, this application proposes a method for batch addressing of network system packets, applied to a master station. The method includes: In response to a batch addressing operation, the range of slave stations corresponding to the target slave station for this batch addressing operation is determined. After sending a station-by-station marking data frame to the slave station, the number of slave stations of the target slave station is written into the ADP field of the batch addressing data frame. Write the starting address of the target register corresponding to the target slave station into the ADO field of the batch addressing data frame; The total length of the DATA area of ​​the batch addressing data frame is determined based on the sum of the length values ​​of the content data stored in the physical area of ​​the target register of each target slave station or the sum of the length values ​​of the Message message content, and written to the PduLen field of the batch addressing data frame. Based on the total length of the DATA region, the PduLen field, the ADP field, and the relative sequence position stored in the sequence register address of the target slave station, the DATA region is divided into Area regions that correspond one-to-one with the target slave station. The configured batch addressing data frame is sent to the target slave station.

[0006] In one embodiment, the step of determining the total length of the DATA area of ​​the bulk addressing data frame based on the sum of the length values ​​of the content data stored in the physical region of the target register of each of the target slave stations or the sum of the length values ​​of the Message message content, and writing it into the PduLen field of the bulk addressing data frame, includes: When the batch addressing data frame is a regular instruction type, the TYPE field of the batch addressing data frame is configured with the identifier value corresponding to the regular instruction type; The total length of the DATA region of the batch addressing data frame is determined by summing the length values ​​of the content data stored in the physical region of the target register of the target slave station, and then written into the PduLen field of the batch addressing data frame.

[0007] In one embodiment, the step of determining the total length of the DATA area of ​​the bulk addressing data frame based on the sum of the length values ​​of the content data stored in the physical region of the target register of each of the target slave stations or the sum of the length values ​​of the Message message content, and writing it into the PduLen field of the bulk addressing data frame, includes: When the batch addressing data frame is a fixed protocol type, the TYPE field of the batch addressing data frame is configured with the identifier value corresponding to the fixed protocol type; The total length of the DATA area of ​​the batch addressing data frame is determined by summing the length values ​​of the Message content of each target slave station, and then written into the PduLen field of the batch addressing data frame.

[0008] In one embodiment, after the step of dividing the DATA region into Area regions corresponding one-to-one with the target slave station based on the total length of the DATA region, the PduLen field, the ADP field, and the relative sequence position stored in the sequence register address of the target slave station, the method further includes: Write the addressing mode of the batch addressing operation into the CMD field of the batch addressing data frame; If the addressing mode is batch read mode, then each Area region is configured to the initial state to read the content data corresponding to the target slave station; If the addressing mode is batch write or batch read / write, then the content data corresponding to the target slave station is written sequentially into each of the Area regions.

[0009] In one embodiment, the step of sending station-by-station marked data frames to slave stations includes: In response to the station-by-station marking operation, the initial sequence value of the RSP field of the station-by-station marking data frame is configured, and the configured station-by-station marking data frame is sent to each of the slave stations to set the relative sequence position of the slave stations station by station.

[0010] Furthermore, to achieve the above objectives, this application also proposes a network system packet batch addressing method, applied to slave stations, wherein the network system packet batch addressing method includes: Receive batch addressing data frames sent by the master station, and parse the TYPE and CMD fields of the batch addressing data frames to determine the message type and addressing mode; When the message type is a regular instruction type, the target register is determined according to the register start address corresponding to the ADO field of the bulk addressing data frame, and the Area region corresponding to the target register is determined according to the local stored relative sequence position, the PduLen field and the ADP field of the bulk addressing data frame. When the addressing mode is batch read mode, the content data is read from the target register and filled into the Area region; When the addressing mode is batch write mode, the load data in the corresponding Area region is written to the target register; When the addressing mode is batch write-read mode, the load data in the corresponding Area is written to the target register, and the original content data in the target register is read and filled back into the corresponding Area to realize data exchange.

[0011] In one embodiment, after the steps of receiving the batch addressing data frame sent by the master station and parsing the TYPE and CMD fields of the batch addressing data frame to determine the message type and addressing mode, the method further includes: When the message type is a fixed protocol type, the target register is determined according to the register start address corresponding to the ADO field of the bulk addressing data frame, and the Area region corresponding to the target register is determined according to the local stored relative sequence position, the PduLen field and the ADP field of the bulk addressing data frame. The mapping relationship between the target register and the Area region is determined based on the message field and register physical area mapping table of the batch addressing under the fixed protocol type corresponding to the TYPE field. When the addressing mode is batch read mode, the content data is read from the target register according to the mapping relationship and filled into the Area region; When the addressing mode is batch write mode, the load data in the Area region is written to the target register according to the mapping relationship; When the addressing mode is batch write-read mode, the corresponding batch write-read operation is executed according to the batch write-read operation mode in the mapping table between the message field and the register physical area under the fixed protocol type. The batch write-read operation mode includes retention operation, write operation, read operation and exchange operation. The direction of the operation includes forward transmission from the master station to the slave station and reverse transmission from the slave station to the master station.

[0012] In one embodiment, before the step of receiving the batch addressing data frame sent by the master station and parsing the TYPE and CMD fields of the batch addressing data frame to determine the message type and addressing mode, the following steps are included: Receive station-by-station marked data frames, parse the sequence value of the relative sequence position corresponding to the RSP field, perform an increment operation on the sequence value, use the incremented sequence value as the field value of the RSP field, and update the RSP field; The incremented field value is written to the sequence register address of the slave station corresponding to the SRA field of the station-by-station marker data frame; The updated station-by-station labeled data frame is forwarded to the next slave station in the network.

[0013] In one embodiment, before the step of receiving the batch addressing data frame sent by the master station and parsing the TYPE and CMD fields of the batch addressing data frame to determine the message type and addressing mode, the method further includes: Receive and parse the ADP field of the batch addressing data frame, and compare it with the relative sequence position in the sequence register address set by marking the data frame station by station; If the relative sequence position is non-negative and less than the ADP field in the message, then the steps of receiving the batch addressing data frame sent by the master station are executed, and the TYPE field and CMD field of the batch addressing data frame are parsed to determine the message type and addressing mode are determined. If the relative sequence position is negative or greater than or equal to the ADP field in the message, it is determined that it is not within the current batch addressing range, and the batch addressing operation is terminated.

[0014] In addition, to achieve the above objectives, this application also proposes a network system packet bulk addressing device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the network system packet bulk addressing method described above.

[0015] This application provides a batch addressing method for network system packets. The ADP field identifies the number of slave stations involved in the batch operation, clearly defining the target slave station range. The ADO field determines the starting address of the target register for each target slave station, enabling data to be directly located to the target storage location, improving the accuracy of single data interaction. The PduLen field accurately defines the total length of the DATA area, rationally dividing the DATA area into Area regions corresponding one-to-one with the target slave stations. This ensures that each slave station's data has an independent and clearly defined storage space within the batch addressing data frame, facilitating rapid data location and retrieval by the slave station and reducing data parsing complexity. By sending the fully configured batch addressing data frame to all target slave stations at once, the cumbersome process of one-to-one communication between the master and slave stations is avoided, reducing the number of communication attempts and network transmission time, thus improving data transmission efficiency. Through the above process, this application solves the problem of low data interaction efficiency in mixed operation scenarios using traditional fixed protocols, achieving the technical effect of improving the data interaction efficiency of industrial systems. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating an embodiment of the network system packet batch addressing method of this application. Figure 2 A schematic diagram of the PDU format of the batch addressing data frame provided for the batch addressing method of the network system message in this application; Figure 3 A schematic diagram of the PDU format of the batch addressing data frame for the fixed protocol type Message content provided by the batch addressing method for network system messages in this application; Figure 4 A schematic diagram of the data frame format for network transmission provided by the network system message bulk addressing method of this application; Figure 5 This is a schematic diagram of the PDU message format for station-by-station marking of data frames in the network system message batch addressing method of this application; Figure 6 A linear mapping diagram between message fields and register contents of a conventional instruction-type bulk addressing data frame provided for the network system message bulk addressing method of this application; Figure 7 A nonlinear mapping diagram between message fields and register contents of a fixed protocol-type bulk addressing data frame provided for the network system message bulk addressing method of this application; Figure 8 A schematic diagram illustrating the connection method and data frame transmission of the master station and multiple slave stations provided for the batch addressing method of the network system messages in this application; Figure 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the network system packet batch addressing method in the embodiments of this application.

[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0022] Currently, in industrial systems, data exchange between the master station and multiple slave stations uses fixed protocol formats. These protocols employ static frame structures, where field layouts, operation types, and register mappings are determined during the protocol definition phase. When simultaneously reading and writing to a set of different registers, the master station is required to split the complete mixed operation into multiple frames for independent transmission, which prolongs the overall data exchange latency and results in low data exchange efficiency in industrial systems.

[0023] This application employs a batch addressing operation method, allowing the master station to send data frames to multiple target slave stations simultaneously without requiring individual communication with each slave station. This reduces the number of communications, lowers network load, improves data exchange efficiency, and shortens overall communication time. By rationally dividing the DATA area into Area areas corresponding one-to-one with the target slave stations, the master station can organize the data from different slave stations in an orderly manner within the DATA area according to certain rules. After receiving a data frame, the slave station can quickly locate its corresponding data area, thereby accelerating data processing speed and improving data exchange efficiency.

[0024] It should be noted that the executing entity in this embodiment can be a network system packet bulk addressing device, or a computing service device with data processing, network communication, and program execution functions, such as a computer, sensing device, execution device, embedded device, etc., or a control device capable of implementing the above functions of a network system packet bulk addressing device, etc. This embodiment does not specifically limit it in this way. The following uses a network system packet bulk addressing device as the executing entity as an example to describe this embodiment and the following embodiments.

[0025] Example 1 Based on this, this application proposes a network system packet batch addressing method according to the first embodiment, applied to the main station. Please refer to... Figure 1 The network system packet batch addressing method includes: Step S10: In response to the batch addressing operation, determine the range of slave stations of the target slave station corresponding to this batch addressing operation, send a station-by-station marking data frame to the slave station, and write the number of slave stations of the target slave station into the ADP field of the batch addressing data frame.

[0026] The master station clarifies the target slave range involved in this operation, sending a station-by-station marking data frame to each slave station to set the relative sequence position of each slave station with respect to the master station in the current network, such as -n, -n+1, ​​..., -2, -1, 0, 1, 2, ..., m-1, m. Then, the number of target slave stations to be batch-addressed is accurately written into the ADP field of the batch addressing data frame. Upon receiving the batch addressing data frame, the target slave stations accurately identify and understand the slave range targeted by this batch addressing operation, thereby correctly handling subsequent data interactions and communication tasks related to these slave stations. This ensures efficient batch addressing operations and avoids communication errors or data processing chaos caused by unclear slave ranges.

[0027] It should be noted that batch addressing is an operation that addresses a set of registers of multiple slave stations at once, improving data exchange efficiency by processing related transactions of multiple slave stations simultaneously. The target slave station is the selected slave device that needs to exchange data during the batch addressing operation. The ADP field indicates the total number of target slave stations with which the master station needs to communicate in this batch addressing operation.

[0028] For example, the target slaves are determined based on the ADP field value in the bulk addressing data frame and the relative sequence position stored in the slave's local sequence register. The number of target slaves is counted, and interaction stops once the required range of slaves has been reached.

[0029] Alternatively, since the addressing operation of each slave station can be completed in a very short time, the target slave station can also be any slave station in the network.

[0030] Step S20: Write the starting address of the target register corresponding to the target slave station into the ADO field of the batch addressing data frame.

[0031] It should be noted that registers are areas within the target slave station used to store data, and each register has a unique address. The target register address refers to the address of the register that the master station needs to read, write, or otherwise operate on in the target slave station during this batch addressing operation. The ADO field is used to store the starting address of the target register corresponding to the target slave station.

[0032] Optionally, the master and slave stations in the network use the same communication protocol, and the master station stores the register addresses of all slave stations in the network.

[0033] Step S30: Determine the total length of the DATA area of ​​the batch addressing data frame based on the sum of the length values ​​of the content data stored in the physical area of ​​the target register of each target slave station or the sum of the length values ​​of the Message message content, and write it into the PduLen field of the batch addressing data frame.

[0034] The total length of the DATA region in the bulk addressing data frame is determined and written to the PduLen field. A clearly defined data length helps ensure data transmission integrity. The receiver can determine whether a complete data frame has been received based on the value of the PduLen field. If the received data length does not match the length specified in the PduLen field, retransmission or other error handling mechanisms can be triggered promptly, thereby improving the reliability of the entire bulk addressing communication. The target slave station determines the range of the DATA region to interact with its own registers based on the PduLen and ADP fields of the bulk addressing data frame.

[0035] It should be noted that the target register physical area is the actual hardware area within the target slave station used to store data. Each register physically occupies a certain amount of storage space and has a fixed address range. The DATA area is the part of the bulk addressing data frame used to store the actual data content, including the specific data to be transmitted in this bulk addressing operation. The PduLen field is used to store the total length information of the DATA area in the bulk addressing data frame.

[0036] For example, the target slave stations involved in this operation and which registers of these slave stations need to be operated on are clearly defined. Based on the determined target slave stations and the target registers involved, the content data length value corresponding to each register is looked up from a pre-established register configuration information database. If it is a regular instruction-type bulk addressing data frame, the content data length values ​​of all target registers involved in the selected target slave stations are added together to obtain the total length of the DATA area of ​​the bulk addressing data frame; if it is a fixed protocol-type bulk addressing data frame, the number of slave stations of the selected target slave stations is multiplied by the Message message length value under the corresponding fixed protocol as identified by the TYPE field to obtain the total length of the DATA area of ​​the bulk addressing data frame. The calculated total length of the DATA area is written into the PduLen field of the bulk addressing data frame according to the format specified by the fixed protocol.

[0037] Step S40: Based on the total length of the DATA region, the PduLen field, the ADP field, and the relative sequence position stored in the sequence register address of the target slave station, the DATA region is divided into Area regions that correspond one-to-one with the target slave station.

[0038] It should be noted that the Area is a sub-area that is divided according to the total length of the DATA area, and corresponds one-to-one with the target slave station. Each Area is used to store the data of the corresponding target slave station and has a clear starting address and length.

[0039] By dividing the DATA area into Area regions corresponding one-to-one with the target slave stations, each target slave station, upon receiving a batch addressing data frame, can determine the Area region corresponding to its target register based on the relative sequence position stored in its own sequence register address, combined with the PduLen and ADP fields. This accurately locates its own data portion, avoiding data confusion and misreading, and ensuring accurate data exchange.

[0040] For example, the master station first obtains the physical sequence position of each slave station relative to the master station from the database, and sets the slave station range of the target slave station based on the physical sequence position. After the master station sends a station-by-station tagging data frame to each of the above slave stations, it sets the relative sequence position of the first target slave station corresponding to the selected slave station range to 0 based on the physical sequence position of each slave station.

[0041] For example, the physical sequence position of the master station is 0, and there are 20 slave stations in the network with physical sequence positions relative to the master station of 1, 2, ..., 20. Based on these physical sequence positions, the master station determines that the range of target slave stations is 9 to 15. When the master station sends a station-by-station tagging data frame to each of the above slave stations, it will identify the slave stations with physical sequence positions of 9 to 15 as target slave stations and set the relative sequence positions of these 7 target slave stations to 0 to 6 respectively.

[0042] The total length of the DATA area is calculated based on the number of target slave stations and the length of the Message message content, thus determining the data capacity of the DATA area. The starting address and length of each Area are determined based on the Message message content of each target slave station corresponding to that Area. The DATA areas are then filled sequentially according to the calculated starting address and length of each Area.

[0043] For example, for 5 target slave stations, the length of the Message message content exchanged between the master station and the target slave stations is 20 bytes, so a total of 100 bytes of DATA area is required. The starting address of each Area region is calculated sequentially based on the sequence register address of the target slave station. The slave station range is from physical sequence position 20 to 24, where the master station's physical sequence position is 0. The master station sends a station-by-station marked data frame to each slave station. The RSP field of this station-by-station marked data frame has an initial sequence value set to -20. Each slave station, after receiving the station-by-station marked data frame, increments the value of its RSP field by 1, writes it to its sequence register, and updates the RSP field of the station-by-station marked data frame. At this point, the relative sequence position corresponding to the address of the first target slave sequence register is 0, and the starting address of the Area region corresponding to the DATA data area after receiving the bulk addressing data frame is 0; the length of the Message message of the first target slave is 20, the relative sequence position corresponding to the address of the second target slave sequence register is 1, and the starting address of the Area region is 20; the length of the Message message of the second target slave is 20, the relative sequence position corresponding to the address of the third target slave sequence register is 2, and the starting address of the Area region is 40, and so on.

[0044] Step S50: Send the configured batch addressing data frame to the target slave station.

[0045] It should be noted that the master station sends the configured batch addressing data frame to the target slave station. After receiving the batch addressing data frame, the target slave station compares the ADP field value with the relative sequence position stored in the local sequence register. If the relative sequence position is between 0 and the ADP field value (inclusive of 0, excluding the ADP field value), the corresponding addressing operation is performed.

[0046] After the master station completes the configuration, it sends the batch addressing data frame to each target slave station, realizing efficient communication between the master station and multiple slave stations. This enables the selected target slave station to sequentially interact with the content data stored in the target register physical area and the message field in the corresponding Area area according to the batch addressing read and write rules based on the received batch addressing data frame.

[0047] For example, the configured bulk addressing data frame is sent to the network via the network interface so that all slave stations in the network can receive the bulk addressing data frame. Then, the ADP field value and the local sequence register value of the bulk addressing data frame are used to determine whether to perform an addressing operation.

[0048] As an example of this embodiment, please refer to the description table of each field of the data frame message under batch addressing shown in Table 1. In the data frame using batch addressing, the DATA area of ​​the PDU message can be divided into a specified interaction area for the selected target slave station. The length range of this area is the PduLen field value / ADP field value, and the format is as follows: Figure 2 As shown, when the data frame passes through the target slave station sequentially, the target slave station whose relative sequence position in the local sequence register is between 0 and the ADP field value interacts with the message fields in its corresponding Area area according to the bulk addressing read / write rules. If the bulk addressing data frame is a regular instruction-type bulk addressing data frame, that is, the TYPE representing the message type is 0, then the target register physical area to be read is converted into the starting address and LEN length, and the DATA area is a linearly divided area. The first register address of the target register physical area is written to the ADO field, and the sum of the lengths of the content data accessed by each target register in this area is X. Let len( Let be the length of the data stored in the i-th target register, z be the number of target registers in the physical region of the target register, and N be the number of target slaves to be addressed in the batch addressing operation. Then, the total length PduLen of the DATA area is calculated as follows: ,PduLen= X*N.

[0049] Table 1. Description of each field in a data frame message under bulk addressing.

[0050] This embodiment provides a method for batch addressing of network system packets. By employing batch addressing, the master station can send data frames to multiple target slave stations at once, without needing to communicate with each slave station individually. This reduces the number of communications, lowers network load, improves data exchange efficiency, and shortens overall communication time. By rationally dividing the DATA area into Area areas corresponding one-to-one with the target slave stations, the master station can organize the data from different target slave stations in an orderly manner within the DATA area according to certain rules. After receiving a data frame, the target slave station can quickly locate its corresponding data area, thereby accelerating data processing speed and improving data exchange efficiency.

[0051] Based on Embodiment 1, Embodiment 2 of this application proposes a method for batch addressing of network system packets. In this embodiment, step S30 further includes: Step S31: When the batch addressing data frame is a regular instruction type, configure the TYPE field of the batch addressing data frame to the identifier value corresponding to the regular instruction type.

[0052] Step S32: Determine the total length of the DATA area of ​​the batch addressing data frame based on the sum of the length values ​​of the content data stored in the physical area of ​​the target register of the target slave station, and write it to the PduLen field of the batch addressing data frame.

[0053] In bulk addressing operations, there are two different types of bulk addressing data frames: regular instruction type and fixed protocol type. When the bulk addressing data frame is a regular instruction type, the TYPE field of the bulk addressing data frame is configured with the identifier value corresponding to the regular instruction type. The length values ​​of the contents of all target registers involved in the selected target slave are added together to obtain the total length of the DATA area of ​​the bulk addressing data frame, which is then written into the PduLen field. By clearly defining the type, the target slave can parse and execute the instructions in the bulk addressing data frame according to the processing logic of the regular instruction type, avoiding errors caused by type confusion.

[0054] It should be noted that the batch addressing data frames include conventional command type and fixed protocol type, and the TYPE field value is different for different types of batch addressing data frames.

[0055] It should also be noted that the regular command type is a type of bulk addressing data frame used to perform regular read and write operations. The TYPE field is a field in the bulk addressing data frame used to identify the message type.

[0056] As an optional implementation, two constants are defined to represent the identifier values ​​corresponding to the regular command type and the fixed protocol type, respectively. In the function that constructs the bulk addressing data frame, the identifier value corresponding to the regular command type is configured. The above-mentioned construction function is called when a regular command type bulk addressing data frame needs to be sent.

[0057] This embodiment provides a method for batch addressing of network system packets. By explicitly setting the TYPE field to the identifier value corresponding to the regular instruction type, the target slave station can quickly and accurately identify that the batch addressing data frame is of the regular instruction type, avoiding incorrect parsing caused by type confusion, ensuring that the slave station processes the instructions in the data frame according to the correct logic, and improving the accuracy of communication.

[0058] Based on Embodiments 1 and 2, Embodiment 3 of this application proposes a method for batch addressing of network system packets. In this embodiment, step S30 includes: Step S33: When the batch addressing data frame is a fixed protocol type, configure the TYPE field of the batch addressing data frame to the identifier value corresponding to the fixed protocol type.

[0059] Configuring the TYPE field of a fixed-protocol batch addressing data frame to the corresponding fixed-protocol identifier allows the target slave station to know that the batch addressing data frame belongs to a fixed protocol, and then parses and executes the instructions in it according to the pre-set Message protocol processing flow, avoiding confusion with other types of data frames and ensuring the accuracy of communication.

[0060] It should be noted that the Message protocol is a fixed data frame protocol.

[0061] For example, define an identifier value representing the TYPE field value corresponding to a fixed protocol type. Create a function for constructing bulk addressed data frames, and configure the TYPE field to the identifier value corresponding to the fixed protocol type within the function. Call the above construction function when a fixed protocol type bulk addressed data frame needs to be sent.

[0062] Step S34: Determine the total length of the DATA area of ​​the batch addressing data frame based on the sum of the length values ​​of the Message message content of each target slave station, and write it into the PduLen field of the batch addressing data frame.

[0063] In bulk addressing communication, the master station needs to send bulk addressing data frames containing Message messages to multiple target slave stations. Accurately determining the total length of the DATA area and writing it into the PduLen field allows the target slave stations to know the actual length of the data in the DATA area after receiving the bulk addressing data frame, thereby correctly reading and processing the Message message content and avoiding data reading errors or omissions caused by inaccurate length information.

[0064] It should be noted that a Message is a specific information unit contained within each target slave station in a batch addressing data frame, used to implement specific communication functions between the master station and the target slave station. The Message operated by each target slave station is identical, belonging to a fixed protocol type corresponding to that TYPE. The starting address of the target slave station's target register and its corresponding Message content are fixedly correlated.

[0065] For example, iterate through the Message messages of all target slave stations, obtain the length of each Message message, and sum the lengths of all Message messages to obtain the total length of the DATA area. According to the communication protocol, determine the position of the PduLen field in the bulk addressing data frame. Convert the calculated total length of the DATA area according to the format specified in the protocol, and write the converted length value into the PduLen field position of the bulk addressing data frame.

[0066] As an example of this embodiment, the master station detects whether the Area is required to contain Message content under a specified fixed protocol. If not, the DATA field is configured according to the linear division of a conventional instruction-type bulk addressing data frame, and the TYPE field of the data frame is set to 0. If required, the TYPE field of the data frame is set to the identifier value corresponding to the Message message under the fixed protocol, and the data frame format of the fixed protocol-type bulk addressing method is adopted, such as... Figure 3 As shown. Where, let len( Let Y be the length of the Message message content of each target slave station corresponding to the fixed protocol batch addressing data frame, and N be the number of target slave stations to be batch addressed. Then, the total length PduLen of the DATA area is calculated as follows: , PduLen = Y*N.

[0067] Based on Embodiment 1, Embodiment 4 of this application proposes a method for batch addressing of network system packets. In this embodiment, after step S40, the method further includes: Step S60: Write the addressing mode of the batch addressing operation into the CMD field of the batch addressing data frame.

[0068] It should be noted that the CMD field is used to indicate the specific type of this batch addressing operation, i.e., the addressing mode.

[0069] For example, based on actual communication requirements, determine whether the current batch addressing operation is in batch read, batch write, or batch read / write mode. Convert the determined addressing mode into corresponding binary code according to predefined encoding rules. Write the encoded binary code into the CMD field of the batch addressing data frame.

[0070] Step S70: If the addressing mode is batch read mode, then configure each Area region to the initial state to read the content data corresponding to the target slave station.

[0071] For example, according to the communication protocol, the Area region in the bulk addressing data frame is set to the initial state, and the configured bulk addressing data frame is sent to the target slave station to read the content data stored in the target slave station's target register physical area.

[0072] Step S80: If the addressing mode is batch write mode or batch read / write mode, then the content data corresponding to the target slave station is sequentially written into each of the Area regions.

[0073] For example, the write order of the content data is determined according to the sequence register address of the target slave. The prepared content data is then written sequentially into the Area region of the bulk addressing data frame in the determined order. The configured bulk addressing data frame is then sent to the target slave.

[0074] This embodiment provides a method for batch addressing of network system packets. By specifying the addressing mode and processing the key areas in the data frame accordingly, this embodiment enables the slave station to correctly execute data reading or writing operations according to the master station's instructions, ensuring the accuracy and efficiency of data interaction.

[0075] Based on Embodiment 1, Embodiment 5 of this application proposes a method for batch addressing of network system packets, wherein the step of sending station-by-station marked data frames to slave stations includes: In response to the station-by-station marking operation, the initial sequence value of the RSP field of the station-by-station marking data frame is configured, and the configured station-by-station marking data frame is sent to each of the slave stations to set the relative sequence position of the slave stations station by station.

[0076] For example, before sending the bulk addressing data frame, in response to the station-by-station marking operation, the master station sends a station-by-station marking data frame to each slave station to perform the station-by-station marking operation.

[0077] It should be noted that the station-by-station marking operation is an operation in which the master station performs a sequence marking operation on each slave station in the communication network before sending the batch addressing data frame. This determines the relative sequence position and the zero point of each slave station. The slave station with a relative sequence position of 0 is set as the starting position of the target slave station area for the master station in the batch operation.

[0078] For example, the master station configures the initial sequence value of the RSP field of the station-by-station tagged data frame to be I, and sends the configured station-by-station tagged data frame to each slave station.

[0079] It should be noted that the RSP field is used to set the relative sequence position in the sequence register of the slave station from the master station. If the master station expects to operate on a total of N slave stations, and the range of the target slave stations is from physical sequence position F to F+N-1 where the master station's physical sequence position is 0, then the value I in the RSP field is set to -F. Preferably, the RSP field can be a 16-bit signed integer.

[0080] For example, configure a station-by-station tagged data frame. If the master station expects to operate on a total of 5 target slave stations, and the range of the target slave stations is from physical sequence position 10 to 14 (where the master station's physical sequence position is 0), then set the initial sequence value of the RSP field to -10. The constructed station-by-station tagged data frame is then sent to the network via the network interface.

[0081] As an example of this embodiment, before performing batch addressing, the relative sequence position of each slave station relative to the master station in the current network is set using a station-by-station tag data frame. Referring to the description table of each field of the station-by-station tag data frame message shown in Table 2, the PDU format corresponding to the station-by-station tag type is as follows: Figure 4 As shown, PDU(s) is a complete PDU, and the format of the PDU is as follows: Figure 5 As shown. The RSP field of the station-by-station tagged data frame indicates the relative sequence position of each slave station relative to the master station. The corresponding value type is a 16-bit signed integer. The initial value of this value at the master station is 1 (positive / 0 / negative value). After receiving the station-by-station tagged data frame, the slave station checks the type represented by the TYPE field. If it is a station-by-station tagged data frame, it increments the sequence value of the RSP field by one, and then writes the sequence value into the corresponding sequence register according to the SRA field representing the sequence register address.

[0082] Table 2. Description of each field in a station-by-station tag type data frame message.

[0083] This embodiment provides a method for batch addressing of network system packets. By using station-by-station marking operations and related data frame interactions, this embodiment accurately reads or writes the data content of a set of related registers of the selected range of slave stations, thereby improving the accuracy and efficiency of data interaction.

[0084] Embodiment 6 of this application proposes a method for batch addressing of network system packets, applied to a slave station. In this embodiment, the method for batch addressing of network system packets further includes: Step A10: Receive the batch addressing data frame sent by the master station, and parse the TYPE field and CMD field of the batch addressing data frame to determine the message type and addressing mode.

[0085] By determining the message type and addressing mode, the slave station can determine the interaction method with the master station, clarify the specific operations to be performed, thereby achieving accurate processing of the master station's instructions, avoiding erroneous operations or invalid processing, and improving the accuracy and efficiency of data interaction in the entire network system.

[0086] As an optional implementation, the network interface module monitors data transmission on the network. Upon detecting the arrival of batch-addressed data frames, the TYPE field is parsed according to the format and encoding rules specified in the communication protocol to determine the message type of the batch-addressed data frame. The CMD field is then parsed, and its value is read to determine the specific addressing mode.

[0087] Step A20: When the message type is a regular instruction type, determine the target register according to the register start address corresponding to the ADO field of the bulk addressing data frame, and determine the Area region corresponding to the target register according to the locally stored relative sequence position, the PduLen field and the ADP field of the bulk addressing data frame.

[0088] It should be noted that the addressing modes include batch read mode, batch write mode, and batch write-read mode.

[0089] Step A30: When the addressing mode is batch read mode, read the content data from the target register and fill it into the Area region.

[0090] It should be noted that the batch read command is an instruction used to linearly read data from multiple registers at once. Linear read means that it reads data from multiple consecutive registers one after another in sequence.

[0091] For example, the corresponding amount of content data is read from the target register sequentially according to the length of the Area region. The read content data is then filled into the Area region in order.

[0092] Step A40: When the addressing mode is batch write mode, the load data in the corresponding Area region is written to the target register.

[0093] It should be noted that batch write commands are instructions used to linearly write data to multiple registers at once. Linear writes write data sequentially, one after another, into a contiguous register address space.

[0094] For example, the payload data in the Area region is sequentially and linearly written into the corresponding address space of the target register according to the length of the Area region.

[0095] Step A50: When the addressing mode is batch write-read mode, the load data in the corresponding Area is written to the target register, and the original content data in the target register is read and filled back into the corresponding Area to realize data exchange.

[0096] It should be noted that the batch write and read command is a compound instruction that combines batch write and batch read operations, writing data first and then reading data.

[0097] For example, the payload data is linearly written to the target register according to the length of the Area region. At the same time, the content data is linearly read from the target register and filled back into the Area region, completing the data exchange.

[0098] As an example of this embodiment, please refer to Table 1, which describes the fields of a data frame message under bulk addressing. The slave station checks whether the TYPE field, indicating the message type, is 0 when it receives a bulk addressing data frame. The TYPE field of a regular instruction-type addressing data frame can be defined as 0 or 1, etc., without specific restrictions. This embodiment uses TYPE field 0 as an example. If the TYPE field is 0, it indicates that the bulk addressing data frame is a regular instruction-type addressing data frame. Then, the CMD field is used to determine whether it is a bulk read, bulk write, bulk write-read, or other regular addressing mode. For regular instruction-type bulk addressing data frames, no mapping table needs to be established; the corresponding size of content data is linearly filled according to the order of the target registers. The linear mapping relationship between the message fields of a regular instruction-type bulk addressing data frame and the content data in the registers is as follows: Figure 6 As shown.

[0099] If it is a conventional instruction-based batch read method, the register corresponding to the first address is queried according to the ADO field in the batch addressing data frame. Starting from this register, the contents of each linearly arranged target register are filled into the PduLen / ADP length field one by one until the Area region is filled. The Area region corresponding to the nth sequence of the slave station relative to the master station is [ n, ]. is the offset address of the starting position of the first Area region relative to the data frame header, and n is equal to the relative sequence position of the slave station relative to the master station stored in the sequence register address.

[0100] If it is a conventional instruction-based batch write method, the register corresponding to the starting address is queried according to the ADO field in the batch addressing data frame. Starting from this register, the contents of the PduLen / ADP length corresponding to the Area region are written one by one into the linearly arranged target registers, with the length of the register contents as the boundary.

[0101] If it is a conventional instruction-based batch write / read method, the register corresponding to the starting address is queried according to the ADO field in the batch addressing data frame. Starting from this register, the contents of the PduLen / ADP length corresponding fields of the Area region are exchanged with the contents of the linearly arranged target registers, with the contents of the register as the boundary. The batch addressing data frame carries the contents of the target registers back to the master station.

[0102] For example, if the relative sequence position in the local sequence register of the slave station is negative or greater than or equal to the ADP field in the message, the addressing operation is stopped, and the batch addressing data frame after the addressing operation is completed is returned to the master station.

[0103] After the addressing operation is completed, the final result is fed back to the master station that initiated the request in a standardized form. This helps the master station to obtain the status and results of the operation in a timely manner, ensuring that the entire system can carry out effective information exchange and collaborative work.

[0104] Optionally, according to the requirements of the communication protocol, the master station performs verification calculations on some or all fields in the returned batch addressing data frames to ensure the accuracy of data transmission.

[0105] This embodiment provides a method for batch addressing of network system packets. In this embodiment, the slave station first determines the TYPE packet type and CMD addressing mode by parsing, and performs the required read and write operations according to the type, avoiding processing chaos caused by the inability to recognize complex packet types. For conventional instruction-type batch addressing data frames, the slave station directly executes the linear data interaction operation between the slave station register and the Area region of the data frame according to the addressing mode, realizing efficient one-time interaction of batch data, reducing the number of data transmission frames, reducing the risk of network congestion, and shortening the overall interaction latency. Finally, the slave station sends the batch addressing data frames after linear data processing back to the master station, ensuring the integrity and accuracy of data interaction.

[0106] Based on Embodiment Six, Embodiment Seven of this application proposes a method for batch addressing of network system packets. In this embodiment, after step A10, the method for batch addressing of network system packets further includes: Step A60: When the message type is a fixed protocol type, determine the target register according to the register start address corresponding to the ADO field of the bulk addressing data frame, and determine the Area region corresponding to the target register according to the locally stored relative sequence position, the PduLen field and the ADP field of the bulk addressing data frame.

[0107] Step A70: Determine the mapping relationship between the target register and the Area region based on the mapping table of message fields and register physical regions under the fixed protocol type corresponding to the TYPE field for bulk addressing.

[0108] By using the register physical area mapping table, the register storage location corresponding to the data content of the Message field in the Area region of the DATA domain to which the slave station belongs can be accurately found. When reading and writing data, the target register can be directly accessed, and the addressing operation of a group of target registers corresponding to the Message field can be performed, which improves the efficiency of data processing.

[0109] For example, the starting address of the corresponding register, i.e., the starting address of the target register, is determined based on the value of the ADO field. The location and length of the Area region corresponding to the target register of the current slave are determined based on the local stored relative sequence position, the length of the DATA area corresponding to the PduLen field, and the number of slaves corresponding to the ADP field. The location of the register physical region corresponding to the Area region is then searched in the register physical region mapping table according to the fixed protocol type of the TYPE field in the bulk addressing data frame. Based on the search result, the Message field of the Area region in the DATA field of the slave's respective target register in the bulk addressing data frame is determined.

[0110] Step A80: When the addressing mode is batch read mode, read the content data from the target register according to the mapping relationship and fill it into the Area region.

[0111] If it is a fixed protocol type batch read mode, the content data is read from the target register, and according to the mapping table of message fields and register physical areas under the fixed protocol type batch addressing, the data content in the corresponding target register is filled into the Area area corresponding to the Message field of the slave station, as shown in Table 3.

[0112] For example, the Area region corresponding to the Message field of the local slave station is calculated based on the relative sequence position of the local slave station. According to the non-linear mapping relationship between the message field and the register physical area mapping table under the fixed protocol type, the data content in the corresponding target register is filled into the Area region of the DATA field of the local slave station.

[0113] Step A90: When the addressing mode is batch write mode, the load data in the Area region is written to the target register according to the mapping relationship.

[0114] If it is a fixed protocol type batch write method, the payload data in the Area area is written to the corresponding target register according to the mapping table between the message fields and the physical area of ​​the register under the fixed protocol type batch addressing.

[0115] For example, the Area region corresponding to the Message field of the local slave station is calculated based on its relative sequence position. The payload data in the Area region is written into the corresponding address space in the target register according to the non-linear mapping relationship between the message field and the register physical area mapping table under the fixed protocol type.

[0116] Step A100: When the addressing mode is batch write-read mode, according to the batch write-read operation mode in the mapping table between the message field and the physical area of ​​the register under the fixed protocol type, the corresponding batch write-read operation is executed. The batch write-read operation mode includes retention operation, write operation, read operation and exchange operation. The direction of the operation includes forward transmission from the master station to the slave station and reverse transmission from the slave station to the master station.

[0117] The mapping table of message fields and register physical regions for bulk addressing under fixed protocol types is shown in Table 3.

[0118] For example, if the batch write / read operation is a hold operation, the original data in the target register and the corresponding Area area is preserved; if the batch write / read operation is a read operation, the content data is read from the target register and filled into the Area area; if the batch write / read operation is a write operation, the load data in the Area area is written to the target register; if the batch write / read operation is an exchange operation, the load data is written to the target register according to the length of the Area area, and the original content data is read from the target register and filled back into the Area area, thus completing the data exchange.

[0119] As an example of this embodiment, please refer to the description table of each field of the data frame message under bulk addressing shown in Table 1. The slave station checks whether the TYPE field identifier, which indicates the message type, is 0 when receiving a bulk addressing data frame. If the TYPE field of the data frame is non-zero, it indicates that the data frame is a data frame of a specified type. Next, it checks whether the content of the DATA data area corresponding to this type of bulk addressing data frame is divided according to a fixed protocol format when using bulk addressing commands, in order to determine whether the bulk addressing data frame is a bulk addressing data frame of a fixed protocol type. If this type of bulk addressing data frame does not have a fixed protocol format division requirement, it is considered to be a regular instruction type bulk addressing data frame, and step A20 is executed. Then, the CMD field of this type of bulk addressing data frame is parsed to determine whether it is a bulk read mode, a bulk write mode, or a bulk write-read mode. When it is a regular instruction type bulk addressing mode, the address of ADO corresponds to the address of the first register. The data areas of the Area message field with a length of PduLen / ADP are arranged linearly, and the addressing operation of the register and message fields is completed according to the linear mapping. If the TYPE of this type of batch addressing data frame is a fixed protocol type batch addressing data frame, execute steps A60~A70, and then parse the CMD field of this type of batch addressing data frame to determine whether it is a batch read mode, a batch write mode, or a batch write-read mode.

[0120] If the TYPE message type is a fixed protocol-based bulk read method, the ADO address corresponds to the address of the first register. The data areas of the Area message field, with a length of PduLen / ADP, are not necessarily linearly arranged; usually, there are reserved fields, which are empty. Furthermore, when expanding reserved fields, the corresponding new register should be added at the physical reserved address of the register, either linearly to a physical area adjacent to an already partitioned register or to a reserved register area. The expanded field is a reserved field in the middle of the message. This non-linear (including linear mapping) mapping requires establishing a mapping table between message fields and register physical areas for the bulk write / read method under the fixed protocol type corresponding to this TYPE type, as shown in Table 3. Here, x represents the number of reserved fields. This is the starting position of the Arean region corresponding to this slave station. This is the starting address of the first Area region in the message, where n equals the relative sequence position of the slave station relative to the master station stored in the sequence register address. In batch read mode, the data content of the target register is read into the message fields one by one according to this mapping table.

[0121]

[0122] Table 3. Mapping Table of Message Fields and Register Physical Areas for Bulk Addressing under Fixed Protocol Types

[0123] If the TYPE message type is a fixed protocol batch write mode, the slave station finds the Message message field in the Area region of the DATA field based on the relative sequence position. According to the mapping table between message fields and register physical areas for batch addressing under the fixed protocol type, the slave station writes the content of the Message message field in the Area region of the corresponding data frame of the nth relative sequence slave station into the corresponding register. The non-linear mapping relationship between message fields and register contents of fixed protocol batch addressing data frames is as follows: Figure 7 As shown.

[0124] If the batch addressing data frame corresponding to the TYPE type uses the batch write / read method, the slave station, according to the mapping table of message fields and register physical areas under the batch write / read method of the fixed protocol type shown in Table 4, operates on the Message message field in the Arean area corresponding to the nth relative sequence slave station with the content data of the corresponding register in the manner of reservation / read / write / exchange. The operation modes of batch write / read addressing include: reservation: the message field is not read or written with the physical register, and the original content data of the physical register is maintained; write: the content data of the message field is written into the physical register; read: the content data of the physical register is read into the message field; exchange: the content data of the physical register is exchanged with the content data of the message field, and the message field carries the original content data of the physical register back to the master station. Operation direction: forward means the master station sends the data frame to the slave station in the forward transmission, that is, the slave station performs the operation after receiving the data frame for the first time at the port; reverse means the master station sends the data frame to the slave station in the reverse transmission, that is, the slave station performs the operation after receiving the data frame for the second time at the port.

[0125] Table 4. Mapping Table of Message Fields and Register Physical Areas for Batch Write / Read Mode under Fixed Protocol Types

[0126] For example, if the relative sequence position in the local sequence register of the slave station is negative or greater than or equal to the ADP field in the message, no addressing operation is performed, and the processed batch addressing data frame is eventually returned to the master station.

[0127] Optionally, according to the requirements of the communication protocol, the master station performs verification calculations on some or all fields in the returned batch addressing data frames to ensure the accuracy of data transmission.

[0128] This embodiment provides a method for batch addressing of network system packets. First, the packet type is determined by the TYPE type and CMD addressing mode in the batch addressing data frame. A mapping table corresponding to this type is then established. This method allows for the simultaneous processing of data mapping and interaction between multiple packet fields and physical register areas, resolving the non-linear correspondence between packet fields and physical registers under fixed protocols and improving data processing efficiency. Finally, the slave station transmits the batch addressing data frame, after non-linear data processing, back to the master station, ensuring the integrity and accuracy of data interaction.

[0129] Based on Embodiment Six, Embodiment Eight of this application proposes a method for batch addressing of network system packets. Before the master station sends batch addressing packets, it first sends a station-by-station marker data frame to each slave station to set the relative sequence position of the slave stations. In this embodiment, before step A10, the method includes: Optionally, the slave station receives the station-by-station tagged data frame sent by the master station and parses the field value of the RSP field of the station-by-station tagged data frame.

[0130] It should be noted that the sequence value of the relative sequence position is the value obtained by parsing the RSP field plus one, which represents the relative sequence position of the current slave station relative to the master station when processing batch addressing data frames. The slave station with a relative sequence position of 0 is the first slave station to start executing the batch addressing operation.

[0131] As an optional implementation, the station-by-station tag data frame sent by the master station is received, the position of the RSP field is found according to the format definition of the data frame, and the value of the RSP field is determined according to the data type of the RSP field.

[0132] Step A110: Receive station-by-station marked data frames, parse the sequence value of the relative sequence position corresponding to the RSP field, perform an increment operation on the sequence value, use the incremented sequence value as the field value of the RSP field, and update the RSP field.

[0133] It should be noted that the initial value of the sequence value is a 16-bit signed integer, which can be positive, negative, or 0. The increment operation is to increase the sequence value relative to the sequence position, generating a new sequence value by incrementing it one station at a time.

[0134] For example, the initial value of the sequence value at the relative sequence position of the RSP field is incremented according to the rules, adding 1 to the current initial value. After the increment operation is completed, the RSP field in the station-by-station tag data frame is updated.

[0135] Step A120: Write the incremented field value into the sequence register address of the slave station corresponding to the SRA field of the station-by-station marker data frame.

[0136] For example, the address of the sequence register is parsed according to the data type and encoding method of the SRA field, the sequence value after the sequence increment is written into the sequence register, the sequence value is encoded into the corresponding binary data, and the encoded data is written back to the position of the RSP field in the station-by-station marker data frame.

[0137] Step A130: The updated station-by-station labeled data frame is forwarded to the next slave station in the network.

[0138] For example, please refer to Figure 8 In the network topology, the updated station-by-station tagged data frame is passed to the adjacent slave stations in a fixed order. After being passed to the last slave station, it is then passed back to the previous slave station until it returns to the master station.

[0139] In this embodiment, before the master station sends the batch addressing message, it first sets the relative sequence position of each slave station by marking the data frame station by station. Each slave station performs the corresponding operation according to the received sequence information and passes the updated data frame to the next slave station. By marking the relative sequence position, the master station can accurately complete the batch addressing operation within the selected range of target slave stations.

[0140] Based on Embodiment Six, Embodiment Nine of this application proposes a method for batch addressing of network system packets. In this embodiment, before step A10, the method further includes: Step A140: Receive and parse the ADP field of the batch addressing data frame, and compare it with the relative sequence position in the sequence register address set by marking the data frame station by station.

[0141] It should be noted that after setting the relative sequence position of each slave station by marking the data frames station by station, slave stations with negative relative sequence positions stored in their local sequence registers do not perform any operations when receiving bulk addressing messages. Slave stations with non-negative relative sequence positions stored in their local sequence registers receive and parse the ADP field of the bulk addressing data frame, and compare it with the relative sequence position in the sequence register address.

[0142] By parsing the ADP field and comparing it with the relative position sequence in the locally stored sequence register, the position of the slave station in the addressing sequence is determined, and it is determined whether the current slave station is within the target range of 0 to ADP field value in the master station's batch addressing (including 0 but excluding ADP).

[0143] For example, slaves with a negative relative sequence position in their local sequence register do not perform bulk addressing operations. Slaves with a non-negative relative sequence position in their local sequence register receive bulk addressing data frames sent by the master station and parse the ADP field according to a predefined data frame format. They read the stored sequence register address from the local sequence register, compare the value of the ADP field with the value of the sequence register address, use subtraction, and determine the size relationship between the two by judging the sign of the difference.

[0144] Step A150: If the relative sequence position is non-negative and less than the ADP field in the message, then execute the step of receiving the batch addressing data frame sent by the master station, and parse the TYPE field and CMD field of the batch addressing data frame to determine the message type and addressing mode.

[0145] For example, referring to Table 1, when a slave station receives a data frame with a non-negative relative sequence position in the local sequence register, it checks the value of the ADP field in the message against the value of the local sequence register address. If the value of the local sequence register address is non-negative and less than the value of the ADP field, then step A10 is executed, and the Arean region for batch addressing by the PDU is... .in, is the offset address of the starting position of the first Area region relative to the data frame header, and n is equal to the relative sequence position stored in the local slave sequence register address.

[0146] Step A160: If the relative sequence position is negative or greater than or equal to the ADP field in the message, it is determined that it is not within the current batch addressing range, and the batch addressing operation is terminated.

[0147] If it is determined that the current slave station is not within the scope of batch addressing, unnecessary batch addressing operations should be terminated in a timely manner to avoid invalid communication and processing, save system resources, and improve communication efficiency.

[0148] For example, when the value of the sequence register address of the local slave station is negative or greater than or equal to the value of the ADP field, the slave station determines that it is not within the current batch addressing range, stops further processing of the batch addressing data frame, and directly forwards the batch addressing data frame.

[0149] This embodiment provides a method for batch addressing of network system packets. This embodiment first receives and parses the ADP field in the batch addressing data frame, and then compares it with the sequence register address stored in the local sequence register to accurately determine whether it is within the target range of the current batch addressing of the master station. This avoids invalid responses and ensures that only slave stations that meet the conditions will further process the data frame, thereby improving the accuracy and efficiency of addressing.

[0150] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the network system packet batch addressing method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0151] This application provides a network system message bulk addressing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the network system message bulk addressing method in Embodiment 1 above.

[0152] The following is for reference. Figure 9 This diagram illustrates a structural schematic suitable for implementing a network system packet bulk addressing device according to embodiments of this application. The network system packet bulk addressing device in embodiments of this application may include, but is not limited to, digital service devices such as computers, sensing devices, execution devices, and embedded devices. Figure 9 The network system message bulk addressing device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0153] like Figure 9As shown, the network system packet bulk addressing device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The random access memory 1004 also stores various programs and data required for the operation of the network system packet bulk addressing device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the network system message bulk addressing device to communicate wirelessly or wiredly with other devices to exchange data. Although network system message bulk addressing devices with various systems are shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented or possessed alternatively.

[0154] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0155] The network system packet batch addressing device provided in this application, employing the network system packet batch addressing method described in the above embodiments, can solve the technical problem of low data interaction efficiency in industrial systems. Compared with the prior art, the beneficial effects of the network system packet batch addressing device provided in this application are the same as those of the network system packet batch addressing method described in the above embodiments, and other technical features of this network system packet batch addressing device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0156] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0157] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0158] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the network system packet bulk addressing method described in the above embodiments.

[0159] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.

[0160] The aforementioned computer-readable storage medium may be included in a network system packet bulk addressing device; or it may exist independently and not be assembled into a network system packet bulk addressing device.

[0161] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a network system message bulk addressing device, enable the device to write computer program code for performing the operations of this application in one or more programming languages ​​or a combination thereof. These programming languages ​​include object-oriented programming languages—such as Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0162] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0163] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0164] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described network system packet bulk addressing method, which can solve the technical problem of low data interaction efficiency in industrial systems. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the network system packet bulk addressing method provided in the above embodiments, and will not be repeated here.

[0165] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for batch addressing of network system packets, characterized in that, Applied to the main station, the network system packet batch addressing method includes: In response to a batch addressing operation, the range of slave stations corresponding to the target slave station for this batch addressing operation is determined. After sending a station-by-station marking data frame to the slave station, the number of slave stations of the target slave station is written into the ADP field of the batch addressing data frame. Write the starting address of the target register corresponding to the target slave station into the ADO field of the batch addressing data frame; The total length of the DATA area of ​​the batch addressing data frame is determined based on the sum of the length values ​​of the content data stored in the physical area of ​​the target register of each target slave station or the sum of the length values ​​of the Message message content, and written to the PduLen field of the batch addressing data frame. Based on the total length of the DATA region, the PduLen field, the ADP field, and the relative sequence position stored in the sequence register address of the target slave station, the DATA region is divided into Area regions that correspond one-to-one with the target slave station. The configured batch addressing data frame is sent to the target slave station.

2. The network system packet batch addressing method as described in claim 1, characterized in that, The step of determining the total length of the DATA area of ​​the batch addressing data frame based on the sum of the length values ​​of the content data stored in the physical area of ​​the target register of each target slave station or the sum of the length values ​​of the Message message content, and writing it into the PduLen field of the batch addressing data frame, includes: When the batch addressing data frame is a regular instruction type, the TYPE field of the batch addressing data frame is configured with the identifier value corresponding to the regular instruction type; The total length of the DATA region of the batch addressing data frame is determined by summing the length values ​​of the content data stored in the physical region of the target register of the target slave station, and then written into the PduLen field of the batch addressing data frame.

3. The network system packet batch addressing method as described in claim 2, characterized in that, The step of determining the total length of the DATA area of ​​the batch addressing data frame based on the sum of the length values ​​of the content data stored in the physical area of ​​the target register of each target slave station or the sum of the length values ​​of the Message message content, and writing it into the PduLen field of the batch addressing data frame, includes: When the batch addressing data frame is a fixed protocol type, the TYPE field of the batch addressing data frame is configured with the identifier value corresponding to the fixed protocol type; The total length of the DATA area of ​​the batch addressing data frame is determined by summing the length values ​​of the Message content of each target slave station, and then written into the PduLen field of the batch addressing data frame.

4. The network system packet batch addressing method as described in claim 1, characterized in that, After the step of dividing the DATA region into Area regions corresponding one-to-one with the target slave station based on the total length of the DATA region, the PduLen field, the ADP field, and the relative sequence position stored in the sequence register address of the target slave station, the method further includes: Write the addressing mode of the batch addressing operation into the CMD field of the batch addressing data frame; If the addressing mode is batch read mode, then each Area region is configured to the initial state to read the content data corresponding to the target slave station; If the addressing mode is batch write or batch read / write, then the content data corresponding to the target slave station is written sequentially into each of the Area regions.

5. The network system packet batch addressing method as described in claim 1, characterized in that, The step of sending station-by-station marked data frames to slave stations includes: In response to the station-by-station marking operation, the initial sequence value of the RSP field of the station-by-station marking data frame is configured, and the configured station-by-station marking data frame is sent to each of the slave stations to set the relative sequence position of the slave stations station by station.

6. A method for batch addressing of network system packets, characterized in that, Applied to slave stations, the network system packet batch addressing method includes: Receive batch addressing data frames sent by the master station, and parse the TYPE and CMD fields of the batch addressing data frames to determine the message type and addressing mode; When the message type is a regular instruction type, the target register is determined according to the register start address corresponding to the ADO field of the bulk addressing data frame, and the Area region corresponding to the target register is determined according to the local stored relative sequence position, the PduLen field and the ADP field of the bulk addressing data frame. When the addressing mode is batch read mode, the content data is read from the target register and filled into the Area region; When the addressing mode is batch write mode, the load data in the corresponding Area region is written to the target register; When the addressing mode is batch write-read mode, the load data in the corresponding Area is written to the target register, and the original content data in the target register is read and filled back into the corresponding Area to realize data exchange.

7. The network system packet batch addressing method as described in claim 6, characterized in that, After the steps of receiving the batch addressing data frames sent by the master station, parsing the TYPE and CMD fields of the batch addressing data frames, and determining the message type and addressing mode, the method further includes: When the message type is a fixed protocol type, the target register is determined according to the register start address corresponding to the ADO field of the bulk addressing data frame, and the Area region corresponding to the target register is determined according to the local stored relative sequence position, the PduLen field and the ADP field of the bulk addressing data frame. The mapping relationship between the target register and the Area region is determined based on the message field and register physical area mapping table of the batch addressing under the fixed protocol type corresponding to the TYPE field. When the addressing mode is batch read mode, the content data is read from the target register according to the mapping relationship and filled into the Area region; When the addressing mode is batch write mode, the load data in the Area region is written to the target register according to the mapping relationship; When the addressing mode is batch write-read mode, the corresponding batch write-read operation is executed according to the batch write-read operation mode in the mapping table between the message field and the register physical area under the fixed protocol type. The batch write-read operation mode includes retention operation, write operation, read operation and exchange operation. The direction of the operation includes forward transmission from the master station to the slave station and reverse transmission from the slave station to the master station.

8. The network system packet batch addressing method as described in claim 6, characterized in that, Before the step of receiving the batch addressing data frame sent by the master station and parsing the TYPE and CMD fields of the batch addressing data frame to determine the message type and addressing mode, the following steps are included: Receive station-by-station marked data frames, parse the sequence value of the relative sequence position corresponding to the RSP field, perform an increment operation on the sequence value, use the incremented sequence value as the field value of the RSP field, and update the RSP field; The incremented field value is written to the sequence register address of the slave station corresponding to the SRA field of the station-by-station marker data frame; The updated station-by-station labeled data frame is forwarded to the next slave station in the network.

9. The network system packet batch addressing method as described in claim 6, characterized in that, Before the steps of receiving the batch addressing data frames sent by the master station and parsing the TYPE and CMD fields of the batch addressing data frames to determine the message type and addressing mode, the method further includes: Receive and parse the ADP field of the batch addressing data frame, and compare it with the relative sequence position in the sequence register address set by marking the data frame station by station; If the relative sequence position is non-negative and less than the ADP field in the message, then the steps of receiving the batch addressing data frame sent by the master station are executed, and the TYPE field and CMD field of the batch addressing data frame are parsed to determine the message type and addressing mode are determined. If the relative sequence position is negative or greater than or equal to the ADP field in the message, it is determined that it is not within the current batch addressing range, and the batch addressing operation is terminated.

10. A network system message bulk addressing device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the network system packet bulk addressing method as described in any one of claims 1 to 9.