Batch information collection method, information reporting method and industrial control system

By extending the service type field and Payload area of ​​the Ethercat protocol, the master station generates and sends service messages, and the slave station actively reports service data, which solves the problem of low information collection efficiency in the Ethercat protocol and realizes efficient and flexible information collection and reporting.

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

Patent Information

Application Number
CN202411333714.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-10-03
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

In the existing technology, the Ethercat protocol has low information collection efficiency in the industrial control field, a heavy burden on the master station, and cannot flexibly customize information reporting.

Method used

By extending the service type field and Payload area in the Ethercat protocol, the master station generates a service message and sends it to the slave station. The slave station actively reports the service data based on the service type identification value and service parameters, and uses the preset Ethernet frame protocol to encapsulate and parse the response message.

Benefits of technology

It improves the efficiency of information collection, enables the slave station to actively report business data, flexibly customizes the business data that users are concerned about, and reduces the burden on the master station.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119225303B_ABST
    Figure CN119225303B_ABST
Patent Text Reader

Abstract

The present application relates to the field of industrial communication technology, and relates to a batch information collection method, an information reporting method and an industrial control system, the method comprising: filling a business type identification value determined according to the business type of the business to be executed into a business type field in a business message to be generated; determining, according to the number of categories of business data collected from the slave station, to set N information units equal to the number of categories in the data area in the load area; filling each group of business parameters determined according to each category of business data into the corresponding information unit; encapsulating the filled information units and business type fields according to a preset Ethernet frame protocol to obtain a business message and sending it to all slave stations; receiving and parsing the response messages returned by each slave station; the response message is generated by the slave station based on the business data collected by the business type identification value and each group of business parameters; thereby solving the problems of heavy burden on the master station and low information collection efficiency in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial communication technology, and in particular to a batch information collection method, an information reporting method, and an industrial control system. Background Art

[0002] Currently, there are many protocols in the industrial control field (such as manufacturing, energy industry, petrochemical industry, power collection, etc.), such as Modbus protocol, Ethercat protocol, Profinet protocol, CC-link protocol, etc. Each protocol has its own characteristics. Among them, Ethercat protocol is favored by the industry for its simple message structure, low latency, and precise synchronization.

[0003] The most typical networking of Ethercat protocol is as follows Figure 1 As shown in the figure, the master station constructs the topology by broadcasting messages and assigns each slave a sequential station number based on its distance from the master station, such as Slave 1, Slave 2, Slave 3, and so on. The intermediate and last slave stations are determined by the link status of the device ports. For an intermediate slave station, both ports are link-up, while for the last slave station, only the receiving port is link-up.

[0004] While the Ethercat protocol offers superior transmission performance, in some industrial scenarios, the data collected by users often focuses on a few fixed fields, such as pressure, temperature, vibration, voltage, and current. Existing technologies require active data collection through a master station, which increases the station's burden and reduces information collection efficiency. Summary of the Invention

[0005] In view of this, the embodiments of the present application provide a batch information collection method, an information reporting method and an industrial control system, which can effectively solve the problems of heavy burden on the master station and low information collection efficiency in the prior art.

[0006] In a first aspect, an embodiment of the present application provides a batch information collection method applicable to a master station, comprising:

[0007] Filling a service type identification value determined according to the service type of the service to be executed into a service type field in the service message to be generated; wherein the service type field is located in a message header in a payload area in the service message;

[0008] According to the number of categories of the service data collected from the slave station, N information units equal to the number of categories are determined to be set in the data area of ​​the load area, where N≥1;

[0009] Filling each set of service parameters determined according to each category of service data into a corresponding information unit;

[0010] Encapsulating the filled information units and the service type field according to a preset Ethernet frame protocol to obtain the service message, and sending it to all slave stations;

[0011] Receive and parse the response messages returned by each of the slave stations; the response messages are generated by the slave stations based on the service type identification value and the service data collected by each group of service parameters; the response messages include M categories of service data; N≥M≥1.

[0012] In some embodiments, filling the service type identification value determined according to the service type of the to-be-performed service into the service type field in the to-be-generated service message includes:

[0013] If the service type is to set threshold parameters for all slave stations, determining that the service type identification value is a first identification value, and filling the first identification value into the service type field; the first identification value is used to indicate that the service type of the service to be executed by the slave station is to set an alarm threshold and monitor the corresponding category of service data according to each group of service parameters to determine whether an alarm is triggered;

[0014] Filling each set of service parameters determined according to each category of service data into a corresponding information unit includes:

[0015] If the service type is to set threshold parameters for all slave stations, determining that the set of service parameters includes an information category identification value, an information data threshold identification value, an over-threshold times identification value, and an alarm identification value;

[0016] Filling the information category identification value into the information category field of the corresponding information unit; the information category identification value is used to indicate the category of the service data to be collected by the slave station;

[0017] Filling the information data threshold identification value into the threshold field of the corresponding information unit; the information data threshold identification value is used to provide a criterion for the slave station to determine whether the corresponding type of service data exceeds the threshold;

[0018] Filling the threshold-exceeding times identification value into the threshold-exceeding times field of the corresponding information unit; the threshold-exceeding times identification value is used to provide a criterion for the slave station to determine the number of times the service data of the corresponding category exceeds the threshold;

[0019] The alarm identification value is filled into the alarm field of the corresponding information unit; the alarm identification value is used to indicate whether the slave station sends an alarm message to the master station when the number of times the service data of the corresponding category exceeds the threshold reaches the number of times exceeding the threshold identification value.

[0020] In some embodiments, the data area in the service message further includes a field for the number of information units;

[0021] The method further includes: filling the category number into the number field of the information unit; the category number is used to instruct the slave station to set alarm thresholds for N categories of service data based on service parameters corresponding to the N information units;

[0022] Filling each set of service parameters determined according to each category of service data into a corresponding information unit includes:

[0023] If the service type is to set threshold parameters for all slave stations, determining that each group of service parameters further includes an information length identification value and a collection period identification value;

[0024] Filling the information length identification value into the information length field of the corresponding information unit; the information length identification value is used to indicate the length of the service data to be collected by the slave station;

[0025] The collection period identification value is filled into the collection period field of the corresponding information unit; the collection period identification value is used to indicate the period during which the slave station collects the corresponding category of service data.

[0026] In some embodiments, the data area in the service message further includes a field for the number of information units;

[0027] The step of filling the service type identification value determined according to the service type of the service to be executed into the service type field in the service message to be generated includes:

[0028] If the service type is to collect service data of all slave stations, determining that the service type identification value is a second identification value, and filling the second identification value into the service type field; the second identification value is used to indicate that the service type of the service to be executed by the slave station is to collect its own service data;

[0029] The method further includes: filling the number of categories into the number field of the information unit; the number of categories is used to instruct the slave station to collect N categories of service data based on the service parameters corresponding to the N information units;

[0030] Filling each set of service parameters determined according to each category of service data into a corresponding information unit includes:

[0031] If the service type is to collect service data of all slave stations, determining that the set of service parameters includes an information category identification value and an information length identification value;

[0032] Filling the information category identification value determined according to the information category to be collected into the information category field of the corresponding information unit; the information category field is used to indicate the category of the service data to be collected by the slave station;

[0033] The information length identification value is filled into the information length field of the corresponding information unit; the information length identification value is used to indicate the length of the service data to be collected by the slave station.

[0034] In some embodiments, the response message includes the load area;

[0035] The receiving and parsing of the response messages returned by each of the slave stations includes:

[0036] Parsing the service type field in the message header of the response message to obtain a third identification value, and determining whether the response message is service data actively reported by the slave station according to the third identification value;

[0037] If the service data is actively reported by the slave station, the number of information units contained in the data area of ​​the response message is obtained by parsing the number of information units field in the response message to obtain the number of units;

[0038] Parsing the load area in the response message to obtain a plurality of information units having the same number as the units;

[0039] A category of business data is obtained by parsing each of the information units; the business data is collected by the slave station based on the business type identification value in the business message and the corresponding business parameters.

[0040] In some embodiments, parsing each of the information units to obtain a category of business data includes:

[0041] Parsing the information category field of the information unit in the response message to obtain an information category identification value of the service data stored in the corresponding information unit to determine the category of the service data;

[0042] Parsing the slave address field of the information unit in the response message to obtain a slave ID, and determining the identity of the slave that sends the response message according to the slave ID;

[0043] The service data of the corresponding category is obtained by parsing the information data field of the information unit in the response message.

[0044] In some embodiments, the threshold field of the information unit includes an upper limit field and a lower limit field; the information data threshold identification value includes an upper limit identification value and a lower limit identification value;

[0045] Filling the information data threshold identification value into the threshold field of the corresponding information unit includes:

[0046] Filling the upper limit identification value determined according to the service into the upper limit field of the corresponding information unit;

[0047] Fill the lower limit identification value determined according to the service into the lower limit field of the corresponding information unit;

[0048] The upper limit identification value is used to provide a criterion for the slave station to determine whether the business data of the corresponding category exceeds the upper limit; the lower limit identification value is used to provide a criterion for the slave station to determine whether the business data of the corresponding category exceeds the lower limit.

[0049] In a second aspect, an embodiment of the present application provides an information reporting method applicable to a slave station, comprising:

[0050] Receive a service message sent by the master station; wherein the service message is encapsulated according to a preset Ethernet frame protocol, and a service type field is provided in the message header in the load area of ​​the service message;

[0051] Parsing the service type field of the service message to obtain a service type identification value;

[0052] Parsing the data area in the payload area to obtain N information units, where N≥1;

[0053] Parse each information unit to obtain a corresponding set of service parameters;

[0054] Based on the service type identification value and each group of service parameters, service data is collected respectively, and a response message is generated and sent to the master station; the response message includes M categories of service data; N≥M≥1.

[0055] In some embodiments, the parsing the service type field of the service message to obtain the service type identification value includes:

[0056] If the service type identification value is the first identification value, determining that the service type is to set a threshold parameter for the slave station;

[0057] If the service type is to set a threshold parameter for the slave station, then the corresponding set of service parameters obtained by parsing each information unit includes:

[0058] Parsing the information category field of the corresponding information unit to obtain an information category identification value determined by the master station according to the category of the collected information;

[0059] Parsing the threshold field of the corresponding information unit to obtain the information data threshold identification value;

[0060] Obtain an over-threshold times identification value by parsing the over-threshold times field of the corresponding information unit;

[0061] Obtain an alarm identification value from the alarm field of the corresponding information unit;

[0062] The collecting of service data based on the service type identification value and each group of service parameters includes:

[0063] According to the service type identification value being the first identification value, determining to monitor service data of a corresponding category based on any set of the service parameters specifically includes:

[0064] Determining the category of the business data to be collected according to the information category identification value;

[0065] Determine whether the service data of the corresponding category exceeds the threshold according to the information data threshold identification value;

[0066] Determining the number of times the service data of the corresponding category exceeds the threshold according to the threshold-exceeding times identification value;

[0067] According to the alarm identification value, it is determined whether to send an alarm message to the master station when the number of times the business data of the corresponding category exceeds the threshold reaches the number of times exceeding the threshold identification value; the alarm message includes the business data of the corresponding category. In a third aspect, an embodiment of the present application provides an industrial control system, the industrial control system including a master station and multiple slave stations;

[0068] The master station is configured to fill a service type identification value determined according to the service type of the service to be executed into a service type field in a service message to be generated; wherein the service type field is located in a message header in a load area of ​​the service message; according to the number of categories of service data collected from the slave station, determine to set N information units equal to the number of categories in a data area in the load area, where N ≥ 1; fill each set of service parameters determined according to each category of the service data into a corresponding information unit; encapsulate the filled information units and the service type field according to a preset Ethernet frame protocol to obtain the service message, and send the encapsulated information units to all slave stations;

[0069] The slave station is used to receive the service message and generate a response message based on the service type identification value and the service data collected by each group of service parameters; the response message includes M categories of service data; N≥M≥1;

[0070] The master station is further configured to receive and parse response messages returned by the slave stations respectively, so as to obtain service data collected based on each set of service parameters.

[0071] The embodiments of the present application have the following beneficial effects:

[0072] In this application, the business type identification value determined according to the business type of the business to be executed is filled into the business type field in the business message to be generated; wherein, the business type field is located in the message header in the load area of ​​the business message; according to the number of categories of the business data collected from the slave station, it is determined to set N information units equal to the number of categories in the data area in the load area, N≥1; each group of business parameters determined according to the business data of each category is filled into the corresponding information unit; the filled information units and the business type field are encapsulated according to the preset Ethernet frame protocol to obtain the business message, and sent to all slave stations; the response messages returned by each of the slave stations are received and parsed; the response message is generated by the slave station based on the business data collected by the business type identification value and each group of business parameters; the response message includes M categories of business data; N≥M≥1. The slave station of this application can actively report business data through response messages based on business messages, which can improve the efficiency of information collection; and the slave station collects business data based on a set of business parameters in each information unit, and transmits the business parameters of each business data that the user cares about to the slave station through information units respectively, thereby flexibly customizing the business data that the user cares about. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. 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 relevant drawings can be obtained based on these drawings without creative work.

[0074] Figure 1 A schematic diagram of the structure of an existing EtherCAT frame involved in the batch information collection method according to an embodiment of the present application is shown;

[0075] Figure 2 A schematic diagram of the improved EtherCAT frame structure in the batch information collection method according to an embodiment of the present application is shown;

[0076] Figure 3 The following is a structural block diagram of an industrial control system according to an embodiment of the present application;

[0077] Figure 4 A flow chart showing a method for collecting batch information according to an embodiment of the present application is shown;

[0078] Figure 5 A schematic diagram of the frame structure of a service message when the master station sends threshold parameters to all slave stations in the batch information collection method according to an embodiment of the present application is shown;

[0079] Figure 6 A schematic diagram showing the frame structure of a service message when the master station actively triggers service data collection in the batch information collection method according to an embodiment of the present application is shown;

[0080] Figure 7 A schematic diagram of the frame structure of a service message when a slave station reports collected service data in the batch information collection method according to an embodiment of the present application is shown;

[0081] Figure 8 A flow chart of the information reporting method according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0082] 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 the embodiments.

[0083] The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different 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 claimed application, but rather merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.

[0084] Hereinafter, the terms "including", "having" and their cognates used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the aforementioned items, and should not be understood as excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the aforementioned items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the aforementioned items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and should not be understood as indicating or implying relative importance.

[0085] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly 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 meaning as in the context of the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present application.

[0086] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.

[0087] In the prior art, when using the Ethercat protocol to collect information from slave stations, it is achieved through active query by the master station, which has low information collection efficiency. Moreover, the use of the Ethercat protocol to collect information is not flexible enough, and there is no way to flexibly report it in a customized manner according to needs. Therefore, the present application provides a batch information collection method, an information reporting method, and an industrial control system. After the master station of the present application configures information for the slave station, the slave station can actively report business data, the information collection efficiency is high, and the frame format for reporting data can be flexibly customized according to needs.

[0088] In the prior art, the EtherCAT frame structure is as follows: Figure 1 As shown in Table 1, it includes: Ethernet frame header, payload and Ethernet frame trailer. The payload includes a PDU header (PDU HEAD) and multiple PDUs. In the prior art, the PDU header includes a Length field, a Reserved field and a Type field, as shown in Table 1.

[0089] Table 1 Meaning of each field in the PDU header

[0090]

[0091] For example, the preset Ethernet frame protocol in this application adopts an improved Ethercat protocol. In this application, the Type field (service type field) in the Ethercat frame structure is first extended, thereby being applicable to a variety of services, as shown in Table 2.

[0092] Table 2 Meaning of the extended Type field (business type field)

[0093]

[0094] The command words in Table 2 represent service type identification values. For example, the first identification value is 0xF, which indicates that the master station sets threshold parameters for all slave stations, i.e., sets the threshold parameters for the slave stations' service data collection. The second identification value is 0xE, which indicates that the master station proactively collects service data from all slave stations, and for the slave station, it indicates that the slave station collects its own service data. The third identification value is 0xD, which indicates that the slave station proactively reports the collected service data.

[0095] Secondly, if Figure 2 As shown, this application extends the Payload area in the Ethercat frame structure. The Payload area includes an INFO NUM field (information unit number field) and multiple INFO fields (information units). The INFO_NUM field indicates the number of INFOs included in the Ethercat payload. Each INFO structure is shown in Table 3.

[0096] Table 3 Description of each field in INFO

[0097]

[0098]

[0099]

[0100] Each information unit includes different service parameters, and each service data corresponds to an information unit. In this way, the main station can collect the service data customized by the user.

[0101] The present application provides an industrial control system, which is exemplary as follows: Figure 3 As shown, the industrial control system includes a master station and multiple slave stations.

[0102] The master station is used to: fill the business type identification value determined according to the business type of the business to be executed into the business type field in the business message to be generated; wherein, the business type field is located in the message header in the load area of ​​the business message; according to the number of categories of the business data collected from the slave station, determine to set N information units equal to the number of categories in the data area in the load area, N≥1; fill each group of business parameters determined according to the business data of each category into the corresponding information unit; encapsulate the filled information units and the business type field according to the preset Ethernet frame protocol to obtain the business message, and send it to all slave stations.

[0103] The business to be executed by the master station can be to configure the slave station information or to actively collect the business data of all slave stations.

[0104] The slave station is configured to receive the service message and generate a response message based on the service type identifier and the service data collected by each set of service parameters; the response message includes M categories of service data, where N ≥ M ≥ 1. The slave station first determines the service type to be executed based on the service type identifier, and then generates a response message based on the service data collected by each set of service parameters.

[0105] The master station is further configured to receive and parse response messages returned by the slave stations respectively, so as to obtain service data collected based on each set of service parameters.

[0106] While the existing EtherCAT protocol offers excellent transmission performance, in industrial scenarios, the business data users care about is often limited to a few fixed categories, such as pressure, temperature, vibration, voltage, and current. Actively collecting business data through a master station each time increases the burden on the master station, so this application proposes a batch information collection method.

[0107] The batch information collection method is described below with reference to some specific embodiments.

[0108] Figure 4 A flow chart of a batch information collection method according to an embodiment of the present application is shown. For example, the method is applicable to a master station in an industrial control system and includes the following steps:

[0109] S110 , filling a service type identification value determined according to the service type of the service to be executed into a service type field in a service message to be generated; wherein the service type field is located in a message header in a payload area of ​​the service message.

[0110] S120 , according to the number of categories of the service data collected from the slave station, determine to set N information units equal to the number of categories in the data area in the load area, where N≥1.

[0111] S130: Fill each set of service parameters determined according to each category of service data into a corresponding information unit. Determine a set of service parameters according to a category of service data, and fill the set of service parameters into a unique corresponding information unit.

[0112] S140 , encapsulating the filled information units and the service type field according to a preset Ethernet frame protocol to obtain the service message, and sending the message to all slave stations.

[0113] S150, receiving and parsing the response messages returned by each of the slave stations; the response messages are generated by the slave stations based on the service type identification value and the service data collected by each group of service parameters; the response messages include M categories of service data; N≥M≥1.

[0114] In one embodiment, in step S110, filling the service type identification value determined according to the service type of the service to be executed into the service type field in the service message to be generated includes:

[0115] If the service type is to set threshold parameters for all slave stations, determining that the service type identification value is a first identification value, and filling the first identification value into the service type field; the first identification value is used to indicate that the service type of the service to be executed by the slave station is to set an alarm threshold and monitor the corresponding category of service data according to each group of service parameters to determine whether an alarm is triggered;

[0116] In step S130, filling each set of service parameters determined according to each category of service data into a corresponding information unit includes:

[0117] If the service type is to set threshold parameters for all slave stations, determining that the set of service parameters includes an information category identification value, an information data threshold identification value, an over-threshold times identification value, and an alarm identification value;

[0118] Filling the information category identification value into the information category field of the corresponding information unit; the information category identification value is used to indicate the category of the service data to be collected by the slave station;

[0119] Filling the information data threshold identification value into the threshold field of the corresponding information unit; the information data threshold identification value is used to provide a criterion for the slave station to determine whether the corresponding type of service data exceeds the threshold;

[0120] Filling the threshold-exceeding times identification value into the threshold-exceeding times field of the corresponding information unit; the threshold-exceeding times identification value is used to provide a criterion for the slave station to determine the number of times the service data of the corresponding category exceeds the threshold;

[0121] The alarm identification value is filled into the alarm field of the corresponding information unit; the alarm identification value is used to indicate whether the slave station sends an alarm message to the master station when the number of times the service data of the corresponding category exceeds the threshold reaches the number of times exceeding the threshold identification value.

[0122] Furthermore, the data area in the service message also includes a field for the number of information units.

[0123] The method further includes: filling the category number into the information unit number field; the category number is used to instruct the slave station to set alarm thresholds for N categories of service data based on service parameters corresponding to the N information units.

[0124] In step S130, filling each set of service parameters determined according to each category of service data into a corresponding information unit includes:

[0125] If the service type is to set threshold parameters for all slave stations, determining that each group of service parameters further includes an information length identification value and a collection period identification value;

[0126] Filling the information length identification value into the information length field of the corresponding information unit; the information length identification value is used to indicate the length of the service data to be collected by the slave station;

[0127] The collection period identifier value is added to the collection period field of the corresponding information unit; the collection period identifier value is used to indicate the period during which the slave collects the corresponding type of service data. After receiving the collection period in this collection period field (also known as the CollectInterval field), the slave collects information according to the time period in the CollectInterval field. Furthermore, if the number of consecutive times exceeds the threshold (and Flag is 1), the slave will proactively report an alarm to the master.

[0128] Furthermore, the threshold field of the information unit includes an upper limit field and a lower limit field; the information data threshold identification value includes an upper limit identification value and a lower limit identification value;

[0129] Filling the information data threshold identification value into the threshold field of the corresponding information unit includes:

[0130] Filling the upper limit identification value determined according to the service into the upper limit field of the corresponding information unit;

[0131] Fill the lower limit identification value determined according to the service into the lower limit field of the corresponding information unit;

[0132] The upper limit identification value is used to provide a criterion for the slave station to determine whether the business data of the corresponding category exceeds the upper limit; the lower limit identification value is used to provide a criterion for the slave station to determine whether the business data of the corresponding category exceeds the lower limit.

[0133] Exemplarily, when the master station sends threshold parameters to all slave stations, the master station may send threshold parameters for one category of service data at one time, or may send threshold parameters for multiple categories of service data.

[0134] When setting threshold parameters for a single category of service data, for example, sending temperature threshold parameters, the temperature collection period is 3s, and an alarm is reported when the temperature collection value exceeds the upper threshold (upper limit) of 80 degrees Celsius for three consecutive times or is continuously lower than the lower limit of -20 degrees Celsius. Among them, the information category is temperature, and the frame format of the specific service message is Figure 5As shown, the first identification value stored in the business type field Type is 0xF, the value of the information unit number field INFO_NUM is 1, indicating that there is only one information unit, the information category identification value in the information category field TY_1 is 1, the information length identification value in the information length field LEN is 13, the upper limit identification value in the upper limit field ThresholdHigh is 80, the lower limit identification value in the lower limit field ThresholdLow is -20, the alarm identification value of the alarm field Flag in ReportPara is 1, the threshold exceeding number identification value in the threshold exceeding number field Times is 3, and the collection period identification value in the collection period field CollectInterval is 3000.

[0135] When setting threshold parameters for multiple categories of business data, the value in the information unit number field INFO_NUM is modified to the number of corresponding collected business data categories. The business parameter settings in each information unit INFO are similar to the threshold parameter settings for a single category of business data and will not be repeated here.

[0136] Furthermore, if only one threshold is set, the other threshold value needs to be set to 0xFFFFFFFF, indicating that it does not care. For example, if only the upper limit identification value in the upper limit field is set, the slave station only determines whether the service data of this type exceeds the upper limit and does not care about the lower limit.

[0137] In one embodiment, the data area in the service message also includes a field for the number of information units.

[0138] In step S110, the process of filling the service type identification value determined according to the service type of the service to be executed into the service type field in the service message to be generated includes:

[0139] If the business type is to collect business data of all slave stations, the business type identification value is determined to be a second identification value, and the second identification value is filled into the business type field; the second identification value is used to indicate that the business type of the business to be executed by the slave station is to collect its own business data.

[0140] The method further includes: filling the number of categories into the number of information units field; the number of categories is used to instruct the slave station to collect N categories of service data based on the service parameters corresponding to the N information units, and to collect one category of service data based on the service parameters in one information unit.

[0141] In step S130, filling each set of service parameters determined according to each category of service data into a corresponding information unit includes:

[0142] If the service type is to collect service data of all slave stations, it is determined that the set of service parameters includes an information category identification value and an information length identification value.

[0143] The information category identification value determined according to the information category to be collected is filled into the information category field of the corresponding information unit; the information category field is used to indicate the category of the business data to be collected by the slave station.

[0144] The information length identification value is filled into the information length field of the corresponding information unit; the information length identification value is used to indicate the length of the service data to be collected by the slave station.

[0145] For example, when the master station actively triggers the collection of service data, the master station needs to actively collect the service data of all slave stations once, for example, to collect the temperature information of all slave stations. Then, the service type identifier value in the service type field Type is 0xE, the value in the information unit number field INFO_NUM is 1, and the information category identifier value in the information category field TP_1 is 1, indicating that the collected information is temperature; the information length identifier value in the information length field LEN is 0, indicating that it is not concerned, and the information data field DATA stores padding bits, such as Figure 6 Therefore, when the master station triggers an action to collect information from all slave stations at once, one type of information or multiple types of information can be collected.

[0146] In one implementation, the response message includes the load area.

[0147] The receiving and parsing of the response messages returned by each of the slave stations includes:

[0148] Parsing the service type field in the message header of the response message to obtain a third identification value, and determining whether the response message is service data actively reported by the slave station according to the third identification value;

[0149] If the service data is actively reported by the slave station, the number of information units contained in the data area of ​​the response message is obtained by parsing the number of information units field in the response message to obtain the number of units;

[0150] A plurality of information units having the same number as the units are parsed from the load area in the response message; that is, the number in the number of information units field indicates that the load area contains the same number of information units.

[0151] A category of business data is obtained by parsing each of the information units; the business data is collected by the slave station based on the business type identification value in the business message and the corresponding business parameters.

[0152] Furthermore, the parsing of each information unit to obtain a category of business data includes:

[0153] Parsing the information category field of the information unit in the response message to obtain an information category identification value of the service data stored in the corresponding information unit to determine the category of the service data;

[0154] Parsing the slave address field of the information unit in the response message to obtain a slave ID, and determining the identity of the slave that sends the response message according to the slave ID;

[0155] The service data of the corresponding category is obtained by parsing the information data field of the information unit in the response message.

[0156] For example, when the slave station reports the collected service data, if the slave station receives the service data collection service message triggered by the master station, or the alarm switch is set and exceeds the set threshold to trigger the alarm, the slave station needs to report the collected service data. For example, if the temperature value reported by slave station 3 is 90 degrees, Figure 7 In the frame structure of the response message, the service type identifier in the service type field Type is 0xD, the value in the information unit number field INFO_NUM is 1, the information category identifier in the information category field TP_1 is 1, indicating temperature; the information length identifier in the information length field LEN is 6, indicating that the valid field is 6 bytes; the slave ID in the slave address field SLAVE_ID is 3, and the service data in the information data field DATA is 90, indicating that the current temperature is 90 degrees Celsius.

[0157] For example, when the slave station periodically collects business data and reports alarm information, when the master station sets the threshold parameters and sets the alarm reporting through the alarm identification value in the alarm field, the slave station will periodically collect business data of the corresponding category according to the collection period CollectInterval. When the value is higher than the upper limit ThresholdHigh for consecutive Times or lower than the lower limit ThresholdLow for consecutive Times, the slave station will actively report the collected business data to the master station.

[0158] Figure 8 A flow chart of an information reporting method according to an embodiment of the present application is shown. Exemplarily, the information reporting method is applicable to each slave station in an industrial control system and includes the following steps:

[0159] S210, receiving a service message sent by the master station; wherein the service message is encapsulated according to a preset Ethernet frame protocol, and a service type field is provided in a message header in a load area of ​​the service message.

[0160] S220: parse the service type field of the service message to obtain a service type identification value.

[0161] S230, parse the data area in the payload area to obtain N information units, where N≥1.

[0162] S240: parse each information unit to obtain a corresponding set of service parameters.

[0163] S250 , collecting service data based on the service type identification value and each group of service parameters, generating a response message and sending it to the master station; the response message includes M categories of service data; N≥M≥1.

[0164] Furthermore, in step S220, the parsing of the service type field of the service message to obtain a service type identification value includes:

[0165] If the service type identification value is the first identification value, the service type is determined to be setting a threshold parameter for the slave station.

[0166] In step S240, if the service type is to set threshold parameters for the slave station, the corresponding set of service parameters is obtained by parsing each information unit, including:

[0167] Parsing the information category field of the corresponding information unit to obtain an information category identification value determined by the master station according to the category of the collected information;

[0168] Parsing the threshold field of the corresponding information unit to obtain the information data threshold identification value;

[0169] Obtain an over-threshold times identification value by parsing the over-threshold times field of the corresponding information unit;

[0170] The alarm identification value is obtained by parsing the alarm field of the corresponding information unit.

[0171] Furthermore, in step S240, the parsing of each information unit to obtain a corresponding set of service parameters further includes:

[0172] Parse the information length field of the corresponding information unit to obtain the information length identification value;

[0173] The collection period identifier value is obtained by parsing the collection period field of the corresponding information unit.

[0174] In step S250, the collecting of service data based on the service type identification value and each group of service parameters includes:

[0175] According to the service type identification value being the first identification value, determining to monitor service data of a corresponding category based on any set of the service parameters specifically includes:

[0176] Determining the category of the business data to be collected according to the information category identification value;

[0177] Determine whether the service data of the corresponding category exceeds the threshold according to the information data threshold identification value;

[0178] Determining the number of times the service data of the corresponding category exceeds the threshold according to the threshold-exceeding times identification value;

[0179] According to the alarm identification value, it is determined whether to send an alarm message to the main station when the number of times the service data of the corresponding category exceeds the threshold reaches the threshold number identification value; the alarm message includes the service data of the corresponding category.

[0180] Furthermore, in step S250, the collecting of service data based on the service type identification value and each group of service parameters further includes:

[0181] Determine the length of the service data to be collected according to the information length identifier value;

[0182] The period for collecting service data of the corresponding category is determined based on the collection period identifier value. For example, after receiving the collection period identifier value in the collection period field (also known as the CollectInterval field), the slave station will collect information according to the time period in the CollectInterval field. If the period exceeds the threshold Time times consecutively (and Flag is 1), it will proactively report an alarm to the master station.

[0183] This application improves the EtherCAT protocol to precisely target the information users need, improving information collection efficiency. Furthermore, slaves can periodically report information to the master, allowing the master to collect service data. When a slave detects service data exceeding a user-defined threshold, it proactively reports the current service data to the master.

[0184] The embodiment of the present application provides a batch information collection device. Exemplarily, the batch information collection device includes: a service type filling module, an information unit determination module, an information unit filling module, a message encapsulation and sending module, and a message receiving module.

[0185] A service type filling module, configured to fill a service type identification value determined according to the service type of the service to be executed into a service type field in the service message to be generated; wherein the service type field is located in a message header in a load area in the service message;

[0186] An information unit determination module, configured to determine, based on the number of categories of the service data collected from the slave station, to set N information units equal to the number of categories in the data area of ​​the load area, where N≥1;

[0187] An information unit filling module, configured to fill each set of service parameters determined according to each category of service data into a corresponding information unit;

[0188] A message encapsulation and sending module, configured to encapsulate the filled information units and the service type field according to a preset Ethernet frame protocol to obtain the service message, and send the message to all slave stations;

[0189] A message receiving module is used to receive and parse the response messages returned by each of the slave stations; the response messages are generated by the slave stations based on the business type identification value and the business data collected by each group of business parameters; the response messages include M categories of business data; N≥M≥1.

[0190] It can be understood that the device of this embodiment corresponds to the batch information collection method of the above embodiment, and the optional items in the above embodiment are also applicable to this embodiment, so they will not be repeated here.

[0191] The present application also provides a terminal device. Exemplarily, the terminal device includes a processor and a memory, wherein the memory stores a computer program. The processor executes the computer program, thereby causing the terminal device to execute the functions of the various modules in the aforementioned batch information collection method or apparatus. The terminal device serves as a master station.

[0192] 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 gate 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.

[0193] 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.

[0194] The present application also provides a computer-readable storage medium for storing the computer program used in the terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0195] In the several embodiments provided in this 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 architectures, functions and operations of the devices, methods and computer program products according to the 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 the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in an order different from that 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 flowchart, and the combination of boxes in the structure diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.

[0196] In addition, the functional modules or units in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0197] 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 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 enabling a computer device (which can be a smart phone, personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.

[0198] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.

Claims

1. A batch information collection method, characterized in that: Applicable to the main station, including: Filling a service type identification value determined according to the service type of the service to be executed into a service type field in the service message to be generated; wherein the service type field is located in a message header in a payload area in the service message; According to the number of categories of the service data collected from the slave station, N information units equal to the number of categories are determined to be set in the data area of ​​the load area, where N≥1; Filling each set of service parameters determined according to each category of service data into a corresponding information unit; Encapsulating the filled information units and the service type field according to a preset Ethernet frame protocol to obtain the service message, and sending it to all slave stations; Receive and parse the response messages returned by each of the slave stations; the response messages are generated by the slave stations based on the service type identification value and the service data collected by each group of service parameters; the response messages include M categories of service data; N≥M≥1.

2. The batch information collection method according to claim 1, characterized in that: The step of filling the service type identification value determined according to the service type of the service to be executed into the service type field in the service message to be generated includes: If the service type is to set threshold parameters for all slave stations, determining that the service type identification value is a first identification value, and filling the first identification value into the service type field; the first identification value is used to indicate that the service type of the service to be executed by the slave station is to set an alarm threshold and monitor the corresponding category of service data according to each group of service parameters to determine whether an alarm is triggered; Filling each set of service parameters determined according to each category of service data into a corresponding information unit includes: If the service type is to set threshold parameters for all slave stations, determining that the set of service parameters includes an information category identification value, an information data threshold identification value, an over-threshold times identification value, and an alarm identification value; Filling the information category identification value into the information category field of the corresponding information unit; the information category identification value is used to indicate the category of the service data to be collected by the slave station; Filling the information data threshold identification value into the threshold field of the corresponding information unit; the information data threshold identification value is used to provide a criterion for the slave station to determine whether the corresponding type of service data exceeds the threshold; Filling the threshold-exceeding times identification value into the threshold-exceeding times field of the corresponding information unit; the threshold-exceeding times identification value is used to provide a criterion for the slave station to determine the number of times the corresponding category of service data exceeds the threshold; The alarm identification value is filled into the alarm field of the corresponding information unit; the alarm identification value is used to indicate whether the slave station sends an alarm message to the master station when the number of times the service data of the corresponding category exceeds the threshold reaches the number of times exceeding the threshold identification value.

3. The batch information collection method according to claim 2, characterized in that: The data area in the service message also includes a field for the number of information units; The method further includes: filling the category number into the number field of the information unit; the category number is used to instruct the slave station to set alarm thresholds for N categories of service data based on service parameters corresponding to the N information units; Filling each set of service parameters determined according to each category of service data into a corresponding information unit includes: If the service type is to set threshold parameters for all slave stations, determining that each group of service parameters further includes an information length identification value and a collection period identification value; Filling the information length identification value into the information length field of the corresponding information unit; the information length identification value is used to indicate the length of the service data to be collected by the slave station; The collection period identification value is filled into the collection period field of the corresponding information unit; the collection period identification value is used to indicate the period during which the slave station collects the corresponding category of service data.

4. The batch information collection method according to claim 1, characterized in that: The data area in the service message also includes a field for the number of information units; The step of filling the service type identification value determined according to the service type of the service to be executed into the service type field in the service message to be generated includes: If the service type is to collect service data of all slave stations, determining that the service type identification value is a second identification value, and filling the second identification value into the service type field; the second identification value is used to indicate that the service type of the service to be executed by the slave station is to collect its own service data; The method further includes: filling the number of categories into the number field of the information unit; the number of categories is used to instruct the slave station to collect N categories of service data based on the service parameters corresponding to the N information units; Filling each set of service parameters determined according to each category of service data into a corresponding information unit includes: If the service type is to collect service data of all slave stations, determining that the set of service parameters includes an information category identification value and an information length identification value; Filling the information category identification value determined according to the information category to be collected into the information category field of the corresponding information unit; the information category field is used to indicate the category of the service data to be collected by the slave station; The information length identification value is filled into the information length field of the corresponding information unit; the information length identification value is used to indicate the length of the service data to be collected by the slave station.

5. The batch information collection method according to any one of claims 1 to 4, characterized in that: The response message includes the load area; The receiving and parsing of the response messages returned by each of the slave stations includes: Parsing the service type field in the message header of the response message to obtain a third identification value, and determining whether the response message is service data actively reported by the slave station according to the third identification value; If the service data is actively reported by the slave station, the number of information units contained in the data area of ​​the response message is obtained by parsing the number of information units field in the response message to obtain the number of units; Parsing the load area in the response message to obtain a plurality of information units having the same number as the units; A category of business data is obtained by parsing each of the information units; the business data is collected by the slave station based on the business type identification value in the business message and the corresponding business parameters.

6. The batch information collection method according to claim 5, characterized in that: The business data of a category is obtained by parsing each of the information units, including: Parsing the information category field of the information unit in the response message to obtain an information category identification value of the service data stored in the corresponding information unit to determine the category of the service data; Parsing the slave address field of the information unit in the response message to obtain a slave ID, and determining the identity of the slave that sends the response message according to the slave ID; The service data of the corresponding category is obtained by parsing the information data field of the information unit in the response message.

7. The batch information collection method according to claim 2, characterized in that: The threshold field of the information unit includes an upper limit field and a lower limit field; the information data threshold identification value includes an upper limit identification value and a lower limit identification value; Filling the information data threshold identification value into the threshold field of the corresponding information unit includes: Filling the upper limit identification value determined according to the service into the upper limit field of the corresponding information unit; Fill the lower limit identification value determined according to the service into the lower limit field of the corresponding information unit; The upper limit identification value is used to provide a criterion for the slave station to determine whether the business data of the corresponding category exceeds the upper limit; the lower limit identification value is used to provide a criterion for the slave station to determine whether the business data of the corresponding category exceeds the lower limit.

8. An information reporting method, characterized in that: Applicable to slave stations, including: Receive a service message sent by the master station; wherein the service message is encapsulated according to a preset Ethernet frame protocol, and a service type field is provided in the message header in the load area of ​​the service message; Parsing the service type field of the service message to obtain a service type identification value; Parsing the data area in the payload area to obtain N information units, where N≥1; Parse each information unit to obtain a corresponding set of service parameters; Based on the service type identification value and each group of service parameters, service data is collected respectively, and a response message is generated and sent to the master station; the response message includes M categories of service data; N≥M≥1.

9. The information reporting method according to claim 8, characterized in that: The obtaining of the service type identification value by parsing the service type field of the service message includes: If the service type identification value is the first identification value, determining that the service type is to set a threshold parameter for the slave station; If the service type is to set a threshold parameter for the slave station, then the corresponding set of service parameters obtained by parsing each information unit includes: Parsing the information category field of the corresponding information unit to obtain an information category identification value determined by the master station according to the category of the collected information; Parsing the threshold field of the corresponding information unit to obtain the information data threshold identification value; Obtain an over-threshold times identification value by parsing the over-threshold times field of the corresponding information unit; Obtain an alarm identification value from the alarm field of the corresponding information unit; The collecting of service data based on the service type identification value and each group of service parameters includes: According to the service type identification value being the first identification value, determining to monitor service data of a corresponding category based on any set of the service parameters specifically includes: Determining the category of the business data to be collected according to the information category identification value; Determine whether the service data of the corresponding category exceeds the threshold according to the information data threshold identification value; Determining the number of times the service data of the corresponding category exceeds the threshold according to the threshold-exceeding times identification value; According to the alarm identification value, it is determined whether to send an alarm message to the main station when the number of times the service data of the corresponding category exceeds the threshold reaches the threshold number identification value; the alarm message includes the service data of the corresponding category.

10. An industrial control system, characterized in that: The industrial control system includes a master station and multiple slave stations; The master station is configured to fill a service type identification value determined according to the service type of the service to be executed into a service type field in a service message to be generated; wherein the service type field is located in a message header in a load area of ​​the service message; according to the number of categories of service data collected from the slave station, determine to set N information units equal to the number of categories in a data area in the load area, where N ≥ 1; fill each set of service parameters determined according to each category of the service data into a corresponding information unit; encapsulate the filled information units and the service type field according to a preset Ethernet frame protocol to obtain the service message, and send the encapsulated information units to all slave stations; The slave station is used to receive the service message and generate a response message based on the service type identification value and the service data collected by each group of service parameters; the response message includes M categories of service data; N≥M≥1; The master station is further configured to receive and parse response messages returned by the slave stations respectively, so as to obtain service data collected based on each set of service parameters.

Citation Information

Patent Citations

  • Protocol packet processing method, device and terminal

    CN104618365A

  • IOAM information processing method and device and computer readable storage medium

    CN111371736A