Batch information acquisition method, information reporting method and industrial control system
By filling in the Ethercat protocol with service type identification values and service parameters, setting information units, and making the slaves actively report data, the problem of low information collection efficiency in the Ethercat protocol is solved, and flexible data reporting and efficiency improvement is achieved.
Patent Information
- Application Number
- CN202411333714.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-24
AI Technical Summary
In the prior art, the Ethercat protocol has low information collection efficiency in the industrial control field, the main site has a large burden, and it is impossible to flexibly customize data reporting.
By filling in the service message with service type identification value and service parameters, setting the information unit according to the number of categories of the slave station, encapsulate and send it to the slave station using the preset Ethernet frame protocol, the slave station actively reports the service data, and improves the information collection efficiency And flexibly customize the data frame format.
It improves information collection efficiency, reduces the burden on the main site, and realizes the flexible reporting of the slave site for business data that users care about, meeting the customization needs in industrial scenarios.
Smart Images

Figure CN119225303A_ABST
Abstract
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] At present, there are many protocols in the field of industrial control (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, precise synchronization and other characteristics.
[0003] The most typical networking of Ethercat protocol is as follows Figure 1 As shown in the figure, the master station constructs the topology through broadcast messages and configures a continuous station number for each slave station based on the distance from the master station, such as slave station 1, slave station 2, slave station 3, etc. The determination of the intermediate slave station and the last slave station is determined by the port link status of the device, where both ports of the intermediate slave station are link up, and only the receiving port of the last slave station is link up.
[0004] Although the Ethercat protocol has better transmission performance, in some industrial scenarios, the data collection information that users are concerned about is often relatively fixed field information, such as pressure, temperature, vibration, voltage value, current value, etc. In the existing technology, each time the information is actively collected through the master station, it will increase the burden of the master station and the information collection efficiency is low. 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 load area in the service message;
[0008] 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;
[0009] Fill each group of service parameters determined according to each category of service data into a corresponding information unit;
[0010] Encapsulate the filled information units and the service type field according to a preset Ethernet frame protocol to obtain the service message, and send 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, determine that the service type identification value is a first identification value, and fill 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 trigger an alarm;
[0014] The step of 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 business 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 category 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 corresponding category of service data 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 also includes a field for the number of information units;
[0021] 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 respectively;
[0022] The step of 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, then determine that each group of service parameters also 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 cycle identification value is filled into the collection cycle field of the corresponding information unit; the collection cycle 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 also 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, determine that the service type identification value is a second identification value, and fill 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 number of information units; 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 respectively;
[0030] The step of 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 business 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 business 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, thereby obtaining 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 according to the business type identification value in the business message and the corresponding business parameters.
[0040] In some embodiments, the parsing of 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] The step of filling the information data threshold identification value into a threshold field of a corresponding information unit includes:
[0046] Fill 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 service 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 service 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, including:
[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 a message header in a 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 load area to obtain N information units, 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 main station; the response message includes M categories of service data; N≥M≥1.
[0055] In some embodiments, the parsing of 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 is obtained by parsing each information unit, including:
[0058] Parsing the information category field of the corresponding information unit to obtain the 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] Parsing the alarm field of the corresponding information unit to obtain the alarm identification value;
[0062] The collecting of service data based on the service type identification value and each group of service parameters respectively includes:
[0063] According to the service type identification value being the first identification value, determining to monitor the service data of the corresponding category based on any group 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] Judging whether the service data of the corresponding category exceeds the threshold according to the information data threshold identification value;
[0066] Determine the number of times that 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 used to fill 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; wherein the service type field is located in the message header in the load area of the service message; 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, N ≥ 1; fill each group of service parameters determined according to each category of the service data into the corresponding information unit; encapsulate the filled information units and the service type field according to the preset Ethernet frame protocol to obtain the service message, and send it 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 also used to receive and parse the response messages returned by each of the slave stations to obtain the service data collected based on each group of service parameters.
[0071] The embodiments of the present application have the following beneficial effects:
[0072] In the present 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 each category of the business data 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 the present application can actively report business data through a response message based on the business message, thereby improving 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 the information unit, 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 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.
[0074] Figure 1 A structural schematic diagram of an existing Ethercat frame structure involved in the batch information collection method of an embodiment of the present application is shown;
[0075] Figure 2 A structural schematic diagram of an improved Ethercat frame structure in the batch information collection method according to an embodiment of the present application is shown;
[0076] Figure 3 A structural block diagram of an industrial control system according to an embodiment of the present application is shown;
[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 of an embodiment of the present application is shown;
[0079] Figure 6 A schematic diagram of the frame structure of a service message when the master station actively triggers service data collection in the batch information collection method of 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 a batch information collection method according to an embodiment of the present application is shown;
[0081] Figure 8 A flow chart of an 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 of the embodiments.
[0083] 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.
[0084] 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.
[0085] 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.
[0086] 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.
[0087] In the prior art, when the Ethercat protocol is used to collect information from slave stations, it is realized by actively querying the master station, and the information collection efficiency of this method is low. Moreover, the Ethercat protocol is not flexible enough when collecting information, 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 can be flexibly customized according to needs to report data.
[0088] In the prior art, the Ethercat frame structure is as follows Figure 1 As shown, it includes: Ethernet frame header, Payload and Ethernet frame tail. Wherein Payload includes PDU header (PDU HEAD) and multiple PDUs. In the prior art, PDU header includes Length field, Reserved field and Type field, as shown in Table 1.
[0089] Table 1 Meaning of each field in the PDU header
[0090]
[0091] Exemplarily, the preset Ethernet frame protocol in the present application adopts an improved Ethercat protocol. In the present application, the Type field (service type field) in the Ethercat frame structure is firstly expanded, so that it can be applied to a variety of services, as shown in Table 2.
[0092] Table 2 Meaning of the extended Type field (business type field)
[0093]
[0094] Among them, the command words in Table 2 represent the service type identification value. Exemplarily, the first identification value is 0xF, which means that the master station sets the threshold parameters for all slave stations, that is, sets the threshold parameters for collecting service data of the slave stations. The second identification value is 0xE, which means that the master station actively collects the service data of all slave stations once, and for the slave station, it means collecting its own service data. The third identification value is 0xD, which means that the slave station actively reports the collected service data.
[0095] Secondly, if Figure 2 As shown, the present application extends the Payload area in the Ethercat frame structure, and 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, and each INFO structure is shown in Table 3.
[0096] Table 3 Description of each field of INFO
[0097]
[0098]
[0099]
[0100] Each information unit includes different service parameters, and each service data corresponds to an information unit. Thus, the main station can collect the service data customized by the user.
[0101] The present application provides an industrial control system, exemplary, such as 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 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 may be to configure the slave station information, or to actively collect the business data of all slave stations.
[0104] 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 slave station first determines the service type to be executed according to the service type identification value, and then generates a response message based on the service data collected by each group of service parameters.
[0105] The master station is also used to receive and parse the response messages returned by each of the slave stations to obtain the service data collected based on each group of service parameters.
[0106] Although the existing Ethercat protocol has excellent transmission performance, for industrial scenarios, the business data that users care about are often relatively fixed categories, such as pressure, temperature, vibration, voltage value, current value, etc. Actively collecting business data through the master station each time will increase 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. Exemplarily, the batch information collection 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 load area in the service message.
[0110] S120, 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.
[0111] S130, filling each group of service parameters determined according to each category of service data into a corresponding information unit. Determine a group of service parameters according to a category of service data, and fill the group of service parameters into a unique corresponding information unit.
[0112] S140, encapsulate the filled information units and the service type field according to a preset Ethernet frame protocol to obtain the service message, and send it 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 implementation, 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, determine that the service type identification value is a first identification value, and fill 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 trigger an alarm;
[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 business 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 category 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 corresponding category of service data 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 respectively.
[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, then determine that each group of service parameters also 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 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 for the slave station to collect the corresponding category of service data. After receiving the collection period in this collection period field (also called CollectInterval field), the slave station will collect information according to the time period in the CollectInterval field. Further, when it exceeds the threshold Times consecutively (and Flag is 1), it will actively report an alarm to the master station.
[0128] Further, 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] The step of filling the information data threshold identification value into a threshold field of a corresponding information unit includes:
[0130] Fill 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 service 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 service 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 over-threshold number identification value in the over-threshold 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 corresponding number of 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 implementation, 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 service type is to collect service data of all slave stations, the service type identification value is determined to be a second identification value, and the second identification value is filled 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.
[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 respectively. 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 business data to be collected by the slave station.
[0145] Exemplarily, 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, collect the temperature information of all slave stations, then the service type identification 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 identification value in the information category field TP_1 is 1, indicating that the collected information is temperature; the information length identification value in the information length field LEN is 0, indicating that it is not concerned, and the information data field DATA stores the padding bit, such as Figure 6 Therefore, when the master station triggers a one-time information collection action for all slave stations, 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, thereby obtaining the number of units;
[0150] A plurality of information units having the same number as the unit are parsed from the load area in the response message; that is, the number in the information unit number 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 according to the business type identification value in the business message and the corresponding business parameters.
[0152] Furthermore, the business data of a category is obtained by parsing each of the information units, including:
[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, when 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, 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 value in the service type field Type is 0xD, the value in the information unit number field INFO_NUM is 1, the information category identifier value in the information category field TP_1 is 1, indicating temperature; the information length identifier value 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] Exemplarily, when the slave station periodically collects business data and reports alarm information, when the master station sets the threshold parameters and sets the alarm report 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 and obtain N information units from the data area in the load area, 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] Further, in step S220, the parsing of the service type field of the service message to obtain the service type identification value includes:
[0165] If the service type identification value is the first identification value, determining the service type is to set a threshold parameter for the slave station.
[0166] In step S240, if the service type is to set a threshold parameter 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 the 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 from each information unit to obtain a corresponding set of service parameters also includes:
[0172] Parse the information length field of the corresponding information unit to obtain the information length identification value;
[0173] The collection period identification 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 respectively includes:
[0175] According to the service type identification value being the first identification value, determining to monitor the service data of the corresponding category based on any group 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] Judging whether the service data of the corresponding category exceeds the threshold according to the information data threshold identification value;
[0178] Determine the number of times that the service data of the corresponding category exceeds the threshold according to the threshold-exceeding times identification value;
[0179] Determine whether to send 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 according to the alarm 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 respectively further includes:
[0181] Determine the length of the service data to be collected according to the information length identification value;
[0182] The period for collecting the corresponding category of business data is determined according to the collection period identification value. Exemplarily, after receiving the collection period identification value in the collection period field (also called the CollectInterval field), the slave station will collect information according to the time period in the CollectInterval field, and will actively report an alarm to the master station when it exceeds the threshold Times consecutively (and Flag is 1).
[0183] This application can accurately focus on the information required by users by improving the Ethercat protocol, and can improve the efficiency of information collection. In addition, the slave station can periodically report information so that the master station can collect business data. When the slave station monitors that the business data exceeds the threshold set by the user, it will actively report the current business data to the master station.
[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, used to fill 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; wherein the service type field is located in the message header in the load area of the service message;
[0186] An information unit determination module, used for determining, according to 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 in the load area, where N≥1;
[0187] An information unit filling module, used to fill each group of service parameters determined according to each category of service data into a corresponding information unit;
[0188] A message encapsulation and sending module, used for 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;
[0189] A message receiving module is used to receive and parse the response messages returned by each of the slave stations; the response message is generated by the slave station based on the business type identification value and the business data collected by each group of business parameters; the response message includes 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 options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0191] The present application also provides a terminal 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 terminal device to execute the functions of each module in the above-mentioned batch information collection method or the above-mentioned batch information collection device. The terminal device is 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 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.
[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 above-mentioned terminal 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.
[0195] 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.
[0196] 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.
[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 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.
[0198] The above description is only a specific implementation manner 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 included in the protection scope of the present application.
Claims
1. A batch information collection method, characterized in that: Applicable to master stations, 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 load area in the service message; 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; Fill each group of service parameters determined according to each category of 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 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, determine that the service type identification value is a first identification value, and fill 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 trigger an alarm; The step of 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 business 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 category 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 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 respectively; The step of 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, then determine that each group of service parameters also 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 cycle identification value is filled into the collection cycle field of the corresponding information unit; the collection cycle 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, determine that the service type identification value is a second identification value, and fill 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 number of information units; 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 respectively; The step of 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 business 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 business 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, thereby obtaining 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 according to 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 sending 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; The step of filling the information data threshold identification value into a threshold field of a corresponding information unit includes: Fill 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 service 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 service 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 a message header in a 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 load area to obtain N information units, 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 main 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 is obtained by parsing each information unit, including: Parsing the information category field of the corresponding information unit to obtain the 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; Parsing the alarm field of the corresponding information unit to obtain the alarm identification value; The collecting of service data based on the service type identification value and each group of service parameters respectively includes: According to the service type identification value being the first identification value, determining to monitor the service data of the corresponding category based on any group of the service parameters specifically includes: Determining the category of the business data to be collected according to the information category identification value; Judging whether the service data of the corresponding category exceeds the threshold according to the information data threshold identification value; Determine the number of times that the service data of the corresponding category exceeds the threshold according to the threshold-exceeding times identification value; Determine whether to send 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 according to the alarm 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 a plurality of slave stations; The master station is used to fill 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; wherein the service type field is located in the message header in the load area of the service message; 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, N ≥ 1; fill each group of service parameters determined according to each category of the service data into the corresponding information unit; encapsulate the filled information units and the service type field according to the preset Ethernet frame protocol to obtain the service message, and send it 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 also used to receive and parse the response messages returned by each of the slave stations to obtain the service data collected based on each group 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
RoCE protocol message data transmission method and device, equipment and medium
CN118413582A
Service message generation method, communication method and terminal equipment
CN118631395A
End-to-end lossless ethernet in ethernet fabric
US20130051235A1
