Management message generation method and device, electronic equipment and medium
By optimizing the Ethernet frame structure and setting the start header field and tag control field according to the virtual LAN situation of the slave station, the problem of low control accuracy caused by large transmission delay of management messages is solved, and more efficient industrial control is achieved.
Patent Information
- Application Number
- CN202411222625.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-12
AI Technical Summary
In the field of industrial control, the large transmission delay of management messages leads to low control accuracy.
By optimizing the Ethernet frame structure, the start header field value is determined based on whether the slave stations are in the same virtual LAN, and the tag control field is set or not set in the frame header area to encapsulate tag control information and payload data and assemble management messages.
It improves the efficiency of carrying management messages, reduces transmission latency, and enhances the precision of industrial control.
Smart Images

Figure CN118945149A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial communication technology, and in particular to a management message generation method, device, electronic device and medium. Background Art
[0002] In the field of industrial control, such as manufacturing, energy, petrochemical, and power collection, there are many factors that affect control accuracy, such as network congestion and message scheduling priority. The impact of the above factors on accuracy is mainly reflected in the transmission delay of management control messages. That is, if the transmission delay is large, the control accuracy is poor, and if the transmission delay is small, the control accuracy is high. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a management message generation method, device, electronic device and medium, which can effectively solve the problem of large transmission delay of industrial management messages, resulting in low industrial control accuracy, etc.
[0004] In a first aspect, an embodiment of the present application provides a management message generation method, which is applied to an industrial master station in a dedicated network, and the method includes:
[0005] Determine the start header field value in the preset Ethernet frame according to whether each slave station is in the same virtual local area network, and determine whether to set the label control field in the frame header area in the preset Ethernet frame;
[0006] Encapsulating the start header field value into the start header field of the frame header area;
[0007] When the tag control field is set in the frame header area, tag control information is determined according to access requirements, and the tag control information is encapsulated into the tag control field;
[0008] Determine the load data according to the target slave station to be accessed and the service management requirements, and encapsulate the load data into the load area in the Ethernet frame;
[0009] The management message is assembled according to the frame header area and the load area in the Ethernet frame.
[0010] In some embodiments, determining a start header field value in a preset Ethernet frame according to whether each slave station is in the same virtual local area network, and determining whether to set a tag control field in a frame header area in the preset Ethernet frame includes:
[0011] If the slave stations are in the same virtual local area network, determining that the start header field value is a first preset value, and determining that no label control field is set in the frame header area;
[0012] If the slave stations are not in the same virtual local area network, the start header field value is determined to be a second preset value, and a tag control field is determined to be set in the frame header area.
[0013] In some embodiments, the tag control field includes a priority identifier and a virtual local area network identifier;
[0014] The step of determining the tag control information according to the access requirement and encapsulating the tag control information into the tag control field includes:
[0015] Determine the target virtual local area network where the target slave station is located according to the access requirement, determine the value of the virtual local area network identifier according to the target virtual local area network and encapsulate it into the virtual local area network identifier;
[0016] The processing priority of the management message is determined according to the access requirement, and the processing priority is encapsulated into the priority identifier.
[0017] In some embodiments, the load area includes at least one protocol data unit; the protocol data unit includes a slave address field and a data field;
[0018] The step of determining the load data according to the target slave station to be accessed and the service management requirements, and encapsulating the load data into the load area in the Ethernet frame includes:
[0019] Setting a corresponding number of the protocol data units according to the number of target slave stations to be accessed;
[0020] The address of the target slave station is encapsulated into the slave station address field in the corresponding protocol data unit; and the management information formulated according to the business management requirements is encapsulated into the data address field in the corresponding protocol data unit.
[0021] In some embodiments, the Ethernet frame further includes a frame tail area; the frame header area in the Ethernet frame further includes an Ethernet type field;
[0022] The method further comprises: encapsulating a preset frame check sequence into the frame tail area so that the slave station can check the integrity of the management message;
[0023] The preset protocol type is encapsulated into the Ethernet type field to instruct the slave station to parse the management message according to the protocol type.
[0024] In some embodiments, the start header field is located at the front end of the Ethernet frame;
[0025] The step of determining that the start header field value is a first preset value, where the first preset value is used to indicate that the management message of the target slave station does not contain the label control information, comprises:
[0026] The starting header field value is represented by a binary value alternating between "1" and "0"; the first preset value is used to instruct the target slave station to determine that the management message does not contain the label control information based on the high and low level signals corresponding to the binary value.
[0027] In a second aspect, an embodiment of the present application provides a management message generation device, which is applied to an industrial master station in a dedicated network, and the device includes:
[0028] An information field determination module is used to determine the start header field value in a preset Ethernet frame according to whether each slave station is in the same virtual local area network, and to determine whether to set a label control field in a frame header area in the preset Ethernet frame;
[0029] A starting header field value encapsulation module, used for encapsulating the starting header field value into the starting header field of the frame header area;
[0030] A tag control information encapsulation module, used to determine tag control information according to access requirements when the tag control field is set in the frame header area, and encapsulate the tag control information into the tag control field;
[0031] A load data encapsulation module, used to determine the load data according to the target slave station to be accessed and the service management requirements, and encapsulate the load data into the load area in the Ethernet frame;
[0032] The management message construction module is used to assemble the management message according to the frame header area and the load area in the Ethernet frame.
[0033] In some embodiments, the information field determination module is specifically used to:
[0034] When each slave station is in the same virtual local area network, determining that the start header field value is a first preset value, and determining that no label control field is set in the frame header area;
[0035] When the slave stations are not in the same virtual local area network, the start header field value is determined to be a second preset value, and a tag control field is determined to be set in the frame header area.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement a management message generation method provided in the first aspect of the present application.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed on a processor, it implements a management message generation method provided in the first aspect of the present application.
[0038] The embodiments of the present application have the following beneficial effects:
[0039] According to the virtual local area network divided by the slave station, the frame header area of the Ethernet frame preset in this application includes a start header field, or also includes a tag control field. The start header field value is determined according to whether each slave station is in the same virtual local area network, and whether to set the tag control field in the frame header area of the preset Ethernet frame is determined according to whether each slave station is in the same virtual local area network; when the tag control field is set in the frame header area, the tag control information is determined according to the access requirements, and the tag control information is encapsulated into the tag control field; the load data is determined according to the target slave station to be accessed and the service management requirements, and the load data is encapsulated into the load area of the Ethernet frame; according to the frame header area and the load area in the Ethernet frame, the management message is assembled.
[0040] This application increases the carrying efficiency by optimizing the management message structure, and the amount of message data processed per unit time will be significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A schematic diagram of a traditional Ethernet frame format in a management message generation method according to an embodiment of the present application is shown;
[0043] Figure 2 A schematic diagram of an improved Ethercat protocol frame format in a management message generation method according to an embodiment of the present application is shown;
[0044] Figure 3 A schematic diagram of the structure of the load area in the improved Ethercat protocol in the management message generation method of an embodiment of the present application is shown;
[0045] Figure 4 A flow chart of a management message generation method according to an embodiment of the present application is shown;
[0046] Figure 5A schematic diagram showing the connection between the master station and the slave station in the management message generation method of an embodiment of the present application is shown;
[0047] Figure 6 A structural schematic diagram of a management message generating device according to an embodiment of the present application is shown.
[0048] Description of main component symbols:
[0049] 610 - information field determination module; 620 - start header field value encapsulation module; 630 - label control information encapsulation module; 640 - load data encapsulation module; 650 - management message construction module. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0051] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0052] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0053] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0054] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0055] like Figure 1 The figure shows the traditional Ethernet frame format, including the Ethernet frame header, data load area (Payload) and frame tail area (Frame Check Sequence, FCS). The Ethernet frame header includes the destination MAC address, source MAC address, Ethernet tag TAG and Ethernet type EtherType. The Ethernet tag TAG includes TPID and TCI. TCI includes three fields: Priority, CFI and VID.
[0056] In the Ethernet tag TAG, the first two bytes are TPID, whose value is fixed to 0x8100, indicating that it is a dot1q standard TAG; the last two bytes are TCI (TAG Control Information), which consists of three parts: a 3-bit priority identifier Priority, a 1-bit canonical format indicator CFI, and a 12-bit virtual LAN identifier VID.
[0057] Priority identifier (Priority): used to indicate the priority of the message. There are 8 priority levels in total. It is mainly used to indicate which message should be sent first when the switch is blocked.
[0058] Canonical Format Indicator (CFI): In Ethernet switches, the canonical format indicator is always set to 0. Due to compatibility, CFI is often used between Ethernet-type networks and token ring-type networks. If the frame received at the Ethernet port has CFI, it is set to 1.
[0059] Virtual LAN Identifier (VLAN ID; VID): used to store the VLAN ID of the target slave station to indicate which VLAN it belongs to. A total of 4096 VLANs can be identified.
[0060] In the field of industrial control, for internal private networks, the existing Ethernet frame structure is complex and the control delay is relatively large.
[0061] That is to say, there is still a lot of room for optimization in the application of traditional Ethernet frames in the field of industrial control. For example, in this application, the MAC address and TAG field (including TPID, TCI, where TCI includes three fields: Priority, CFI and VID) can be optimized to improve the accuracy of industrial control. Therefore, this application provides a management message generation method, device, electronic device and medium.
[0062] In the embodiment of the present application, the destination MAC address and the source MAC address are first removed, and replaced by a Byte-sized field representing the frame start header; the different values of the start header field are used to indicate the scene with TCI or the scene without TCI. The role of the TAG field is to mark the subnet. For an internal private network, it is okay to remove the TPID and only keep the TCI field. The TCI field includes user priority, CFI, and VID. In other words, the VLAN in the field has no difference in function compared to the previous VLAN, except that the TPID field has been optimized.
[0063] The following first introduces the structure of the Ethernet frame preset in the embodiment of the present application. Figure 2 As shown, the preset Ethernet frame includes: a frame header, a load area (payload of the Ethernet Frame) and a frame tail area (FCS). Among them, the frame header includes a start header field (START), a TCI field and an EtherType field. The TCI field includes a Priority field, a CFI field and a VID field. Exemplarily, the structure of the preset Ethernet frame in the embodiment of the present application is specifically shown in Table 1, which is an improved Ethercat protocol.
[0064] Table 1 Improved Ethercat protocol command frame format
[0065]
[0066] Through the improvements in the embodiments of the present application, each Ethernet frame in the present application is 13 bytes less than the existing Ethernet frame.
[0067] In the improved Ethercat protocol, the load area (payload of Ethernet Frame) includes the EtherCAT header area and the EtherCAT data area, such as Figure 3 shown.
[0068] The EtherCAT header area includes the EtherCAT data length, reserved bits and type. The EtherCAT data area includes a 2-byte data header and a 44-1498-byte data area. The data area consists of one or more protocol data units, each of which corresponds to an independent slave device and slave storage area. The FCS area is used to verify the integrity of the frame during transmission.
[0069] The protocol data unit includes the slave address field ADP (Address Position, used to store the target slave address position), ADO (Address Offset, address offset) and the data field. ADP is used to determine the station address, and ADO determines the actual physical address where the data is stored in the slave memory.
[0070] The management message generation method is described below in conjunction with some specific embodiments.
[0071] Figure 4 A flow chart of a management message generation method according to an embodiment of the present application is shown. Exemplarily, the management message generation method is applied to an industrial master station in a dedicated network and includes the following steps:
[0072] S100, determining a start header field value in a preset Ethernet frame according to whether each slave station is in the same virtual LAN (VLAN), and determining whether to set a tag control field in a frame header area in the preset Ethernet frame. Each slave station is in communication connection with the master station.
[0073] For example, the connection between the master station and each slave station is as follows: Figure 5 As shown, the master station is connected to the IN port and OUT port in the management port of slave station 1 through the management port, and each slave station is connected correspondingly through the IN port and the OUT port.
[0074] Further, the step of determining a start header field value in a preset Ethernet frame according to whether each slave station is in the same virtual local area network, and determining whether to set a tag control field in a frame header area in the preset Ethernet frame, includes:
[0075] If the slave stations are in the same virtual local area network, the start header field value is determined to be a first preset value, and the tag control field is determined not to be set in the frame header area. The first preset value is used to indicate that the management message of the target slave station does not contain the tag control information;
[0076] If the slave stations are not in the same virtual local area network, the start header field value is determined to be a second preset value, and a tag control field is set in the frame header area. The second preset value is used to indicate that the management message of the target slave station contains the tag control information.
[0077] Furthermore, the start header field is located at the front end of the Ethernet frame.
[0078] The step of determining that the start header field value is a first preset value, where the first preset value is used to indicate that the management message of the target slave station does not contain the label control information, comprises:
[0079] The starting header field value is represented by a binary value alternating between "1" and "0"; the first preset value is used to indicate to the target slave station that the management message does not contain the tag control information according to the high-low level signal corresponding to the binary value. Preferably, the first preset value is 0x55; the second preset value is 0x5D.
[0080] The starting header field of the Ethernet frame in the embodiment of the present application indicates the start bit of each frame, starting with 0x55 or 0x5D. Since the number "5" is represented by 0b0101 in binary, it is a high-low alternating level, and this high-low alternating level is used to determine whether there is tag control information (TCI information). Among them, 0x55 indicates that there is no TCI information, and 0x5D indicates that the management message contains tag control information.
[0081] S200, encapsulate the start header field value into the start header field of the frame header area. The start header field value is used to instruct a slave station receiving the management message to determine whether to parse the information in the tag control field.
[0082] S300, when the tag control field is set in the frame header area, tag control information is determined according to access requirements, and the tag control information is encapsulated into the tag control field.
[0083] Further, the tag control field includes a priority identifier and a virtual local area network identifier;
[0084] The step of determining the tag control information according to the access requirement and encapsulating the tag control information into the tag control field includes:
[0085] Determine the target virtual local area network where the target slave station is located according to the access requirement, determine the value of the virtual local area network identifier according to the target virtual local area network and encapsulate it into the virtual local area network identifier;
[0086] The processing priority of the management message is determined according to the access requirement, and the processing priority is encapsulated into the priority identifier.
[0087] S400, determining load data according to a target slave station to be accessed and a service management requirement, and encapsulating the load data into a load area in the Ethernet frame.
[0088] Further, the load area includes at least one protocol data unit; the protocol data unit includes a slave address field and a data field;
[0089] The step of determining the load data according to the target slave station to be accessed and the service management requirements, and encapsulating the load data into the load area in the Ethernet frame includes:
[0090] Setting a corresponding number of the protocol data units according to the number of target slave stations to be accessed;
[0091] The address of the target slave station is encapsulated into the slave station address field in the corresponding protocol data unit; and the management information formulated according to the business management requirements is encapsulated into the data address field in the corresponding protocol data unit.
[0092] S500: Assemble the management message according to the frame header area and the load area in the Ethernet frame.
[0093] The management message is used for remote access and remote control of the target slave station, and is used to instruct the target slave station to update configuration information, diagnose faults, report errors, or update security policy configuration, etc.
[0094] Furthermore, the Ethernet frame also includes a frame tail area; the frame header area in the Ethernet frame also includes an Ethernet type field;
[0095] The method further comprises: encapsulating a preset frame check sequence into the frame tail area so that the slave station can check the integrity of the management message;
[0096] The preset protocol type is encapsulated into the Ethernet type field to instruct the slave station to parse the management message according to the protocol type.
[0097] The management message generation method of the embodiment of the present application is applied to an industrial master station in a dedicated network. The dedicated network of the present application refers to the Ethernet protocol running in the link, which can be replaced by 0x55 and 0x5D. If there is a protocol that cannot be replaced, this improvement is not applicable. For example: The actual application scenario of the Ethercat protocol is to use two separate network ports as IN ports and OUT ports. There is no need to learn MAC addresses, and the subnet information can be represented by a simplified TCI, thereby improving the network's carrying efficiency. The present application is applicable to all Ethernet networks that independently occupy management ports.
[0098] The improved EtherCAT protocol of this application has higher load efficiency and shorter transmission delay. Calculated based on 64 Byte length, the load efficiency before improvement (load area 42 Byte) is 65.63%, and the load efficiency after improvement (load area 55 Byte) is 87.5%, and the load efficiency is increased by 21.87%.
[0099] This application optimizes the EtherCAT message structure and increases the carrying efficiency. The amount of data processed per unit time will be significantly increased. Before the improvement, the Ethercat protocol processed 256 digital I / Os in 12μs. After the improvement, it can process 288 digital I / Os in the same time, and the efficiency is increased by 12.5%. This application improves the forwarding performance of messages by optimizing Ethernet frames, thereby reducing latency and improving control accuracy.
[0100] Figure 6 A schematic diagram of the structure of the management message generation device of the embodiment of the present application is shown. Exemplarily, the management message generation device includes: an information field determination module 610, a start header field value encapsulation module 620, a label control information encapsulation module 630, a load data encapsulation module 640 and a management message construction module 650.
[0101] The information field determination module 610 is used to determine the start header field value in the preset Ethernet frame according to whether each slave station is in the same virtual local area network, and determine whether to set the label control field in the frame header area in the preset Ethernet frame;
[0102] A starting header field value encapsulation module 620, configured to encapsulate the starting header field value into the starting header field of the frame header area;
[0103] The tag control information encapsulation module 630 is used to determine the tag control information according to the access requirement when the tag control field is set in the frame header area, and encapsulate the tag control information into the tag control field;
[0104] A load data encapsulation module 640 is used to determine the load data according to the target slave station to be accessed and the service management requirements, and encapsulate the load data into the load area in the Ethernet frame;
[0105] The management message construction module 650 is used to assemble the management message according to the frame header area and the load area in the Ethernet frame.
[0106] It can be understood that the device of this embodiment corresponds to the management message generation method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0107] The present application also provides an electronic device, which exemplarily includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the electronic device to execute the functions of each module in the above-mentioned management message generation method or the above-mentioned management message generation device. In the embodiment of the present application, exemplarily, the electronic device can be a PC with a network port, or a switch.
[0108] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0109] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0110] The present application also provides a computer-readable storage medium for storing the computer program used in the above electronic device. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0111] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0112] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0113] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0114] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A management message generation method, characterized in that: Applied to an industrial master station in a dedicated network, the method comprises: Determine the start header field value in the preset Ethernet frame according to whether each slave station is in the same virtual local area network, and determine whether to set the label control field in the frame header area in the preset Ethernet frame; Encapsulating the start header field value into the start header field of the frame header area; When the tag control field is set in the frame header area, tag control information is determined according to access requirements, and the tag control information is encapsulated into the tag control field; Determine the load data according to the target slave station to be accessed and the service management requirements, and encapsulate the load data into the load area in the Ethernet frame; The management message is assembled according to the frame header area and the load area in the Ethernet frame.
2. The management message generation method according to claim 1, characterized in that: The step of determining a start header field value in a preset Ethernet frame according to whether each slave station is in the same virtual local area network, and determining whether to set a tag control field in a frame header area in the preset Ethernet frame, comprises: If the slave stations are in the same virtual local area network, determining that the start header field value is a first preset value, and determining that no label control field is set in the frame header area; If the slave stations are not in the same virtual local area network, the start header field value is determined to be a second preset value, and a tag control field is determined to be set in the frame header area.
3. The management message generation method according to claim 1, characterized in that: The tag control field includes a priority identifier and a virtual local area network identifier; The step of determining the tag control information according to the access requirement and encapsulating the tag control information into the tag control field includes: Determine the target virtual local area network where the target slave station is located according to the access requirement, determine the value of the virtual local area network identifier according to the target virtual local area network and encapsulate it into the virtual local area network identifier; The processing priority of the management message is determined according to the access requirement, and the processing priority is encapsulated into the priority identifier.
4. The management message generation method according to claim 1, characterized in that: The load area includes at least one protocol data unit; the protocol data unit includes a slave address field and a data field; The step of determining the load data according to the target slave station to be accessed and the service management requirements, and encapsulating the load data into the load area in the Ethernet frame includes: Setting a corresponding number of the protocol data units according to the number of target slave stations to be accessed; The address of the target slave station is encapsulated into the slave station address field in the corresponding protocol data unit; and the management information formulated according to the business management requirements is encapsulated into the data address field in the corresponding protocol data unit.
5. The management message generation method according to claim 1, characterized in that: The Ethernet frame also includes a frame tail area; the frame header area in the Ethernet frame also includes an Ethernet type field; The method further comprises: encapsulating a preset frame check sequence into the frame tail area so that the slave station can check the integrity of the management message; The preset protocol type is encapsulated into the Ethernet type field to instruct the slave station to parse the management message according to the protocol type.
6. The management message generation method according to any one of claims 1 to 5, characterized in that: The start header field is located at the front end of the Ethernet frame; The step of determining that the start header field value is a first preset value, where the first preset value is used to indicate that the management message of the target slave station does not contain the label control information, comprises: The starting header field value is represented by a binary value alternating between "1" and "0"; the first preset value is used to instruct the target slave station to determine that the management message does not contain the label control information according to the high and low level signal corresponding to the binary value.
7. A management message generating device, characterized in that: An industrial master station applied to a dedicated network, the device comprises: An information field determination module is used to determine the start header field value in a preset Ethernet frame according to whether each slave station is in the same virtual local area network, and to determine whether to set a label control field in a frame header area in the preset Ethernet frame; A starting header field value encapsulation module, used for encapsulating the starting header field value into the starting header field of the frame header area; A tag control information encapsulation module, used to determine tag control information according to access requirements when the tag control field is set in the frame header area, and encapsulate the tag control information into the tag control field; A load data encapsulation module, used to determine the load data according to the target slave station to be accessed and the service management requirements, and encapsulate the load data into the load area in the Ethernet frame; The management message construction module is used to assemble the management message according to the frame header area and the load area in the Ethernet frame.
8. The management message generating device according to claim 7, characterized in that: The information field determination module is specifically used to: When each slave station is in the same virtual local area network, determining that the start header field value is a first preset value, and determining that no label control field is set in the frame header area; When the slave stations are not in the same virtual local area network, the start header field value is determined to be a second preset value, and a tag control field is determined to be set in the frame header area.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the management message generation method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer program is stored therein, and when the computer program is executed on a processor, the management message generation method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Network system message batch addressing method and equipment
CN121603474A
