Network system fast addressing method, device and storage medium
Patent Information
- Application Number
- CN202511775784.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2045-11-28
AI Technical Summary
[0004]本申请的主要目的在于提供一种网络系统快速寻址方法、设备及存储介质,旨在解决工业系统的数据交互效率低的技术问题
[0015] This application provides a fast addressing method for a network system. After the master station sends a data frame with a set corresponding cache type, the slave station checks the cache method corresponding to the TYPE type of the data frame. When the master station returns the data content of the PDU area corresponding to the slave station, or the data frame returned, the slave station reads the data content of all slave stations in the PDU(s) area. The slave station can obtain the data content of other slave stations for effective detection and processing, thereby improving the network interaction efficiency.
Smart Images

Figure CN121603475B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to methods, devices and storage media for fast addressing in network systems. Background Technology
[0002] Currently, in conventional master-slave industrial systems, when using the fast addressing method, in order to ensure the transmission rate, the slave station can only obtain its own data, store it in the designated register, and then immediately send out the data frame. It cannot obtain data information from other slave stations, which causes some functions to fail to be executed in a timely manner in the slave station, resulting in low data interaction efficiency in the network.
[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 objective of this application is to provide a fast addressing method, device, and storage medium for network systems, aiming to solve the technical problem of low data interaction efficiency in industrial systems.
[0005] To achieve the above objectives, this application proposes a fast addressing method for network systems, which includes: In response to a fast addressing operation, the TYPE field value of the fast addressing data frame is determined according to the type of the fast addressing operation; The format of the PDU(s) area of the fast addressing data frame is determined according to the type and addressing mode of the fast addressing operation; Write the length of the DATA area in the PDU of the fast addressing data frame into the PduLen field of the fast addressing data frame; The configured fast addressing data frame is sent to the target slave station.
[0006] In one embodiment, the type of fast addressing operation includes per-site caching and full-site caching, and the step of determining the TYPE field value of the fast addressing data frame according to the type of fast addressing operation includes: If the type of the fast addressing operation is the per-station cache type, the TYPE field of the fast addressing data frame is configured to the first type of TYPE field value corresponding to the per-station cache type; If the type of the fast addressing operation is the site-wide cache type, the TYPE field of the fast addressing data frame is configured to the second type TYPE field value corresponding to the site-wide cache type.
[0007] Furthermore, to achieve the above objectives, this application also proposes a fast addressing method for network systems, applied to the slave station. The fast addressing method for network systems includes: Receive fast addressing data frames transmitted from the master station to the slave station in the forward direction, and parse the TYPE field of the fast addressing data frames to determine the corresponding data frame type; If the data frame type is a site-wide cache type, parse the CMD field of the fast addressing data frame to determine the addressing mode; Execute the corresponding addressing operation based on the addressing mode obtained from the parsing; After the addressing operation is completed, the local counter is incremented by one. The fast-addressed data frame is transmitted forward from the sending port to the next target slave station in the network.
[0008] In one embodiment, after the step of forward transmitting the fast-addressed data frame from the sending port to the next target slave station in the network, the method further includes: If the fast addressing data frame is received again from the station to the master station in reverse, determine whether the local counter is a non-zero value. If the local counter is non-zero, then all data in the PDU(s) area of the fast addressing data frame is copied to the local buffer. After the copy operation is completed, the local counter is decremented by one. After the fast addressing data frame is sent back in reverse, the data frame in the local cache is parsed to obtain data information from other target slave stations.
[0009] In one embodiment, after the steps of receiving the fast addressing data frame transmitted forward from the master station to the slave station and parsing the TYPE field of the fast addressing data frame to determine the corresponding data frame type, the method further includes: If the data frame type is per-station cached, the target Area region is determined from the DATA region of the fast-addressed data frame based on the physical sequence location; The starting address of the target register is determined based on the ADO field in the fast addressing data frame; The CMD field of the fast addressing data frame is parsed to determine the mapping table, and based on the operation relationship of the mapping table, corresponding interactive operations are performed on the data in the target Area and the data in the target register.
[0010] In one embodiment, after the step of performing corresponding interactive operations on the data in the target Area region and the data in the target register based on the operation relationship of the mapping table, the method further includes: The data to be copied is determined based on the starting offset of the target Area region; Copy the data to be copied to the local cache area; After the copying operation is completed, the fast addressing data frame is forward transmitted to the next target slave station.
[0011] In one embodiment, the step of determining the data to be copied based on the starting offset of the target Area region includes: Determine the starting offset of the PDU(s) region in the fast addressing data frame; The data between the starting offset of the PDU(s) region and the starting offset of the target Area region is used as the data to be copied.
[0012] In one embodiment, after the step of copying the data to be copied to the local cache, the method further includes: In response to local data processing operations, determine the length of the data to be processed; Based on the pre-stored local offset address, determine the starting position of the data to be accessed in the local cache. Based on the length of the data to be processed, the corresponding data content in the local cache is continuously read from the starting position; The read data is written to the target register via the internal bus.
[0013] In addition, to achieve the above objectives, this application also proposes a network system fast 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 fast addressing method described above.
[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the fast addressing method for network systems as described above.
[0015] This application provides a fast addressing method for a network system. After the master station sends a data frame with a set corresponding cache type, the slave station checks the cache method corresponding to the TYPE type of the data frame. When the master station returns the data content of the PDU area corresponding to the slave station, or the data frame returned, the slave station reads the data content of all slave stations in the PDU(s) area. The slave station can obtain the data content of other slave stations for effective detection and processing, thereby improving the network interaction efficiency. 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 fast addressing method for network systems in this application. Figure 2 A schematic diagram of the data frame format for the fast addressing method provided by this application for the network system fast addressing method; Figure 3 A schematic diagram of the topology network system connection method provided for the fast addressing method of the network system in this application; Figure 4 A schematic diagram of the PDU message format under a per-station buffered type provided for the fast addressing method of the network system in this application; Figure 5 This is a flowchart illustrating Embodiment 2 of the fast addressing method for network systems in this application. Figure 6 This is a flowchart illustrating Embodiment 3 of the fast addressing method for network systems in this application. Figure 7 This is a flowchart illustrating Embodiment 4 of the fast addressing method for network systems in this application. Figure 8 This is a flowchart illustrating Embodiment 5 of the fast addressing method for network systems in this application. Figure 9 A schematic diagram of the overall process for the fast addressing method of the network system in this application; Figure 10 This is a flowchart illustrating Embodiment Six of the fast addressing method for network systems in this application. Figure 11 A schematic diagram illustrating the cache reading method provided by the fast addressing method for the network system in this application; Figure 12 This is a schematic diagram of the device structure of the hardware operating environment involved in the fast addressing method of the network system 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 conventional master-slave industrial systems, when using the fast addressing method, in order to ensure the transmission rate, the slave station can only obtain its own corresponding data, store it in the designated register, and then immediately send out the data frame. After that, it will perform subsequent processing on its own corresponding data. It cannot obtain data information from other slave stations, resulting in low data exchange efficiency in the network.
[0023] After the master station sends a data frame with the set corresponding cache type, the slave station checks the cache method corresponding to the TYPE type of the data frame. When the master station returns the data content or data frame of the corresponding PDU area of the slave station, it reads the data content of all slave stations in the PDU(s) area. The slave station can obtain the data content of other slave stations for effective detection and processing, thereby improving the network interaction efficiency.
[0024] It should be noted that the execution subject in this embodiment can be a network system fast addressing device, a computing service device with data processing, network communication, and program execution functions, or a control device capable of implementing the above functions of a network system fast addressing device, etc. This embodiment does not specifically limit it in this way. The following uses a network system fast addressing device as the execution subject as an example to describe this embodiment and the following embodiments.
[0025] Example 1 Based on this, this application proposes a fast addressing method for network systems according to a first embodiment. Please refer to... Figure 1 The fast addressing method for the network system includes: Step S10: In response to a fast addressing operation, determine the TYPE field value of the fast addressing data frame according to the type of the fast addressing operation.
[0026] It should be noted that fast addressing operations include station-by-station caching and full-station caching, and the TYPE field value differs for different types of fast addressing data frames. For example, the data frame format for fast addressing can be as follows: Figure 2 As shown.
[0027] In the per-station buffered type, during the forward transmission between target slave stations, each target slave station performs its addressing operation and then buffers and processes the data specified in the PDU(s) area of the fast addressing data frame before forwarding it to the next target slave station. The PDU(s) area stores data information from the master station to the previous slave station, which refers to the target slave station preceding the current target slave station in the forward transmission direction. In the full-station buffered type, the fast addressing data frame buffers and processes the data within the PDU(s) area during the reverse transmission. In this case, the PDU(s) area stores data information from all target slave stations. The processing methods for the data within the PDU(s) area differ between the full-station buffered and per-station buffered types.
[0028] It should also be noted that forward transmission refers to the transmission of data frames from the master station to the slave station, station by station; reverse transmission refers to the transmission of data frames from the slave station to the master station, station by station. (See reference...) Figure 3 The master station encapsulates the data to be sent to the slave stations according to the communication protocol and sends the encapsulated data frame to the first slave station connected to it, namely slave station 1. Slave station 1's receive port (RX) receives the data frame sent by the master station, parses the data frame through its processing module, performs the corresponding operations, and then forwards the data frame through its send port (TX) to the next slave station (slave station 2). Slave station 2 receives the data frame forwarded by slave station 1 and forwards it to slave station 3, and so on, until the data frame reaches the last slave station (slave station N). This transmission is called forward transmission. The data frame travels from slave station N back to the master station via the reverse path, sequentially forwarded by the preceding slave stations; this is called reverse transmission.
[0029] In one feasible implementation, the communication protocol predefines a first type of TYPE field value corresponding to the per-station caching type and a second type of TYPE field value corresponding to the full-station caching type. When the master station generates a fast addressing data frame, it determines the type of fast addressing operation to be used in this communication. If the type of fast addressing operation is per-station caching, the TYPE field of the fast addressing data frame is configured with the first type of TYPE field value corresponding to the per-station caching type; if the type of fast addressing operation is full-station caching, the TYPE field of the fast addressing data frame is configured with the second type of TYPE field value corresponding to the full-station caching type.
[0030] Among them, the site-wide cached fast-addressing data frame can be constructed according to the data frame format of any addressing mode, such as Figure 2 As shown, simply modify it to the corresponding second type TYPE field value.
[0031] For example, please refer to Table 1. Configure the main site to use the corresponding cached data frame with fast addressing and set the TYPE field to the specified value.
[0032] Table 1 Fast Addressing Data Frame Buffer Types
[0033] Step S20: Determine the format of the PDU(s) area of the fast addressing data frame according to the type and addressing mode of the fast addressing operation.
[0034] It's important to note that a PDU (Protocol Data Unit) is a unit of data transmitted between peer layers in network communication. The PDU(s) area is the portion of a fast-addressed data frame that carries the actual data and protocol control information. It contains the specific content the sender wants to transmit to the receiver, along with related protocol control fields. Different network protocol layers have different names and structures for PDUs. For example, in the physical layer, the PDU is called a "bit stream," responsible for electrical signal transmission; in the data link layer, the PDU is called a "frame." The local buffer is a dedicated area within the slave station for temporary data storage. It stores data copied from the fast-addressed data frame for subsequent processing by the target slave station.
[0035] Among them, the full-site cached fast addressing data frame can correspond to the PDU(s) area of all addressing mode data frames, and the corresponding TYPE field can be modified.
[0036] Station-to-station cached fast addressing data frames are specified in PDU format, such as Figure 4 As shown, the entire PDU(s) is a single PDU, and the Address area is divided into ADP and ADO fields. The number of slaves corresponding to the target slave for the fast addressing operation is determined and written to the ADP field of the fast addressing data frame. The ADO field value is the starting address of the target register of the target slave to be operated on.
[0037] In this embodiment, fast addressing is an operation method used in network communication systems to quickly locate and access specific slave devices. It aims to efficiently identify and communicate with target slave devices, reducing the time and resource consumption required for the addressing process and improving the overall system response speed and operating efficiency. In a master-slave communication architecture, a slave device is a device that receives instructions from the master station and executes corresponding operations. The target slave device is the slave device designated by the master station for communication or data interaction in this fast addressing operation. The number of slave devices is the total number of target slave devices involved in this fast addressing operation. A fast addressing data frame is an information unit used to carry data related to the fast addressing operation, containing various necessary information fields. The ADP field is a field in the fast addressing data frame used to store the number of target slave devices corresponding to this fast addressing operation, and the ADO field is a field in the fast addressing data frame used to store the starting address of the target register of the target slave device corresponding to the fast addressing operation.
[0038] As an optional implementation, the target slave station involved in the fast addressing operation is determined through the internal data storage structure based on the information carried by the fast addressing operation. If the fast addressing operation specifies a range of slave station addresses, the slave station with the corresponding address is found in the address table as the target slave station. By iterating through the target slave station list, the number of identified target slave stations is counted to obtain the number of slave stations corresponding to the target slave station in this fast addressing operation. The calculated number of slave stations is written into the ADP field of the data frame.
[0039] Step S30: Write the length of the DATA area in the PDU of the fast addressing data frame into the PduLen field of the fast addressing data frame.
[0040] In this embodiment, the DATA area is an important component of the fast addressing data frame, used to store the actual data content to be transmitted. The specific content depends on the requirements of the fast addressing operation. The size of the DATA area can vary according to the actual amount of data. The PduLen field, i.e., the protocol data unit length field, is used to store the length information of the DATA area.
[0041] As an optional implementation, the data content to be transmitted in this fast addressing operation is clearly defined, and this data is stored in the DATA area of the fast addressing data frame according to a certain format and order. The number of bytes occupied in the DATA area is calculated by traversing the data and accumulating the byte count. The corresponding PduLen field position in the fast addressing data frame structure is located, and the calculated DATA area length value is converted according to the data type specified by the PduLen field and then written into the PduLen field.
[0042] Optionally, after step S30, the addressing mode of the fast addressing operation is written to the CMD field of the fast addressing data frame. The CMD (Command) field is a field in the fast addressing data frame used to store instruction information representing the addressing mode. The slave station executes the corresponding operation based on the value of this field. Addressing modes include hold, read, write, and exchange operations. Hold or read operations configure the corresponding field in the DATA area to its initial state to retain existing data or read the content data of the target slave station's target register into the corresponding field in the DATA area of the target slave station in the fast addressing data frame. Write or exchange operations configure the content data to be written to the target register into the corresponding field in the DATA area to write the content data into the target slave station's target register or exchange it with the content data of the target slave station's target register.
[0043] For example, the CMD field values corresponding to different addressing modes under different TYPE types are predefined in the communication protocol. For instance, in a per-station buffered fast addressing data frame, each type of CMD field value corresponds to an operation relationship table. The operation relationship table can contain all of the following operations: hold, read, write, or exchange, or it can contain a subset of these operations. For example, configuring the CMD field value to 0x01 or 0x02, etc., will result in different operation relationship tables for different field values. Based on the message field arrangement order of the operation relationship table and the operation mode corresponding to each part of the field, the relevant fields in the DATA area of the PDU are configured. When a field corresponds to a hold or read operation, according to the communication protocol, that field in the DATA area of the fast addressing data frame is set to its initial state. When a field corresponds to a write or exchange operation, the data to be written to the target slave's target register is written to that field in the DATA area of the fast addressing data frame. In a site-wide cached fast addressing data frame, CMD can be any type. Change the TYPE field value to the second type of TYPE field value corresponding to the site-wide cached type, and configure the message structure and DATA data according to the addressing mode of CMD.
[0044] Step S40: Send the configured fast addressing data frame to the target slave station.
[0045] For example, a configured fast-address data frame is sent to the network via a network interface so that slave stations in the network can receive the data frame.
[0046] This embodiment provides a fast addressing method for network systems. First, it determines the number of target slave stations corresponding to the fast addressing operation and writes this number into the ADP field, explicitly informing the slave stations of the number of target slave stations involved in this communication. The length of the DATA area is written into the PduLen field so that the slave station can determine the location of the data stored in the fast addressing data frame. The configured fast addressing data frame is then sent to the target slave station, improving the overall communication efficiency of the system.
[0047] Embodiment 2 of this application proposes a fast addressing method for a network system, applied to a slave station, referring to... Figure 5 The fast addressing method for the network system further includes: Step A10: Receive the fast addressing data frame being transmitted from the master station to the slave station in the forward direction, and parse the TYPE field of the fast addressing data frame to determine the corresponding data frame type.
[0048] The target slave station receives fast-addressed data frames transmitted from the master station to the slave station in the forward direction and parses the TYPE field to determine the data frame type, thus clarifying the transmission and processing rules for the fast-addressed data frame. By accurately identifying the data frame type, the slave station can operate according to the corresponding rules, ensuring the correctness of communication.
[0049] Step A20: If the data frame type is a site-wide cache type, parse the CMD field of the fast addressing data frame to determine the addressing mode.
[0050] When the data frame type is full-site cached, parsing the CMD field of the fast-addressed data frame to determine the addressing mode is to enable the target slave station to accurately address the data to be processed in the manner specified by the master station.
[0051] For example, after receiving a full-cache fast addressing data frame, the target station's processor extracts the CMD field from the data frame according to the format specified in the protocol, parses the CMD field according to the pre-set encoding rules, and determines the addressing mode by judging the bit combination in the field value.
[0052] Step A30: Perform the corresponding addressing operation based on the addressing mode obtained from the parsing.
[0053] It should be noted that addressing operations include read operations, write operations, etc. A data frame for a site-wide cached addressing operation is as follows: Figure 2 As shown, all addressing modes are available.
[0054] For example, the target slave station interacts with the data in the target register of the fast addressing data frame according to the addressing mode defined in the CMD field to complete the addressing operation.
[0055] Step A40: After completing the addressing operation, the local counter is incremented by one.
[0056] Incrementing the local counter by one marks that the node has successfully processed the addressing operation command, providing a clearing flag for the subsequent reverse transmission phase, and ensuring that only node-replicated data is processed during the reverse transmission.
[0057] It should be noted that the local counter is a status flag register inside the slave station, which records the number of times the node needs to obtain data from the reverse data frame.
[0058] Step A50: The fast addressing data frame is transmitted forward from the sending port to the next target slave station in the network.
[0059] For example, please refer to Figure 3In the network topology, the updated fast addressing 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.
[0060] This embodiment provides a fast addressing method for network systems. By parsing the CMD field of the cached data frames across the entire site, the addressing mode is accurately determined. Based on the parsing result, corresponding operations are executed to ensure that data accurately reaches the target location, avoiding data loss or misoperation due to addressing errors and improving the accuracy of data interaction. After completing the read / write addressing operation, the corresponding local counter of the target slave station is incremented, marking that this node needs to process response data during the data return phase, ensuring that each station recovers valid information.
[0061] Based on Embodiment 2, Embodiment 3 of this application proposes a fast addressing method for network systems, referring to... Figure 6 After step A50, the following is included: Step A60: If the fast addressing data frame is received again from the slave station back to the master station, determine whether the local counter is a non-zero value.
[0062] Identify whether this node needs to process the return frame data to avoid invalid copying operations.
[0063] For example, a special frame header identifier of the returned frame is detected, the current value of the counter register is read, and the circuit output flag is determined.
[0064] Step A70: If the local counter is non-zero, then copy all data in the PDU(s) area of the fast addressing data frame to the local buffer.
[0065] For example, if the local counter is non-zero, the target slave will read the PDU(s) area data of the fast addressing data frame and write it into the pre-allocated local buffer.
[0066] Step A80: After the copy operation is completed, the local counter is decremented by one.
[0067] Step A90: After the fast addressing data frame is sent back in reverse, the data frame in the local buffer is parsed to obtain data information of other target slave stations.
[0068] For example, after the data copying operation is completed, the corresponding counter operation function is called to decrement the value of the local counter by one.
[0069] This embodiment provides a fast addressing method for a network system. This embodiment records the number of times data frames need to be processed and forwarded through a local counter. When the target slave station receives the fast addressing data frame sent back in reverse, it performs a PDU(s) area copying operation based on the non-zero value of the counter, ensuring that the data frames can be processed in a predetermined logical order. Each slave station can obtain data information from other stations, improving the accuracy of data transmission and the efficiency of interaction.
[0070] Based on Embodiment 2, Embodiment 4 of this application proposes a fast addressing method for network systems, referring to... Figure 7 After step A10, the following steps are also included: A100, if the data frame type is per-station cached, the target Area region is determined from the DATA region of the fast-addressed data frame according to the physical sequence location.
[0071] It should be noted that in per-station buffered data frame processing, the Area region is the sub-data region corresponding to each target slave station after the DATA region is divided according to the number of target slave stations. It is the specific range of data processed by each target slave station.
[0072] For example, based on the PduLen and ADP fields of the fast addressing data frame, the length of the DATA area in the PDU of the fast addressing data frame and the number of target slaves are determined. Based on the obtained length of the DATA area and the number of target slaves, the target slaves pre-allocate sufficient cache space to store data, preparing for subsequent computation and copying operations.
[0073] Next, based on the length of the DATA area in the PDU and the number of slave stations, the DATA area is divided into Area regions corresponding one-to-one with the target slave stations. The unit length of the Area region corresponding to each target slave station is calculated based on the length of the DATA area, ensuring a reasonable division of the data area and guaranteeing that each target slave station can accurately obtain its own data portion. The unit length, which is the length of the Area region corresponding to each target slave station, is obtained by dividing the length of the DATA area by the number of target slave stations, thus determining the amount of data each target slave station processes.
[0074] It should be noted that the physical sequence position of a slave station is a physical location identifier assigned to each slave station in sequence within the network system. This identifier distinguishes different slave stations and clarifies their order within the entire slave station set. The physical sequence position of the target slave station corresponds one-to-one with the position of its corresponding Area region within the DATA region. For example... Figure 9 As shown, in the DATA area, the Area regions corresponding to the target slave stations with physical sequence positions 1, 2, ..., n are Area1, Area2, ..., Area.
[0075] A110 determines the starting address of the target register based on the ADO field in the fast addressing data frame.
[0076] A120 parses the CMD field of the fast addressing data frame, determines the mapping table, and performs corresponding interactive operations on the data in the target Area and the data in the target register based on the operation relationship of the mapping table.
[0077] A mapping table showing the relationship between the data location in the corresponding DATA area and the content of the target address starting with the ADO field for each type of CMD field.
[0078] The relationships within the mapping table include hold operations, read operations, write operations, and swap operations, which are performed during the forward transmission of fast-addressed data frames.
[0079] If the operation relationship is reserved, the corresponding reservation operation is executed. Based on the target address information, the data in the local target storage area does not interact with the content of the corresponding message field in the data frame.
[0080] If the operation relationship is read, the corresponding read operation is executed, and the data in the local target storage area is read into the corresponding message field in the data frame according to the target address information.
[0081] If the operation relationship is write, the corresponding write operation is executed, and the content of the corresponding message field in the data frame is written to the local target storage area according to the target address information.
[0082] If the operation relationship is swap, the corresponding swap operation is executed, and the content of the corresponding message field in the data frame is swapped with the data in the original target storage area according to the target address information.
[0083] Based on Embodiment 4, Embodiment 5 of this application proposes a fast addressing method for network systems, referring to... Figure 8 After step A120, the following steps are also included: Step A130: Determine the data to be copied based on the starting offset of the target Area region.
[0084] Optionally, the starting offset of the PDU(s) region in the fast addressing data frame is determined, and the data between the starting offset of the PDU(s) region and the starting offset of the target Area region is used as the data to be copied.
[0085] It should be noted that the starting offset of the target area is the offset of the beginning of the target area relative to the frame header. The starting offset of the PDU(s) area is the offset of the beginning of the PDU(s) area relative to the frame header.
[0086] For example, let the physical sequence position of the target slave station be s (s starts counting from 1), and the unit length of the Area corresponding to each target slave station be L, then the data length is Len_Offset=(s 1)×L.
[0087] If the initial offset of the DATA area relative to the frame header is set to Base_Address, then the starting offset address of the target Area of the target slave station is Data_Position = Base_Address + Len_offset.
[0088] Step A140: Copy the data to be copied to the local cache.
[0089] For example, the target slave station determines the range of data to be copied from the fast addressing data frame based on the starting offset of the target Area region and the starting offset of the PDU(s) region, i.e., from the starting offset of the PDU(s) region to the starting offset of the target Area region in the per-station buffered fast addressing data frame. Then, the data within this range is accurately copied to the local buffer.
[0090] Step A150: After completing the copying operation, the fast addressing data frame is output at the sending port in the forward transmission direction.
[0091] As an example in this embodiment, please refer to Figure 9As shown in the flowchart, the master station first configures the corresponding cache type data rules for fast addressing and sets the TYPE field to a specific value. The slave station receives the forward-transmitted fast-addressed data frame and determines the type corresponding to the TYPE field value. If it is determined to be a per-station cache type, the slave station copies the data content from the starting position to the starting position of the target Area area corresponding to the local slave station in the PDU(s) area of the fast-addressed data frame to the local cache. Then it determines whether the current slave station is the last target slave station. If not, the fast-addressed data frame continues to be forward-transmitted to the next target slave station in the network; if so, the fast-addressed data frame is reverse-transmitted back to the previous target slave station in the network until it returns to the master station. If it is determined to be a full-station cache type, the slave station increments its local counter by one after completing the TYPE-corresponding addressing operation. Next, it is determined whether this is the last target slave station. If it is not, the fast addressing data frame is transmitted forward to the next target slave station. If it is, the fast addressing data frame is transmitted in reverse, the entire PDU(s) area is copied to the local buffer, and then sent to the previous target slave station. After receiving the transmitted fast addressing data frame, the target slave station copies the entire PDU(s) area of the fast addressing data frame to its local buffer and continues to transmit in reverse according to the receiving port used in the forward transmission. The master station receives the data frame returned by the slave station and ends the process.
[0092] Specifically, after receiving a fast addressing data frame in the forward transmission, the slave chip detects the type corresponding to the TYPE field value to determine whether it corresponds to a global cached type or a per-station cached type. When the TYPE field value is detected as a per-station cached type, please refer to... Figure 4 The diagram shows the PDU message format under per-station buffering. In this case, the PDU(s) in the data frame is a complete PDU. Let PduLen identify the length of the DATA area in the PDU, and ADP be the total number of slave stations interacting with this PDU. The unit length of the DATA content corresponding to each slave station is... The calculation formula is as follows:
[0093] The range of the DATA area read by the i-th slave station is the distance from the starting position of the PDU(s) in the data frame to the position corresponding to the current i-th slave station. The data content contained in the data area is copied to the local cache, including local caches such as SRAM / DRAM.
[0094] When the type corresponding to the TYPE field value is detected as full-site cached, please refer to Table 2. In the forward transmission, only the addressing operation corresponding to TYPE is completed. At this time, no copying operation is performed, and the local counter is incremented by one. When the sending port during the forward transmission receives the fast-addressed data frame again, if the local counter is non-zero, all data in the PDU(s) area of the data frame is copied to the local buffer, and the local counter is decremented by one.
[0095] Table 2. Slave Site Processing Flow under Site-wide Caching
[0096] This embodiment provides a fast addressing method for network systems. This embodiment accurately parses data frame information, reasonably divides data areas, ensures that each target obtains the correct data from the station, and realizes the orderly forwarding of data frames in the network, thereby improving the efficiency of network communication.
[0097] Based on Embodiments 3 and 5, Embodiment 6 of this application proposes a fast addressing method for network systems, referring to... Figure 10 After step A140, the following is included: Step A160, in response to the local data processing operation, determines the length of the data to be processed.
[0098] It should be noted that local data processing operations are a series of data processing operations initiated by the target from within the site. These operations can be triggered by received instructions, preset program logic, or business requirements.
[0099] For example, after receiving a trigger signal for a local data processing operation, information about the length of the data to be processed is extracted according to a preset instruction format and data processing logic.
[0100] Step A170: Determine the starting position of the data to be accessed in the local cache based on the offset address pre-stored locally.
[0101] It's important to note that the offset address is an offset value relative to the starting address of the cached data in the local cache. It's used to determine the specific location of the data to be accessed within the local cache. The local cache is divided into multiple storage units, each with a fixed address. The offset address is determined by adding an offset value to the known starting address of the local cache to locate the starting storage unit of the data to be accessed.
[0102] Optionally, the slave processor has a dedicated register inside to store the starting address of the local cache.
[0103] For example, based on the requirements of local data processing operations, the offset address is read from a preset storage unit. The starting address of the local cache and the offset address are added together to obtain the starting position of the required data in the local cache.
[0104] Step A180: Based on the length of the data to be processed, continuously read the corresponding data content from the local cache from the starting position.
[0105] For example, a read instruction is sent to the memory controller based on the calculated starting position and the length of the data to be processed. The memory controller then reads the corresponding length of data continuously from the local cache according to the address information in the instruction and temporarily stores the data in an internal data buffer.
[0106] Step A190: Write the read data content into the target register via the internal bus.
[0107] It should be noted that the internal bus is a common channel for data transmission between various components within the slave station, used to transfer read data from the local buffer to the target register.
[0108] For example, the slave processor sends the address of the target register to the register file via the internal address bus, and simultaneously transmits the read data to the input port of the register file via the internal data bus. The register file then writes the data into the corresponding target register based on the address information on the address bus.
[0109] As an example of this embodiment, please refer to Figure 11 Each slave station caches its PDU data in its local buffer of SRAM (Static Random Access Memory) or DRAM (Dynamic Random Access Memory). The slave chip retrieves the specified length of content data from the PDU(s) according to the locally set offset, reads the specified content into the corresponding register, and then the slave station performs further processing.
[0110] This embodiment provides a fast addressing method for network systems. This embodiment determines the starting position of the data to be accessed in the local cache by using a pre-stored offset address, which can accurately locate the specific position of the data to be accessed in the local cache, thereby ensuring the accuracy of data processing.
[0111] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the fast addressing method of the network system of this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0112] This application provides a network system fast 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 fast addressing method in Embodiment 1 above.
[0113] The following is for reference. Figure 12 The diagram illustrates a structural schematic suitable for implementing a network system fast addressing device in the embodiments of this application. The network system fast addressing device in the embodiments of this application may include, but is not limited to, mobile devices such as mobile phones, laptops, personal digital assistants (PDAs), tablet computers (PADs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed devices such as I / O modules, PLC controllers, and desktop computers. Figure 12 The network system fast 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.
[0114] like Figure 12As shown, the network system fast 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 fast 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 fast addressing device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows a network system fast addressing device with various systems, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.
[0115] 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.
[0116] The network system fast addressing device provided in this application, employing the network system fast 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 fast addressing device provided in this application are the same as those of the network system fast addressing method described in the above embodiments, and other technical features of this network system fast addressing device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0117] 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.
[0118] 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.
[0119] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the network system fast addressing method in the above embodiments.
[0120] 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.
[0121] The aforementioned computer-readable storage medium may be included in a network system fast addressing device; or it may exist independently and not assembled into a network system fast addressing device.
[0122] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a network system fast addressing device, enable the network system fast addressing 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).
[0123] 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.
[0124] 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.
[0125] 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 fast addressing method for network systems, thereby solving 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 fast addressing method for network systems provided in the above embodiments, and will not be repeated here.
[0126] 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 fast addressing method for a network system, characterized in that, Applied to the master station, the network system fast addressing method includes: In response to a fast addressing operation, the TYPE field value of the fast addressing data frame is determined according to the type of the fast addressing operation; The format of the PDU(s) area of the fast addressing data frame is determined according to the type and addressing mode of the fast addressing operation; Write the length of the DATA area in the PDU of the fast addressing data frame into the PduLen field of the fast addressing data frame; Send the configured fast addressing data frame to the target slave station; The types of fast addressing operations include station-by-station caching and full-station caching. The step of determining the TYPE field value of the fast addressing data frame according to the type of fast addressing operation includes: If the type of the fast addressing operation is the per-station cache type, the TYPE field of the fast addressing data frame is configured to the first type of TYPE field value corresponding to the per-station cache type; If the type of the fast addressing operation is the site-wide cache type, the TYPE field of the fast addressing data frame is configured to the second type TYPE field value corresponding to the site-wide cache type.
2. A fast addressing method for a network system, characterized in that, Applied to the slave station, the fast addressing method for the network system includes: Receive fast addressing data frames transmitted from the master station to the slave station in the forward direction, and parse the TYPE field of the fast addressing data frames to determine the corresponding data frame type; If the data frame type is a site-wide cache type, parse the CMD field of the fast addressing data frame to determine the addressing mode; Execute the corresponding addressing operation based on the addressing mode obtained from the parsing; After the addressing operation is completed, the local counter is incremented by one. The fast-addressed data frame is transmitted forward from the sending port to the next target slave station in the network; If the data frame type is per-station cached, the target Area region is determined from the DATA region of the fast-addressed data frame based on the physical sequence location; The starting address of the target register is determined based on the ADO field in the fast addressing data frame; The CMD field of the fast addressing data frame is parsed to determine the mapping table, and based on the operation relationship of the mapping table, corresponding interactive operations are performed on the data in the target Area and the data in the target register.
3. The fast addressing method for network systems as described in claim 2, characterized in that, After the step of forward transmitting the fast-addressed data frame from the sending port to the next target slave station in the network, the method further includes: If the fast addressing data frame is received again from the station to the master station in reverse, determine whether the local counter is a non-zero value. If the local counter is non-zero, then all data in the PDU(s) area of the fast addressing data frame is copied to the local buffer. After the copy operation is completed, the local counter is decremented by one. After the fast addressing data frame is sent back in reverse, the data frame in the local cache is parsed to obtain data information from other target slave stations.
4. The fast addressing method for network systems as described in claim 2, characterized in that, After the step of performing corresponding interactive operations on the data in the target Area region and the data in the target register based on the operation relationship of the mapping table, the method further includes: The data to be copied is determined based on the starting offset of the target Area region; Copy the data to be copied to the local cache area; After the copying operation is completed, the fast addressing data frame is forward transmitted to the next target slave station.
5. The fast addressing method for network systems as described in claim 4, characterized in that, The step of determining the data to be copied based on the starting offset of the target Area includes: Determine the starting offset of the PDU(s) region in the fast addressing data frame; The data between the starting offset of the PDU(s) region and the starting offset of the target Area region is used as the data to be copied.
6. The fast addressing method for network systems as described in claim 4, characterized in that, After the step of copying the data to be copied to the local cache, the method further includes: In response to local data processing operations, determine the length of the data to be processed; Based on the pre-stored local offset address, determine the starting position of the data to be accessed in the local cache. Based on the length of the data to be processed, the corresponding data content in the local cache is continuously read from the starting position; The read data is written to the target register via the internal bus.
7. A network system fast 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 fast addressing method for a network system as described in any one of claims 1 to 6.
8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the network system fast addressing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Controller area network (CAN) bus system and application layer communication method in same
CN101626333A
Periodic message receiving and caching method based on FPGA
CN112631809A