WO2022188103A1 - 数据采集方法、装置、计算设备以及存储介质 - Google Patents

数据采集方法、装置、计算设备以及存储介质 Download PDF

Info

Publication number
WO2022188103A1
WO2022188103A1 PCT/CN2021/080259 CN2021080259W WO2022188103A1 WO 2022188103 A1 WO2022188103 A1 WO 2022188103A1 CN 2021080259 W CN2021080259 W CN 2021080259W WO 2022188103 A1 WO2022188103 A1 WO 2022188103A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
offset
byte
data point
indicator
Prior art date
Application number
PCT/CN2021/080259
Other languages
English (en)
French (fr)
Inventor
吴腾飞
博芬西彭·丹尼尔
朱加兴
王佩佩
干珊珊
刘奕
林艳
Original Assignee
西门子股份公司
西门子(中国)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 西门子股份公司, 西门子(中国)有限公司 filed Critical 西门子股份公司
Priority to EP21929581.3A priority Critical patent/EP4293442A1/en
Priority to PCT/CN2021/080259 priority patent/WO2022188103A1/zh
Priority to CN202180093644.8A priority patent/CN116868136A/zh
Publication of WO2022188103A1 publication Critical patent/WO2022188103A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts

Definitions

  • the present disclosure generally relates to the technical field of digital factories, and more particularly, to a data acquisition method, apparatus, computing device, and storage medium.
  • the present invention proposes a data collection method for collecting data points from field devices more efficiently.
  • a data collection method comprising: generating a list of data points to be collected from a field device; respectively performing the following operations for each data point in the list: an address of the data point Perform parsing to determine the value of the area type, DB offset, byte offset and bit offset in the address; according to the area type, the DB offset, the byte offset and the bit offset Calculate the order indicator of the data point by using the first predetermined rule; according to the value of the region type, the DB offset and the byte offset, use the second predetermined rule to calculate the grouping of the data point indicator; all data points are ordered according to the calculated ordering indicator for each data point; based on the grouping indicator and byte length of each data point and the length of the protocol data unit of the field device, the ordering will be All subsequent data points are divided into groups; and a data request is sent for each group of data points.
  • dividing all sorted data points into multiple groups includes: traversing all data points starting from the first data point, When the length of the section is less than or equal to the length of the protocol data unit and the number of divided groups is the smallest, calculate the sum of the byte lengths of all groups under different grouping methods, and use the grouping method with the smallest sum of the byte lengths.
  • the data points are grouped.
  • the data point grouping unit is further configured to: traverse all data points starting from the first data point, if the byte length of each divided group is less than or equal to the length of the protocol data unit and the number of divided groups is the least, calculate the sum of the byte lengths of all groups under different grouping methods, and use the grouping method with the smallest sum of the byte lengths to the data. Click to group.
  • a computing device comprising: at least one processor; and a memory coupled to the at least one processor, the memory for storing instructions, when the instructions are executed by the at least one processor When executed by the processor, the processor is caused to execute the method as described above.
  • a non-transitory machine-readable storage medium storing executable instructions that, when executed, cause the machine to perform the method as described above.
  • a computer program comprising computer-executable instructions which, when executed, cause at least one processor to perform the method as described above.
  • a computer program product tangibly stored on a computer-readable medium and comprising computer-executable instructions that, when executed, cause at least one A processor executes the method as described above.
  • a general data model that can describe data points of different field devices is defined, and a plurality of data points are divided into several groups based on the information extracted from the data points. Combining several data points in a group can reduce the number of data requests, thereby improving communication efficiency; in addition, selecting a way to group the data points in a way that minimizes the sum of the byte lengths of all the divided groups can reduce the number of data requests including invalid bytes, thereby further improving the communication efficiency.
  • the method and device according to the present invention fully consider the similarity and difference of data points of different devices, and have good compatibility.
  • FIG. 1 is a flowchart of an exemplary process of a data collection method 100 according to an embodiment of the present invention
  • FIG. 2 is a block diagram of an exemplary configuration of a data acquisition apparatus 200 according to an embodiment of the present invention
  • FIG. 3 shows a block diagram of a computing device 300 implementing data collection in accordance with an embodiment of the present disclosure.
  • Data acquisition device 202 Data point list generation unit
  • Data point information processing unit 206 Data point sorting unit
  • Data point grouping unit 210 Data request unit
  • the term “including” and variations thereof represent open-ended terms meaning “including but not limited to”.
  • the term “based on” means “based at least in part on”.
  • the terms “one embodiment” and “an embodiment” mean “at least one embodiment.”
  • the term “another embodiment” means “at least one other embodiment.”
  • the terms “first”, “second”, etc. may refer to different or the same objects. Other definitions, whether explicit or implicit, may be included below. The definition of a term is consistent throughout the specification unless the context clearly dictates otherwise.
  • the present invention proposes a data collection method for collecting data points from field devices more efficiently.
  • Collecting data from field devices is usually based on socket communication, which includes two steps: 1) sending a data request to the field device; 2) reading a data response from the field device. Through these two steps, the user can obtain the data of each data point of the field device.
  • Data points are variables with physical meaning stored in field devices, such as temperature, humidity, etc. According to the data collection method of the present disclosure, multiple data points can be combined in one data request, which can reduce the number of data requests sent to field devices, thereby improving communication efficiency.
  • improving communication efficiency includes two aspects. On the one hand, the number of data requests is reduced as much as possible; when the first aspect is satisfied, the total payload byte length is further reduced. To reduce the number of data requests, data points with similar addresses in device memory can be combined into one data request.
  • a data point model that can describe data points of different devices is proposed, and the data point model includes information that can describe the similarity of the addresses of the data points.
  • data point model defined in the present disclosure, for example, information such as data point name, data point address, source data type, destination data type, data transformation and the like may be included.
  • information such as data point name, data point address, source data type, destination data type, data transformation and the like may be included.
  • the specific meaning of each piece of information is explained in detail below.
  • data point addresses are described in the following manner, and a data point address includes attributes: area type, DB offset, byte offset, and bit offset.
  • the area type represents the station ID of the device; for PLC devices, the area type represents different data areas, such as M, I, Q, DB areas in some PLCs.
  • the DB offset can also have different meanings for different devices.
  • the DB offset represents the object type, such as coils, discrete inputs, holding registers, and input registers, etc.; for some PLCs, the DB offset represents the DB offset number, such as DB1, DB2; and for other PLCs , the DB offset can be set to 0.
  • Bit offset represents the bit offset within the byte.
  • the metadata type represents the data type defined in a field device.
  • the data types defined in the same field device are usually the same, such as bool, char, byte, short, int, word, dword, long, string, etc.
  • the byte length of a data point can be determined.
  • the data types defined in the IT system or cloud platform are usually the same in the same IT system or cloud platform, such as bool, int, double, long, string, etc.
  • the storage location of a data point can be determined. Therefore, the data point model includes at least two pieces of information, the data point address and the source data type.
  • the data point model may also include information such as data point name, destination data type, and data transformation.
  • data of many data points may be collected from one field device, and the method according to the embodiment of the present disclosure can group the plurality of data points, and a data request includes a request for a group of multiple data points, This can reduce the number of data requests and improve communication efficiency.
  • FIG. 1 is a flowchart of an exemplary process of a data collection method 100 according to an embodiment of the present invention.
  • the list includes information for multiple data points that the user wants to collect from the field device.
  • the edge device may have an engineering tool to configure the list of data points to be collected from the field device.
  • the engineering tool can be, for example, a web user interface or a PC client.
  • Each data point in the generated list of data points conforms to the data point model defined above.
  • step S104 the following operations are respectively performed for each data point in the list.
  • the address of the data point is parsed, and the values of the area type, DB offset, byte offset and bit offset in the address are determined.
  • the data point address in the data point list is a character string representing address information. By parsing the character string, the values of the above attributes can be obtained.
  • a data point in the Modbus device has an address of 1.40001.1.
  • the attribute value of the data point address can be obtained as follows:
  • zone type 1 (workstation ID)
  • an ordering indicator can be calculated based on the values of the region type, DB offset, byte offset, and bit offset.
  • the rank indicator is defined as a 64-bit number, and the following formula is used to calculate the rank indicator for the data point.
  • ordering indicator area type ⁇ 48 + DB offset ⁇ 32 + byte offset * 8 * data unit + bit offset
  • the symbol " ⁇ n" indicates that a value is shifted to the left by n bits for storage, and the data unit indicates the actual changed byte size when the byte offset of the address of the field device changes by 1.
  • Different field devices may have different data units. For example, some devices actually change 1 byte when the byte offset of the address changes by 1, while some devices actually change 2 bytes when the byte offset of the address changes by 1. bytes, so the byte offset is multiplied by one data unit when calculating the sort indicator.
  • the ordering indicator is calculated based on the values of region type, DB offset, byte offset, and bit offset, so it can be used to evaluate the similarity between addresses of different data points.
  • the grouping indicator can be calculated based on the values of the region type, DB offset, and byte offset.
  • the grouping indicator is also defined as a 64-bit number, and the following formula is used to calculate the grouping indicator for the data point.
  • grouping indicator area type ⁇ 48 + DB offset ⁇ 32 + byte offset * data unit
  • the grouping indicator is the information that can be used when grouping data points, which does not contain the information of the bits in the address, because the information of the bits is not considered when grouping, and again, the byte offset here is also multiplied by the data unit .
  • step S106 all data points are sorted according to the calculated sorting indicator of each data point.
  • all data points are sorted in ascending order of their addresses.
  • the data points sorted in this way are arranged in order of addresses from small to large.
  • step S108 all the sorted data points are divided into groups based on the grouping indicator and byte length of each data point and the length of the protocol data unit of the field device.
  • all sorted data points can be grouped in the following way.
  • PDU lengths of field devices using different communication protocols may be different, and each field device has its standard PDU (Protocol Data Unit) length.
  • PDU Protocol Data Unit
  • the addresses between the addresses of two adjacent data points store invalid data irrelevant to the data to be requested. Such addresses are invalid. If the data request sent to the field device contains many such invalid addresses, Then the obtained data will include more invalid data, which reduces the communication efficiency. Therefore, it is desirable to include as few invalid addresses as possible in data requests. By minimizing the sum of the byte lengths of all the divided groups, it can be achieved that all data point groups include as few invalid addresses as possible, which can further improve communication efficiency.
  • the data points are divided into M groups.
  • the byte length of group m is: the grouping indicator of data point E + the byte length of data point E - Grouping indicator for data point S.
  • the byte length of each group can be calculated, and then the sum of the byte lengths of all groups can be calculated.
  • All data points are traversed from the first data point, and under the condition that the byte length of each divided group is less than or equal to the PDU length and the number of divided groups is the least, calculate all groups in different grouping methods respectively.
  • the sum of the byte lengths of , and finally the data points are grouped by the grouping method with the smallest sum of byte lengths.
  • step S110 a data request for each group of data points is sent to the field device.
  • the address of the starting data point and the total byte length from the starting data point to the ending data point can be known. Based on these two parameters, the data points of a group can be combined in one read request Send data requests to field devices.
  • FIG. 2 is a block diagram of an exemplary configuration of a data acquisition apparatus 200 according to an embodiment of the present invention.
  • the data collection apparatus 200 includes: a data point list generation unit 202 , a data point information processing unit 204 , a data point sorting unit 206 , a data point grouping unit 208 , and a data request unit 210 .
  • the data point list generation unit 202 is configured to generate a list of data points to be collected from the field device.
  • the data point information processing unit 204 is configured to perform the following operations for each data point in the list:
  • the DB offset, the byte offset and the bit offset using a first predetermined rule to calculate the ordering indicator of the data point;
  • a grouping indicator for the data point is calculated using a second predetermined rule based on the values of the region type, the DB offset and the byte offset.
  • the data point sorting unit 206 is configured to sort all data points according to the calculated sorting indicator for each data point.
  • the data point grouping unit 208 is configured to divide all of the ordered data points into groups based on the grouping indicator and byte length of each data point and the length of the protocol data unit of the field device.
  • the data request unit 210 is configured to send a data collection request for each group of data points.
  • the data point grouping unit 208 is further configured to: traverse all data points starting from the first data point, if the byte length of each divided group is less than or equal to the length of the protocol data unit In the case of the minimum length and the number of divided groups, the sum of the byte lengths of all groups in different grouping modes is calculated, and the data points are grouped by using the grouping mode with the smallest sum of the byte lengths.
  • sort indicator area type ⁇ 48+DB offset ⁇ 32+byte offset*8*data unit+bit offset.
  • the data unit represents the actual changed byte size when the byte offset of the address of the field device changes by 1.
  • the details of the operations and functions of the various parts of the data collection apparatus 200 may be the same as or similar to the relevant parts of the embodiment of the data collection method 100 of the present disclosure described with reference to FIG. 1 , for example, and will not be described in detail here.
  • a general data model that can describe data points of different field devices is defined, and a plurality of data points are divided into several groups based on the information extracted from the data points. Combining several data points in a group can reduce the number of data requests, thereby improving communication efficiency; in addition, selecting a way to group the data points in a way that minimizes the sum of the byte lengths of all the divided groups can reduce the number of data requests including invalid bytes, thereby further improving the communication efficiency.
  • the method and device according to the present invention fully consider the similarity and difference of data points of different devices, and have good compatibility.
  • Each unit of the above-mentioned data acquisition device may be implemented by hardware, or may be implemented by software or a combination of hardware and software.
  • computing device 300 may include at least one processor 302 that executes at least one computer-readable instruction (ie, the above-described in software form) stored or encoded in a computer-readable storage medium (ie, memory 304 ). implemented elements).
  • processor 302 that executes at least one computer-readable instruction (ie, the above-described in software form) stored or encoded in a computer-readable storage medium (ie, memory 304 ). implemented elements).
  • a non-transitory machine-readable medium may have machine-executable instructions (ie, the above-described elements implemented in software) that, when executed by a machine, cause the machine to perform various embodiments of the present disclosure above in conjunction with FIGS. 1-2 Various operations and functions are described.
  • a computer program comprising computer-executable instructions that, when executed, cause at least one processor to perform each of the various embodiments of the present disclosure described above in connection with FIGS. 1-2 operations and functions.
  • a computer program product comprising computer-executable instructions that, when executed, cause at least one processor to perform the various embodiments of the present disclosure described above in connection with FIGS. 1-2 Various operations and functions.
  • the device structure described in the above embodiments may be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities respectively, or may be implemented by multiple physical entities. Some components in separate devices are implemented together.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本公开涉及数据采集方法、装置、计算设备以及存储介质。数据采集方法,包括:生成要从现场设备采集的数据点的列表;针对列表中的每一个数据点分别执行以下操作:对该数据点的地址进行解析,确定地址中的区域类型、DB偏移、字节偏移和位偏移的值;根据区域类型、DB偏移、字节偏移和位偏移的值,利用第一预定规则计算该数据点的排序指示符;根据区域类型、DB偏移和字节偏移的值,利用第二预定规则计算该数据点的分组指示符;按照所计算的每个数据点的排序指示符,对所有数据点进行排序;基于每个数据点的分组指示符和字节长度以及现场设备的协议数据单元的长度,将排序后的所有数据点划分为多个组;以及向现场设备发送针对每一组数据点的数据请求。

Description

数据采集方法、装置、计算设备以及存储介质 技术领域
本公开通常涉及数字化工厂技术领域,更具体地,涉及数据采集方法、装置、计算设备以及存储介质。
背景技术
为了实现工业4.0,通过将现场设备数据传送给IT系统和/或工业云来实现数据透明化是非常重要的。存在不同类型的现场设备,包括传感器、PLC(可编程逻辑控制器)、CNC(数控车床)等设备,不同类型的现场设备具有它们自己的通信协议。当需要从现场设备获取大量数据点时,如何可以针对不同设备提高通信效率是一个重要问题。
在现有技术中,很多工业网关支持从现场设备进行数据采集,但是目前没有一种能够以最优方式采集数据的通用的数据采集方法。。
发明内容
在下文中给出关于本发明的简要概述,以便提供关于本发明的某些方面的基本理解。应当理解,这个概述并不是关于本发明的穷举性概述。它并不是意图确定本发明的关键或重要部分,也不是意图限定本发明的范围。其目的仅仅是以简化的形式给出某些概念,以此作为稍后论述的更详细描述的前序。
有鉴于此,本发明提出了一种更加高效地从现场设备对数据点进行采集的数据采集方法。
根据本公开的一个方面,提供了一种数据采集方法,包括:生成要从现场设备采集的数据点的列表;针对所述列表中的每一个数据点分别执行以下操作:对该数据点的地址进行解析,确定所述地址中的区域类型、DB偏移、字节偏移和位偏移的值;根据所述区域类型、所述DB偏移、所述字节偏移和所述位偏移的值,利用第一预定规则计算该数据点的排序指示符;根据所述区域类型、所述DB偏移和所述字节偏移的值,利用第二预定规则计算该数据点的分组指示符;按照所计算的每个数据点的排序指示符,对所有数据点进行排序;基于每个数据点的分组指示符和字节长度以及所述现场设备的协议 数据单元的长度,将排序后的所有数据点划分为多个组;以及针对每一组数据点发送数据请求。
通过这样的方式,可以减少数据请求次数,提高通信效率。
可选地,在上述方面的一个示例中,将排序后的所有数据点划分为多个组包括:从第一个数据点开始对所有数据点进行遍历,在满足所划分的每个组的字节长度小于或等于所述协议数据单元的长度并且划分的组的数目最少的情况下,分别计算不同分组方式下所有组的字节长度的总和,采用所述字节长度的总和最小的分组方式对所述数据点进行分组。
通过这样的方式,可以减小总的载荷字节长度,进一步提高通信效率。
可选地,在上述方面的一个示例中,所述第一预规则为:排序指示符=区域类型<<48+DB偏移<<32+字节偏移*8*数据单位+位偏移,其中,所述数据单位表示当所述现场设备的地址的字节偏移改变1时,实际改变的字节。
可选地,在上述方面的一个示例中,所述第二预规则为:分组指示符=区域类型<<48+DB偏移<<32+字节偏移*数据单位,其中,所述数据单位表示当所述现场设备的地址的字节偏移改变1时,实际改变的字节大小。
根据本公开的另一方面,提供了数据采集装置,包括:数据点列表生成单元,被配置为生成要从现场设备采集的数据点的列表;数据点信息处理单元,被配置为针对所述列表中的每一个数据点执行以下操作:对该数据点的地址进行解析,确定所述地址中的区域类型、DB偏移、字节偏移和位偏移的值;根据所述区域类型、所述DB偏移、所述字节偏移和所述位偏移的值,利用第一预定规则计算该数据点的排序指示符;根据所述区域类型、所述DB偏移和所述字节偏移的值,利用第二预定规则计算该数据点的分组指示符;数据点排序单元,被配置为按照所计算的每个数据点的排序指示符,对所有数据点进行排序;数据点分组单元,被配置为基于每个数据点的分组指示符和字节长度以及所述现场设备的协议数据单元的长度,将排序后的所有数据点划分为多个组;以及数据请求单元,被配置为针对每一组数据点发送数据采集请求。
可选地,在上述方面的一个示例中,所述数据点分组单元进一步被配置为:从第一个数据点开始对所有数据点进行遍历,在满足所划分的每个组的字节长度小于或等于所述协议数据单元的长度并且划分的组的数目最少的情况下,计算不同分组方式下所有组的字节长度的总和,采用所述字节长度的总和最小的分组方式对所述数据点进行分组。
根据本公开的另一方面,提供了计算设备,包括:至少一个处理器;以及与所述至 少一个处理器耦合的一个存储器,所述存储器用于存储指令,当所述指令被所述至少一个处理器执行时,使得所述处理器执行如上所述的方法。
根据本公开的另一方面,提供了一种非暂时性机器可读存储介质,其存储有可执行指令,所述指令当被执行时使得所述机器执行如上所述的方法。
根据本公开的另一方面,提供了一种计算机程序,包括计算机可执行指令,所述计算机可执行指令在被执行时使至少一个处理器执行如上所述的方法。
根据本公开的另一方面,提供了一种计算机程序产品,所述计算机程序产品被有形地存储在计算机可读介质上并且包括计算机可执行指令,所述计算机可执行指令在被执行时使至少一个处理器执行如上所述的方法。
根据本发明的数据采集方法和装置,定义了一种可以描述不同现场设备的数据点的数据通用模型,基于从数据点中提取的信息将多个数据点划分为几个组,在一个数据请求中合并一组若干个数据点,可以减小数据请求次数,从而提高通信效率;此外,选择使得划分的所有组的字节长度的总和最小的方式对数据点进行分组,可以减少数据请求中包括的无效字节,从而进一步提高了通信效率。根据本发明的方法和装置充分考虑了不同设备的数据点的相似性和差异性,具有很好的兼容性。
附图说明
参照下面结合附图对本发明实施例的说明,会更加容易地理解本发明的以上和其它目的、特点和优点。附图中的部件只是为了示出本发明的原理。在附图中,相同的或类似的技术特征或部件将采用相同或类似的附图标记来表示。附图中:
图1为根据本发明实施例的数据采集方法100的示例性过程的流程图;
图2为根据本发明实施例的数据采集装置200的示例性配置的框图;
图3示出了根据本公开的实施例的实现数据采集的计算设备300的方框图。
其中,附图标记如下:
100:数据采集方法            S102、S104、S106、S108和S110:步骤
200:数据采集装置            202:数据点列表生成单元
204:数据点信息处理单元      206:数据点排序单元
208:数据点分组单元          210:数据请求单元
300:计算设备                302:处理器
304:存储器
具体实施方式
现在将参考示例实施方式讨论本文描述的主题。应该理解,讨论这些实施方式只是为了使得本领域技术人员能够更好地理解从而实现本文描述的主题,并非是对权利要求书中所阐述的保护范围、适用性或者示例的限制。可以在不脱离本公开内容的保护范围的情况下,对所讨论的元素的功能和排列进行改变。各个示例可以根据需要,省略、替代或者添加各种过程或组件。例如,所描述的方法可以按照与所描述的顺序不同的顺序来执行,以及各个步骤可以被添加、省略或者组合。另外,相对一些示例所描述的特征在其它例子中也可以进行组合。
如本文中使用的,术语“包括”及其变型表示开放的术语,含义是“包括但不限于”。术语“基于”表示“至少部分地基于”。术语“一个实施例”和“一实施例”表示“至少一个实施例”。术语“另一个实施例”表示“至少一个其他实施例”。术语“第一”、“第二”等可以指代不同的或相同的对象。下面可以包括其他的定义,无论是明确的还是隐含的。除非上下文中明确地指明,否则一个术语的定义在整个说明书中是一致的。
为了解决上述问题,本发明提出了一种更加高效地从现场设备对数据点进行采集的数据采集方法。
从现场设备采集数据通常基于socket通信,其包括两个步骤:1)向现场设备发送数据请求;2)从现场设备读取数据响应。通过这两个步骤,用户可以获得现场设备的各个数据点的数据。数据点是存储在现场设备中的具有物理含义的变量,例如温度、湿度等。根据本公开的数据采集方法,可以在一个数据请求中合并多个数据点,这样可以减少向现场设备发送的数据请求的次数,从而提高通信效率。
根据本公开,提高通信效率包括两个方面,一方面是尽可能减少数据请求次数;在满足第一方面的情况下,进一步减小总的载荷字节长度。为了减小数据请求次数,可以将在设备内存中具有相似地址的数据点合并到一个数据请求中。在本公开中,提出了一种可以描述不同设备的数据点的数据点模型,在该数据点模型中,包含能够描述数据点地址的相似性的信息。
在本公开中定义的数据点模型中,例如可以包括数据点名称、数据点地址、源数据类型、目的地数据类型、数据变换等信息。下面具体说明这每一项信息的具体含义。
·数据点名称
用于标识数据点,不同数据点的数据点名称各不相同。
·数据点地址
用于在现场设备中的对数据点进行寻址。不同设备可能具有不同数据点地址定义。在本公开中采用以下方式来描述数据点地址,一个数据点地址包括属性:区域类型,DB偏移,字节偏移和位偏移。
Figure PCTCN2021080259-appb-000001
区域类型
不同的设备可能具有不同的区域类型定义。例如,对于Modbus设备,区域类型表示设备的工作站ID;对于PLC设备,区域类型表示不同的数据区域,例如在某些PLC中,为M,I,Q,DB区。
Figure PCTCN2021080259-appb-000002
DB偏移
对于不同的设备,DB偏移也可以有不同的含义。例如在Modbus设备中,DB偏移代表对象类型,比如线圈、离散输入、保持寄存器和输入寄存器等;对于某些PLC,DB偏移表示DB偏移编号,比如DB1、DB2;而对于另一些PLC,可以将DB偏移设置为0。
Figure PCTCN2021080259-appb-000003
字节偏移
字节偏移代表DB中的字节偏移,或者当DB偏移为0时在数据区域中的字节偏移。
Figure PCTCN2021080259-appb-000004
位偏移
位偏移表示在字节中的位偏移。
·源数据类型
元数据类型表示一个现场设备中定义的数据类型,在同一个现场设备中定义的数据类型通常是相同的,例如bool,char,byte,short,int,word,dword,long,string等。根据源数据类型,可以确定一个数据点的字节长度。
·目的地数据类型
在IT系统或者云平台中定义的数据类型,在同一个IT系统或者云平台中,数据类型通常是相同的,例如bool,int,double,long,string等。
·数据变换
从现场设备读取的数据通常为字节阵列形式,需要通过线性变换或平方变换从字节阵列中提取有含义的数据。
根据由数据点地址所确定的存储数据点的起始地址以及由源数据类型确定的数据点 的字节长度,就可以可以确定一个数据点的存储位置。因此数据点模型至少包括数据点地址和源数据类型这两项信息。可选地,数据点模型还可以包括数据点名称、目的地数据类型和数据变换等信息。
如上所述,从一个现场设备可能要采集很多数据点的数据,根据本公开实施例的方法可以对这多个数据点进行分组,在一个数据请求中包括对一组多个数据点的请求,这样可以减少数据请求次数,提高通信效率。
下面将结合附图来描述根据本公开的实施例的数据采集方法和装置。
图1为根据本发明实施例的数据采集方法100的示例性过程的流程图。
首先,在步骤S102中,生成要从现场设备采集的数据点的列表。
该列表中包括用户想要从现场设备采集的多个数据点的信息。
在一个具体示例中,边缘设备可以具有一个工程工具来配置要从现场设备采集的数据点的列表。工程工具例如可以是Web用户界面或者PC客户端等。所生成的数据点列表中的每个数据点符合以上所定义的数据点模型。
接着,在步骤S104中,针对所述列表中的每一个数据点分别执行以下操作。
首先,对该数据点的地址进行解析,确定所述地址中的区域类型、DB偏移、字节偏移和位偏移的值。
在数据点列表中的数据点地址是一个表示地址信息的字符串,对这个字符串进行解析,可以得到上述各个属性的值。
例如,以Modbus设备作为一个具体示例,Modbus设备中的一个数据点具有地址1.40001.1,对该地址进行解析可以得到数据点地址的属性值如下:
区域类型=1(工作站ID)
DB偏移=4(保持寄存器)
字节偏移=1
位偏移=1
接下来,可以根据区域类型、DB偏移、字节偏移和位偏移的值,计算排序指示符。
在一个具体示例中,将排序指示符定义为一个64位的数,并且利用下面的公式来计算该数据点的排序指示符。
排序指示符=区域类型<<48+DB偏移<<32+字节偏移*8*数据单位+位偏移
其中,符号“<<n”表示将一个值左移n位进行存储,数据单位表示当所述现场设备的地址的字节偏移改变1时,实际改变的字节大小。不同的现场设备的数据单位可能不同,例如,有些设备在地址的字节偏移改变1时,实际改变1个字节,而有些设备在地址的字节偏移改变1时,实际改变2个字节,因此在计算排序指示符时,对字节偏移乘以一个数据单位。
通过这样的方式,可以得到一个表示该地址的排序指示符的64位的数。
本领域技术人员可以理解,也可以采用其它公式来计算排序指示符,而不限于以上具体示例中所示的公式。该排序指示符基于区域类型、DB偏移、字节偏移和位偏移的值进行计算,因此可以用来评估不同数据点地址之间的相似性。
接下来,可以根据区域类型、DB偏移、字节偏移的值,计算分组指示符。
在一个具体示例中,将分组指示符也定义为一个64位的数,并且利用下面的公式来计算该数据点的分组指示符。
分组指示符=区域类型<<48+DB偏移<<32+字节偏移*数据单位
分组指示符是对数据点进行分组时可以使用的信息,其中不包含地址中的位的信息,这是因为在分组时不考虑位的信息,同样,这里的字节偏移也乘以数据单位。
接着,在步骤S106中,按照所计算的每个数据点的排序指示符,对所有数据点进行排序。
优选地,按照数据点的地址升序的顺序对所有数据点进行排序。这样排序后的数据点是按照地址从小到大的顺序依次排列。
然后,在步骤S108中基于每个数据点的分组指示符和字节长度以及所述现场设备的协议数据单元的长度,将排序后的所有数据点划分为多个组。
具体地,可以通过以下方式对排序后的所有数据点进行分组。
可以理解,采用不同通信协议的现场设备,其PDU长度可能不同,而每个现场设备具有其标准的PDU(协议数据单元)长度。首先确定要接收数据请求的现场设备的PDU长度,在对数据点进行分组时,每个组的字节长度不能大于PDU长度。
其次,为了使得发送数据请求的次数最少,要使得所有数据点划分的组的数目最少。
最后,在满足以上两点的情况下,使得所有组的字节长度的总和最小。
相邻两个数据点的地址之间的地址存储的是与所要请求的数据无关的无效数据,这样的地址是无效的,如果在发送给现场设备的数据请求中包含较多这样的无效地址,那 么所得到的数据中就会包括较多的无效数据,这样降低了通信效率。因此,希望在数据请求中尽可能不包含或者包含较少的无效地址。通过使得划分的所有组的字节长度的总和最小,可以实现所有的数据点分组中包括尽可能少的无效地址,这样可以进一步提高通信效率。
假设数据点列表中包括N个数据点1-N,数据点被划分为M个组。
假设第m(m是1-M中的一个)组从数据点S开始,以数据点E结束,则组m的字节长度为:数据点E的分组指示符+数据点E的字节长度-数据点S的分组指示符。
通过以上公式,可以计算出每一个组的字节长度,进而可以计算出所有组的字节长度的总和。
从第一个数据点开始对所有数据点进行遍历,在满足所划分的每个组的字节长度小于或等于PDU长度并且划分的组的数目最少的情况下,分别计算不同分组方式下所有组的字节长度的总和,最后采用字节长度的总和最小的分组方式对数据点进行分组。
本领域技术人员利用数学方法,例如优化算法,可以实现上述最优分组方式,在此不再详述。
最后,在步骤S110中,向所述现场设备发送针对每一组数据点的数据请求。
对于每一个组,可以知道起始数据点的地址,以及从起始数据点至结束数据点的总字节长度,基于这两个参数,可以将一个组的数据点合并在一个读取请求中向现场设备发送数据请求。
图2为根据本发明实施例的数据采集装置200的示例性配置的框图。
如图2所示,数据采集装置200包括:数据点列表生成单元202、数据点信息处理单元204、数据点排序单元206、数据点分组单元208、和数据请求单元210。
数据点列表生成单元202被配置为生成要从现场设备采集的数据点的列表。
数据点信息处理单元204被配置为针对所述列表中的每一个数据点执行以下操作:
对该数据点的地址进行解析,确定所述地址中的区域类型、DB偏移、字节偏移和位偏移的值;
根据所述区域类型、所述DB偏移、所述字节偏移和所述位偏移的值,利用第一预定规则计算该数据点的排序指示符;
根据所述区域类型、所述DB偏移和所述字节偏移的值,利用第二预定规则计算该数据点的分组指示符。
数据点排序单元206被配置为按照所计算的每个数据点的排序指示符,对所有数据点进行排序。
数据点分组单元208被配置为基于每个数据点的分组指示符和字节长度以及所述现场设备的协议数据单元的长度,将排序后的所有数据点划分为多个组。
数据请求单元210,被配置为针对每一组数据点发送数据采集请求。
优选地,所述数据点分组单元208进一步被配置为:从第一个数据点开始对所有数据点进行遍历,在满足所划分的每个组的字节长度小于或等于所述协议数据单元的长度并且划分的组的数目最少的情况下,计算不同分组方式下所有组的字节长度的总和,采用所述字节长度的总和最小的分组方式对所述数据点进行分组。
其中,所述第一预规则为:排序指示符=区域类型<<48+DB偏移<<32+字节偏移*8*数据单位+位偏移。
其中,所述第二预规则为:分组指示符=区域类型<<48+DB偏移<<32+字节偏移*数据单位。
其中,所述数据单位表示当所述现场设备的地址的字节偏移改变1时,实际改变的字节大小。
需要说明的是,图2所示的数据采集装置200及其组成单元的结构仅仅是示例性的,本领域技术人员可以根据需要对图2所示的结构框图进行修改。
数据采集装置200的各个部分的操作和功能的细节例如可以与参照结合图1描述的本公开的数据采集方法100的实施例的相关部分相同或类似,这里不再详细描述。
根据本发明的数据采集方法和装置,定义了一种可以描述不同现场设备的数据点的数据通用模型,基于从数据点中提取的信息将多个数据点划分为几个组,在一个数据请求中合并一组若干个数据点,可以减小数据请求次数,从而提高通信效率;此外,选择使得划分的所有组的字节长度的总和最小的方式对数据点进行分组,可以减少数据请求中包括的无效字节,从而进一步提高了通信效率。
根据本发明的方法和装置充分考虑了不同设备的数据点的相似性和差异性,具有很好的兼容性。
如上参照图1至图2,对根据本公开的实施例的数据采集方法和装置进行了描述。以上所述的数据采集装置的各个单元可以采用硬件实现,也可以采用软件或者硬件和软件的组合来实现。
图3示出了根据本公开的实施例的用于实现数据采集的计算设备300的方框图。根据一个实施例,计算设备300可以包括至少一个处理器302,处理器302执行在计算机可读存储介质(即,存储器304)中存储或编码的至少一个计算机可读指令(即,上述以软件形式实现的元素)。
应该理解,在存储器304中存储的计算机可执行指令当执行时使得至少一个处理器302进行本公开的各个实施例中以上结合图1-2描述的各种操作和功能。
根据一个实施例,提供了一种非暂时性机器可读介质。该非暂时性机器可读介质可以具有机器可执行指令(即,上述以软件形式实现的元素),该指令当被机器执行时,使得机器执行本公开的各个实施例中以上结合图1-2描述的各种操作和功能。
根据一个实施例,提供了一种计算机程序,包括计算机可执行指令,所述计算机可执行指令在被执行时使至少一个处理器执行本公开的各个实施例中以上结合图1-2描述的各种操作和功能。
根据一个实施例,提供了一种计算机程序产品,包括计算机可执行指令,所述计算机可执行指令在被执行时使至少一个处理器执行本公开的各个实施例中以上结合图1-2描述的各种操作和功能。
应当理解的是,本说明书中的各个实施例均采用递进的方式来描述,各个实施例之间相同或相似的部分相互参见即可,每个实施例重点说明的都是与其它实施例的不同之处。例如,对于上述关于装置的实施例、关于计算设备的实施例以及关于机器可读存储介质的实施例而言,由于它们基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
上文对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
上述各流程和各系统结构图中不是所有的步骤和单元都是必须的,可以根据实际的需要忽略某些步骤或单元。上述各实施例中描述的装置结构可以是物理结构,也可以是逻辑结构,即,有些单元可能由同一物理实体实现,或者,有些单元可能分别由多个物理实体实现,或者,可以由多个独立设备中的某些部件共同实现。
上面结合附图阐述的具体实施方式描述了示例性实施例,但并不表示可以实现的或 者落入权利要求书的保护范围的所有实施例。在整个本说明书中使用的术语“示例性”意味着“用作示例、实例或例示”,并不意味着比其它实施例“优选”或“具有优势”。出于提供对所描述技术的理解的目的,具体实施方式包括具体细节。然而,可以在没有这些具体细节的情况下实施这些技术。在一些实例中,为了避免对所描述的实施例的概念造成难以理解,公知的结构和装置以框图形式示出。
本公开内容的上述描述被提供来使得本领域任何普通技术人员能够实现或者使用本公开内容。对于本领域普通技术人员来说,对本公开内容进行的各种修改是显而易见的,并且,也可以在不脱离本公开内容的保护范围的情况下,将本文所定义的一般性原理应用于其它变型。因此,本公开内容并不限于本文所描述的示例和设计,而是与符合本文公开的原理和新颖性特征的最广范围相一致。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (12)

  1. 数据采集方法,包括:
    生成要从现场设备采集的数据点的列表;
    针对所述列表中的每一个数据点分别执行以下操作:
    对该数据点的地址进行解析,确定所述地址中的区域类型、DB偏移、字节偏移和位偏移的值;
    根据所述区域类型、所述DB偏移、所述字节偏移和所述位偏移的值,利用第一预定规则计算该数据点的排序指示符;
    根据所述区域类型、所述DB偏移和所述字节偏移的值,利用第二预定规则计算该数据点的分组指示符;
    按照所计算的每个数据点的排序指示符,对所有数据点进行排序;
    基于每个数据点的分组指示符和字节长度以及所述现场设备的协议数据单元的长度,将排序后的所有数据点划分为多个组;以及
    向所述现场设备发送针对每一组数据点的数据请求。
  2. 如权利要求1所述的方法,其中,将排序后的所有数据点划分为多个组包括:
    从第一个数据点开始对所有数据点进行遍历,在满足所划分的每个组的字节长度小于或等于所述协议数据单元的长度并且划分的组的数目最少的情况下,分别计算不同分组方式下所有组的字节长度的总和,采用所述字节长度的总和最小的分组方式对所述数据点进行分组。
  3. 如权利要求1或2所述的方法,其中,所述第一预规则为:
    排序指示符=区域类型<<48+DB偏移<<32+字节偏移*8*数据单位+位偏移,其中,所述数据单位表示当所述现场设备的地址的字节偏移改变1时,实际改变的字节大小。
  4. 如权利要求1或2所述的方法,其中,所述第二预规则为:
    分组指示符=区域类型<<48+DB偏移<<32+字节偏移*数据单位,
    其中,所述数据单位表示当所述现场设备的地址的字节偏移改变1时,实际改变的字节大小。
  5. 数据采集装置,包括:
    数据点列表生成单元,被配置为生成要从现场设备采集的数据点的列表;
    数据点信息处理单元,被配置为针对所述列表中的每一个数据点执行以下操作:
    对该数据点的地址进行解析,确定所述地址中的区域类型、DB偏移、字节偏移和位偏移的值;
    根据所述区域类型、所述DB偏移、所述字节偏移和所述位偏移的值,利用第一预定规则计算该数据点的排序指示符;
    根据所述区域类型、所述DB偏移和所述字节偏移的值,利用第二预定规则计算该数据点的分组指示符;
    数据点排序单元,被配置为按照所计算的每个数据点的排序指示符,对所有数据点进行排序;
    数据点分组单元,被配置为基于每个数据点的分组指示符和字节长度以及所述现场设备的协议数据单元的长度,将排序后的所有数据点划分为多个组;以及
    数据请求单元,被配置为针对每一组数据点发送数据采集请求。
  6. 如权利要求5所述的装置,其中,所述数据点分组单元进一步被配置为:
    从第一个数据点开始对所有数据点进行遍历,在满足所划分的每个组的字节长度小于或等于所述协议数据单元的长度并且划分的组的数目最少的情况下,计算不同分组方式下所有组的字节长度的总和,采用所述字节长度的总和最小的分组方式对所述数据点进行分组。
  7. 如权利要求5或6所述的装置,其中,所述第一预规则为:
    排序指示符=区域类型<<48+DB偏移<<32+字节偏移*8*数据单位+位偏移,
    其中,所述数据单位表示当所述现场设备的地址的字节偏移改变1时,实际改变的字节大小。
  8. 如权利要求5或6所述的装置,其中,所述第二预规则为:
    分组指示符=区域类型<<48+DB偏移<<32+字节偏移*数据单位,
    其中,所述数据单位表示当所述现场设备的地址的字节偏移改变1时,实际改变的字节大小。
  9. 计算设备(700),包括:
    至少一个处理器(702);以及
    与所述至少一个处理器(702)耦合的一个存储器(704),所述存储器用于存储指令,当所述指令被所述至少一个处理器(702)执行时,使得所述处理器(702)执行如权利要求1到4中任意一项所述的方法。
  10. 一种非暂时性机器可读存储介质,其存储有可执行指令,所述指令当被执行时使得所述机器执行如权利要求1到4中任意一项所述的方法。
  11. 一种计算机程序,包括计算机可执行指令,所述计算机可执行指令在被执行时使至少一个处理器执行根据权利要求1至4中任意一项所述的方法。
  12. 一种计算机程序产品,所述计算机程序产品被有形地存储在计算机可读介质上并且包括计算机可执行指令,所述计算机可执行指令在被执行时使至少一个处理器执行根据权利要求1至4中任意一项所述的方法。
PCT/CN2021/080259 2021-03-11 2021-03-11 数据采集方法、装置、计算设备以及存储介质 WO2022188103A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP21929581.3A EP4293442A1 (en) 2021-03-11 2021-03-11 Data acquisition method and apparatus, calculation device, and storage medium
PCT/CN2021/080259 WO2022188103A1 (zh) 2021-03-11 2021-03-11 数据采集方法、装置、计算设备以及存储介质
CN202180093644.8A CN116868136A (zh) 2021-03-11 2021-03-11 数据采集方法、装置、计算设备以及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/080259 WO2022188103A1 (zh) 2021-03-11 2021-03-11 数据采集方法、装置、计算设备以及存储介质

Publications (1)

Publication Number Publication Date
WO2022188103A1 true WO2022188103A1 (zh) 2022-09-15

Family

ID=83226185

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/080259 WO2022188103A1 (zh) 2021-03-11 2021-03-11 数据采集方法、装置、计算设备以及存储介质

Country Status (3)

Country Link
EP (1) EP4293442A1 (zh)
CN (1) CN116868136A (zh)
WO (1) WO2022188103A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108037725A (zh) * 2017-12-08 2018-05-15 中冶南方工程技术有限公司 一种读写plc数据的方法和装置
US20180322400A1 (en) * 2017-05-05 2018-11-08 Servicenow, Inc. Time series data forecasting
CN112286706A (zh) * 2020-12-25 2021-01-29 北京邮电大学 安卓应用的应用信息远程快速获取方法及相关设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180322400A1 (en) * 2017-05-05 2018-11-08 Servicenow, Inc. Time series data forecasting
CN108037725A (zh) * 2017-12-08 2018-05-15 中冶南方工程技术有限公司 一种读写plc数据的方法和装置
CN112286706A (zh) * 2020-12-25 2021-01-29 北京邮电大学 安卓应用的应用信息远程快速获取方法及相关设备

Also Published As

Publication number Publication date
EP4293442A1 (en) 2023-12-20
CN116868136A (zh) 2023-10-10

Similar Documents

Publication Publication Date Title
CN110268394B (zh) 用于存储和操作键值数据的方法、系统及机器可读存储媒体
US10044575B1 (en) System for organizing and fast searching of massive amounts of data
US20160055220A1 (en) Data driven relational algorithm formation for execution against big data
CN104881466B (zh) 数据分片的处理以及垃圾文件的删除方法和装置
TW201841123A (zh) 用於維護操作之合併樹修改
WO2021073510A1 (zh) 一种数据库的统计方法及装置
WO2018036549A1 (zh) 分布式数据库查询方法、装置及管理系统
CN111061758B (zh) 数据存储方法、装置及存储介质
CN116955361A (zh) 存储器内密钥范围搜索方法和系统
CN106598743A (zh) 一种基于mpi并行求信息系统属性约简的方法
CN110019205B (zh) 一种数据存储、还原方法、装置及计算机设备
EP2208317B1 (en) Compressing null columns in rows of the tabular data stream protocol
WO2022188103A1 (zh) 数据采集方法、装置、计算设备以及存储介质
CN105930104B (zh) 数据存储方法和装置
JP6189266B2 (ja) データ処理装置、データ処理方法及びデータ処理プログラム
CN106446039B (zh) 聚合式大数据查询方法及装置
JP4511464B2 (ja) 情報処理システムおよび情報処理方法
Li et al. Application and performance optimization of MapReduce model in image segmentation
El-Sayed et al. SFSAN approach for solving the problem of small files in Hadoop
JP2015095092A (ja) 情報処理システム、情報処理装置、情報処理方法及びプログラム
CN117520606B (zh) 一种异构数据源导入图数据库的方法及装置
CN116861455B (zh) 事件数据处理方法、系统、电子设备及存储介质
Zhang Design and implementation of data mining based on distributed computing
Chen et al. A balanced partitioning mechanism using collapsed-condensed trie in mapreduce
Li Comparison of Single-Machine and Distributed Calculation of Temporal Degree Metrics

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21929581

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180093644.8

Country of ref document: CN

WWE Wipo information: entry into national phase

Ref document number: 18548981

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 2021929581

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2021929581

Country of ref document: EP

Effective date: 20230911

NENP Non-entry into the national phase

Ref country code: DE