Data acquisition method, device, equipment, medium and program product

By setting up a data acquisition module in the PLC controller, and using memory sharing or data mirroring technology to obtain and send PLC scanning cycle data, the problem of low PLC data acquisition efficiency is solved, and the acquisition of fast and full data is achieved, thereby avoiding the degradation of PLC performance .

CN118938827APending Publication Date: 2024-11-12BEIJING WANWANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410996253.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, due to the limitations of network bandwidth and communication load, PLC data acquisition cannot obtain full data within one scan cycle, resulting in a long data acquisition time, affecting PLC performance and possibly causing production line downtime.

Method used

The data acquisition module is set up in the controller to obtain the scan cycle data generated during the operation of the control program through memory sharing or data mirroring, and send it based on preset conditions to avoid the impact of network bandwidth and communication load.

Benefits of technology

Real-time acquisition of full or close to full data during the PLC scanning cycle is achieved, which improves data acquisition efficiency and reduces the impact on PLC performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118938827A_ABST
    Figure CN118938827A_ABST
Patent Text Reader

Abstract

The invention relates to a data acquisition method and device, equipment, a medium and a program product. The data acquisition method comprises the steps that when a control program of a control module of a controller for equipment control is in a running state, data of at least one scanning period generated in the running process of the control program is acquired through a data acquisition module, and the data acquisition module is arranged in the controller; and sending the data acquired by the data acquisition module based on a preset sending condition, thereby acquiring the data of at least one scanning period generated in the operation process of the control program of the controller in real time through the data acquisition module arranged in the controller, and sending the data to the outside. According to the method, the influence of the industrial field network bandwidth, the maximum communication load of the controller and the like can be avoided, the total or nearly total data in the scanning period of the controller can be obtained, and the control performance of the controller cannot be influenced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data collection method, device, equipment, medium and program product. Background Art

[0002] Controllers used for equipment in industrial sites include programmable logic controllers (PLCs), distributed control systems (DCSs), and robot-specific controllers. Different types of controllers have different control methods and application scenarios. Among them, the programmable logic controller (PLC) is a real-time data exchange system, which is usually used to connect with various detection instruments to detect and obtain the operating status and operating data of various equipment, and then control the industrial equipment through the acquired operating status and operating data of the industrial equipment. Collecting and storing data during the operation of the PLC to facilitate troubleshooting of production line failures is an important function required by industrial manufacturing companies.

[0003] However, in the prior art, PLC data is mainly collected in a round-robin manner by external data acquisition devices connected to the PLC, and transmitted to external third-party components through networks, industrial buses, etc., and the data is stored, processed, analyzed and applied by external third-party components.

[0004] Since the number of variables in PLC project files is often in the millions or even tens of millions, and there is a fixed scan cycle, such as 10 milliseconds, and the time required to collect a single variable is 1 to 20 milliseconds due to the limitation of network bandwidth, if the data is collected by polling, the number of variables that can be collected in each cycle is "(10 / single variable collection time) x number of collection threads", so it is impossible to collect all data in one PLC scan cycle, and only discrete, discontinuous, and partial data can be obtained. It takes a long time to collect the full amount of data, that is, the polling cycle is long, resulting in the full amount of data obtained by multiple collections not being the data of the PLC scan cycle.

[0005] In this regard, even if the network bandwidth is increased, it is still impossible to collect all PLC data within a scan cycle, which is mainly affected by the maximum communication load of the PLC. If a large amount of data is collected frequently, it will affect the performance of the PLC itself. Over time, the performance of the PLC itself will decline and cause the production line to shut down.

[0006] Therefore, the inability to collect and obtain full data within the PLC scanning cycle is a technical problem that the industry urgently needs to solve. Summary of the invention

[0007] In order to solve the above technical problems, the present disclosure provides a data collection method, device, equipment, medium and program product.

[0008] A first aspect of an embodiment of the present disclosure provides a data collection method, including: When the control program of the control module of the controller for equipment control is in the running state, Acquire data of at least one scanning cycle generated during the operation of the control program through a data acquisition module, wherein the data acquisition module is arranged in the controller; The data acquired by the data acquisition module is sent based on the preset sending conditions.

[0009] A second aspect of the embodiments of the present disclosure provides a data acquisition device, including: A control module, executing a control program and generating data of at least one scanning cycle, the control module being arranged in a controller for controlling the device; A data acquisition module, used for acquiring data of at least one scanning cycle generated during the operation of the control program of the control module when the control program of the control module is in the running state, and sending the data acquired by the data acquisition module based on a preset sending condition; The data acquisition module is arranged in the controller.

[0010] A third aspect of the embodiments of the present disclosure provides an electronic device, including: processor; A memory for storing executable instructions; The processor is used to read executable instructions from the memory and execute the executable instructions to implement the data acquisition method provided in the first aspect above.

[0011] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the data acquisition method provided by the first aspect.

[0012] A fifth aspect of an embodiment of the present disclosure provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the data collection method of the first aspect described above is implemented.

[0013] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages: The data acquisition method, apparatus, equipment, medium and program product provided by the embodiments of the present disclosure can determine whether the control program of the controller used for equipment control is in a running state; when the control program is in a running state, data of at least one scanning cycle generated during the operation of the control program is acquired through a data acquisition module, and the data acquisition module is arranged in the controller; the data acquired by the data acquisition module is sent based on preset sending conditions, thereby, the data of at least one scanning cycle generated during the operation of the control program of the controller is acquired in real time through the data acquisition module arranged in the controller and sent to the outside, which can be unaffected by the industrial field network bandwidth and the maximum communication load of the controller, and the full amount or nearly full amount of data in the controller scanning cycle can be acquired without affecting the control performance of the controller. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0016] Figure 1 is a flow chart of a data collection method provided by an embodiment of the present disclosure; Figure 2 is a schematic diagram of an application scenario of a data collection method provided by an embodiment of the present disclosure; Figure 3 is a schematic diagram of an application scenario of another data collection method provided by an embodiment of the present disclosure; Figure 4 is a structural schematic diagram of a data acquisition device provided by an embodiment of the present disclosure; Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0017] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0018] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0019] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0020] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0021] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0022] Normally, controller data is collected in a round-robin manner through an existing external data collection device connected to a PLC, and is transmitted to an external third-party component through a network, industrial bus, etc., and the data is stored, processed, analyzed, and applied through the external third-party component. This will result in the inability to collect the full amount of data within the controller scanning cycle due to the influence of the on-site network bandwidth and the controller communication load. To address this problem, an embodiment of the present disclosure provides a data collection method, which is described below in conjunction with a specific embodiment.

[0023] Figure 1 is a flow chart of a data collection method provided by an embodiment of the present disclosure. The method can be executed by a data collection device. The AA device can be implemented in software and / or hardware. The collection device can be configured in an electronic device, such as a server or a terminal, wherein the terminal specifically includes a mobile phone, a computer or a tablet computer, etc. In addition, the method can be applied to Figure 2The application scenario shown includes a controller for controlling industrial field equipment. It can be understood that the data acquisition method provided in the embodiment of the present disclosure can also be applied in other scenarios.

[0024] Combine the following Figure 2-3 The application scenario shown is Figure 1 The data collection method shown is introduced, for example, Figure 2-3 The electronic device in the embodiment can execute the method. Figure 1 As shown, the data collection method provided in this embodiment includes the following steps.

[0025] S110. When a control program of a control module of a controller for controlling equipment is in operation, data of at least one scanning cycle generated during the operation of the control program is acquired through a data acquisition module, where the data acquisition module is disposed in the controller.

[0026] In an embodiment of the present disclosure, after receiving a data acquisition instruction, the electronic device obtains data of at least one scanning cycle generated during the operation of the control program through the data acquisition module when the control program of the control module of the controller used for device control is in a running state based on the data acquisition instruction.

[0027] When the control program is running, it generates data of at least one scanning cycle through cyclic execution, including intermediate process data generated by the control program running, input data required for the control program running, and output data generated by the control program running. The generated output data is used for equipment control at the industrial site to realize production automation.

[0028] The electronic equipment here includes general-purpose computers and special-purpose computers that can run control programs, and the systems they are equipped with include but are not limited to Windows, Linux, and Unix. They can also include controllers, which refer to controllers used for equipment control in industrial sites, including but not limited to: Programmable Logic Controller (PLC), Distributed Control System (DCS), and robot-specific controllers. Different controllers have different control methods and application scenarios.

[0029] The devices controlled by the controller here include but are not limited to sensors, cameras, motors, inverters, robots and other automation equipment in industrial sites. These devices are controlled by the controller and execute in an orderly manner according to predetermined programs.

[0030] In the embodiment of the present disclosure, when the control program is in operation, data of at least one scanning cycle is generated, the data is acquired through a data acquisition module, and the data is sent to a third-party component connected to the outside of the controller.

[0031] In the embodiment of the present disclosure, the data acquisition module is disposed in the controller, that is, the control programs of the data acquisition module and the control module are both disposed in the controller.

[0032] Optionally, the data acquisition module and the control module share the same processor (CPU) of the controller, or they may use independent processors respectively.

[0033] Optionally, the data acquisition module can be set in the software platform of the controller and embedded in the controller through software integration. The data acquisition module can also be embedded in the hardware device corresponding to the control program and achieve plug-and-play through hardware integration.

[0034] S120. Send the data acquired by the data acquisition module based on preset sending conditions.

[0035] In the embodiment of the present disclosure, the data acquisition module is arranged in the controller, and can timely acquire the data of at least one scanning cycle generated during the operation of the control program in the same controller, and send the data acquired by the data acquisition module based on preset sending conditions.

[0036] Optionally, the data acquisition module sends the acquired data to a third-party component outside the controller, and the third-party component is electrically connected to the controller.

[0037] Optionally, third-party components include but are not limited to data analysis components, data storage components, cloud platforms, human-computer interaction interfaces, etc.

[0038] Optionally, the data acquisition module may send data to the outside through a corresponding transmission method of the controller, or may send data to the outside using a method independent of the corresponding transmission method of the controller.

[0039] Optionally, the data acquisition module may transmit data externally in a manner including transmission via an optical cable, thereby improving the transmission efficiency of data transmission.

[0040] In the embodiment of the present disclosure, the data acquisition module provided in the controller can obtain data of at least one scanning cycle generated during the operation of the control program when the control program is in operation, and send the data to a third-party component outside the controller based on preset sending conditions. Therefore, compared with the prior art in which the data acquisition module is provided outside the controller and sends a data acquisition request to the controller in a round-robin manner, and the controller sends the requested data to the data acquisition module outside the controller through a network or other means based on the data acquisition request, the data acquisition in the embodiment of the present disclosure occurs in the controller, and the full amount of data of at least one scanning cycle generated during the execution of the controller can be obtained in time, and sent to the outside through the data acquisition module, rather than through the control module, so that the full amount of data can be obtained without being affected by the network bandwidth and the maximum communication load of the controller.

[0041] In an embodiment of the present disclosure, data of at least one scanning cycle generated during the operation of the control program includes: intermediate process data generated by the operation of the control program; or intermediate process data generated by the operation of the control program, input data required for the operation of the control program and / or output data generated by the operation of the control program.

[0042] Optionally, the data of at least one scanning cycle generated during the operation of the control program includes all data within the scanning cycle. All data here, or the full amount of data, at least includes all intermediate process data generated by the operation of the control program, or all intermediate process data generated by the operation of the control program, all input data required for the operation of the control program, and / or all output data generated by the operation of the control program.

[0043] The scan cycle refers to the time required for the controller to complete input refresh, program execution, output refresh and other operations in a cycle when the controller is in operation. It can also be understood as the operating cycle of the controller, and its unit is generally milliseconds.

[0044] Program execution means that the control program follows the rules from left to right and from top to bottom, starting from the first instruction, and executing the program one by one until the program ends. Then the next round of scanning starts, and it repeats itself over and over again.

[0045] Input data includes data required by the controller to execute the control program, including switch input data, analog input data, etc. Switch input data includes input information related to buttons, switches, sensors, etc., which are usually used to indicate the switch status of the device or the occurrence of certain events. Input data can only be obtained from external devices.

[0046] Intermediate process data refers to the internal data generated during the execution of the control program and overwritten by the data generated in the next scan cycle. That is, at the end of the previous scan cycle, the intermediate process data of the previous scan cycle will be overwritten by the intermediate process data generated in the next scan cycle.

[0047] The intermediate process data includes but is not limited to the data of the pulse signal, the variable data corresponding to the data block, the data corresponding to the calculator, the data corresponding to the timer, etc.

[0048] Output data includes the operation results output at the end of the controller scan cycle. Output data is output to the device connected to the controller through the controller's output terminals.

[0049] In the embodiment of the present disclosure, when the control program is in the running state, the data acquisition module acquires data of at least one scanning cycle generated during the running of the control program in a manner including memory sharing and data mirroring.

[0050] The memory sharing method refers to that the data acquisition module reads the data generated during the operation of the control program and writes it into the shared memory space, and the shared memory space is set in the controller.

[0051] Optionally, a shared memory space is set in the controller memory, and the shared memory space is shared by at least the control module and the modules in the controller such as the data acquisition module. Specifically, the control module can write the data generated during the operation of its corresponding control program into the shared memory space, and can also read the data written in the shared memory space. The data acquisition module can read the data written in the shared memory space by the control module.

[0052] Optionally, the data written to or read from the shared memory space includes: intermediate process data generated by the operation of the control program; or intermediate process data generated by the operation of the control program, input data required for the operation of the control program and / or output data generated by the operation of the control program.

[0053] Optionally, the data written into or read from the shared memory space includes: all data within at least one scanning cycle generated during the operation of the control program. All data here includes at least all intermediate process data generated during the operation of the control program, or all intermediate process data generated during the operation of the control program, all input data required for the operation of the control program, and / or all output data generated during the operation of the control program.

[0054] The data mirroring method refers to that the data acquisition module copies the data generated during the operation of the control program and stored in the storage unit from the storage unit of the control program, and the storage unit is set in the controller.

[0055] Optionally, the control module is provided in the controller, and the control module includes a control program, an input unit, an output unit and a storage unit. The input unit is used to obtain input information required for program operation, and obtain input information of a device connected to the controller through an input terminal. The output unit is used to send the operation result generated by program operation to the device connected to the controller. The storage unit is used to store data generated during the operation of the control program in the controller and input / output data.

[0056] When acquiring data by means of data mirroring, the data acquisition module copies the data generated during the operation of the control program and stored in the storage unit from the storage unit of the control program, and stores the data in the data acquisition module.

[0057] Optionally, the data acquisition module includes a data acquisition unit, a data storage unit, and a data sending unit. The data acquisition unit is used to acquire data generated during the operation of the control program and stored in the storage unit by copying. The data storage unit is used to store the data acquired by the data acquisition unit. The data sending unit is used to send the data stored in the data storage unit to a third-party component outside the controller.

[0058] In the disclosed embodiment, whether through memory sharing or data mirroring, the data acquisition module acquires the data generated during the operation of the control program in the control module inside the controller, and the data acquisition process is not affected by the network bandwidth and the maximum communication load of the controller, and the full amount of data generated during the operation of the control program can be quickly acquired. As a result, the speed and amount of data acquired by the data acquisition module are greatly improved, so that the full amount of data within the controller scanning cycle can be quickly acquired.

[0059] Preferably, in order to improve the comprehensiveness and integrity of data acquisition, the time period for the data acquisition module to read data from the shared memory space is less than or equal to the time period for the control program to write data to the shared memory space. Alternatively, the time period for the data acquisition module to copy data from the data storage unit of the control program is less than or equal to the time period for the control program to be generated and stored in the storage unit.

[0060] Furthermore, when the time period for the data acquisition module to read data from the shared memory space is longer than the time period for the control program to write data to the shared memory space, or the time period for the data acquisition module to copy data from the data storage unit of the control program is longer than the time period for the control program to be generated and stored in the storage unit, it is necessary to avoid data loss by increasing resources to ensure the integrity of the full data of the period.

[0061] For example, when the time period for the data acquisition module to read data from the shared memory space is greater than the time period for the control program to write data to the shared memory space, or the time period for the data acquisition module to copy data from the data storage unit of the control program is greater than the time period for the control program to generate and store data in the storage unit, the number of data acquisition modules is greater than or equal to 2, and a new full data read can be started without waiting for the previous full data read to end, thereby ensuring the integrity of the full data of the cycle. For example, the number of data acquisition modules is 2, 3, 4, etc. positive integers, which are not limited here.

[0062] In the embodiment of the present disclosure, the data acquisition module sends the acquired data to the outside based on the preset sending conditions. The sent data is data that meets the preset sending conditions to meet the data requirements of different scenarios.

[0063] The types of data transmission requirements include full data transmission, variable data transmission and subscription data transmission. Among them, full data refers to all data within the control program scanning cycle, including all intermediate process data generated by the control program operation, or all intermediate process data generated by the control program operation, all input data required for the control program operation and / or all output data generated by the control program operation. Variable data refers to data within the control program scanning cycle whose values ​​change compared with the corresponding data in the previous scanning cycle, including intermediate process data that changes during the control program scanning cycle, or intermediate process data that changes, input data required for the control program operation and / or output data generated by the control program operation. Subscription data refers to the data of the scanning cycle generated by the control program operation that meets the subscription rules. The subscription conditions include at least the name and address information of the data to be subscribed.

[0064] Optionally, when the sending condition is sending full data, the data obtained in the current scanning cycle is sent externally; when the sending condition is sending variable data, the data obtained in the current scanning cycle is compared with the data in the adjacent previous scanning cycle, and the changed data is identified and sent externally; when the sending condition is sending subscription data, based on the preset subscription conditions, the data in the data of the current scanning cycle that meets the preset subscription conditions is obtained and sent externally.

[0065] In the disclosed embodiment, the variable data sending and subscription data sending methods are adopted, which can reduce the amount of data sent and transmitted externally by thousands of times, thereby greatly improving the efficiency of third-party components in obtaining data.

[0066] In the embodiment of the present disclosure, when the variable data transmission mode is adopted, it is necessary to periodically obtain the full amount of data, and use the obtained full amount of data as the comparison basis for data comparison, so as to achieve the purpose of data verification and improve the accuracy of the data. In order to achieve the periodic acquisition of full amount of data, the time period for full amount of data acquisition is preset, and the time period can be fixed or not fixed.

[0067] Figure 4 It is a structural schematic diagram of a data acquisition device provided in an embodiment of the present disclosure.

[0068] In the embodiments of the present disclosure, the data acquisition device can be set in an electronic device and is understood as a part of the functional modules in the above electronic device. Specifically, the electronic device can be a server or a terminal, wherein the terminal specifically includes a mobile phone, a computer or a tablet computer, etc., or can be any device capable of processing the data acquisition method, such as a controller with integrated data acquisition function, which is not limited here.

[0069] like Figure 4 As shown, the data acquisition device 400 may include a control module 410 and a data acquisition module 420 .

[0070] The control module 410 executes the control program and generates data of at least one scanning cycle. The control module is set in the controller.

[0071] The data acquisition module 420 is used to obtain data of at least one scanning cycle generated during the operation of the control program of the control module when the control program of the control module is in operation, and send the data obtained by the data acquisition module based on preset sending conditions; the data acquisition module is set in the controller.

[0072] In the embodiment of the present disclosure, the data acquisition module provided in the controller can obtain data of at least one scanning cycle generated during the operation of the control program when the control program is in the running state, and send the data to a third-party component outside the controller based on the preset sending conditions. Therefore, compared with the prior art in which the data acquisition module is provided outside the controller and sends a data acquisition request to the controller in a round-robin manner, and the controller sends the requested data to the data acquisition module outside the controller through the network or other means based on the data acquisition request, the data acquisition in the embodiment of the present disclosure occurs in the controller, and all the data in at least one scanning cycle generated during the execution of the controller can be obtained in time, and sent to the outside through the data acquisition module, rather than through the control module, so that the full amount of data can be obtained without being affected by the network bandwidth and the maximum communication load of the controller.

[0073] In some embodiments of the present disclosure, the control module 410 includes a control program unit, an input unit, an output unit, and a storage unit.

[0074] The input unit is used to obtain the input information required for program operation and obtain the input information of the device connected to the controller through the input terminal. The output unit is used to send the operation results generated by the program operation to the device connected to the controller. The storage unit is used to store the data generated by the control program operation process in the controller and the input / output data.

[0075] In some embodiments of the present disclosure, the data acquisition module 420 includes a data acquisition unit, a data storage unit, and a data sending unit.

[0076] The data acquisition unit is used to acquire data generated during the operation of the control program by copying. The data storage unit is used to store data acquired by the data acquisition unit. The data sending unit is used to send the data stored in the data storage unit to a third-party component outside the controller. Specifically, the data acquisition module 420 acquires the data generated during the operation of the control program and stored in the storage unit through the data acquisition unit, then stores the acquired data through the data storage unit, and finally sends the data to a third-party component outside the controller through the data sending unit.

[0077] In some embodiments of the present disclosure, the data acquisition module 420 further includes a data comparison unit. The data comparison unit is used to compare the acquired data of the current scanning cycle with the data of the adjacent previous scanning cycle to identify the changed data. Specifically, the specific values ​​of the data of the current scanning cycle and the data of the adjacent previous scanning cycle are compared to see whether they are consistent. If the values ​​are consistent, it is considered that there is no change, and if the values ​​are inconsistent, it is considered that there is a change.

[0078] In some embodiments of the present disclosure, the data acquisition module 420 also includes a data verification unit. The data verification unit is used to periodically obtain full data when adopting the variable data sending method, and use the obtained full data as a comparison basis for data comparison, thereby achieving the purpose of data verification and improving the accuracy of the data. Specifically, the data verification unit presets a time period for full data acquisition, obtains the changed data in the previous scanning period of the time period, obtains the full data that has not been compared in the time period, and uses the full data as a comparison basis for the changed data in the next scanning period. Since the full data is used as the comparison basis again, the accuracy of the next comparison result caused by errors that may occur in the last and previous comparison processes can be avoided, thereby improving the accuracy of the changed data.

[0079] In some embodiments of the present disclosure, the data acquisition module 420 further includes a data subscription unit. The data subscription unit obtains data that meets the preset subscription conditions in the data of the current scanning period based on the preset subscription conditions and sends the data to the data sending unit. Specifically, the preset subscription conditions at least include the name and address information of the data to be subscribed.

[0080] It should be noted that Figure 4 The data acquisition device 400 shown can execute each step in the above method embodiment and realize each process and effect in the above method embodiment, which will not be described in detail here.

[0081] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure.

[0082] In the disclosed embodiment, Figure 5 The electronic device shown may be a server or a terminal, wherein the terminal specifically includes a mobile phone, a computer or a tablet computer, etc. It may also be any device capable of collecting and processing controller data, which is not limited here.

[0083] like Figure 5 As shown, the electronic device may include a processor 510 and a memory 520 storing computer program instructions.

[0084] Specifically, the processor 510 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present disclosure.

[0085] The memory 520 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 520 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 520 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 520 may be inside or outside the integrated gateway device. In a specific embodiment, the memory 520 is a non-volatile solid-state memory. In a specific embodiment, the memory 520 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM) or a flash memory, or a combination of two or more of these.

[0086] The processor 510 reads and executes the computer program instructions stored in the memory 520 to perform the steps of the data collection method provided in the embodiment of the present disclosure.

[0087] In one example, the electronic device may further include a transceiver 530 and a bus 540. Figure 5 As shown, the processor 510, the memory 520 and the transceiver 530 are connected via a bus 540 and communicate with each other.

[0088] The bus 540 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 540 may include one or more buses.

[0089] The embodiments of the present disclosure further provide a computer-readable storage medium, which may store a computer program. When the computer program is executed by a processor, the processor implements the data collection method provided by the embodiments of the present disclosure.

[0090] The above-mentioned storage medium may, for example, include a memory 520 of computer program instructions, and the above-mentioned instructions may be executed by the processor 510 of the electronic device to complete the data acquisition method provided by the embodiment of the present disclosure. Optionally, the storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (Random Access Memory, RAM), a compact disc read-only memory (Compact Disc ROM, CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0091] The embodiments of the present disclosure also provide a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the data acquisition method provided by the embodiments of the present disclosure is implemented, and the various processes and effects in the above-mentioned embodiments of the present disclosure can be implemented, which will not be elaborated here.

[0092] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data collection method, It is characterized in that include: When a control program of a control module of a controller for device control is in a running state, data of at least one scanning cycle generated during the running of the control program is acquired through a data acquisition module, wherein the data acquisition module is arranged in the controller; The data acquired by the data acquisition module is sent based on preset sending conditions.

2. The method according to claim 1, Features: The data of at least one scanning cycle generated during the operation of the control program includes: intermediate process data generated by the operation of the control program; or intermediate process data generated by the operation of the control program, input data required for the operation of the control program and / or output data generated by the operation of the control program.

3. The method according to claim 1, Features: When the control program is in the running state, the data acquisition module acquires data of at least one scanning cycle generated during the running of the control program, including: The data acquisition module reads data generated during the operation of the control program and written into the shared memory space from the shared memory space, and the shared memory space is set in the controller; Alternatively, the data acquisition module copies the data generated during the operation of the control program and stored in the storage unit from the storage unit of the control program, and the storage unit is arranged in the controller.

4. The method according to claim 3, Features: When the control program is in the running state, the data acquisition module acquires data of at least one scanning cycle generated during the running of the control program, including: The time period for the data acquisition module to read the data from the shared memory space is less than or equal to the time period for the control program to write the data to the shared memory space; Alternatively, the time period during which the data acquisition module copies the data from the data storage unit of the control program is less than or equal to the time period during which the control program is generated and stored in the storage unit.

5. The method according to claim 1, Features: The data acquisition module sends the acquired data to the outside based on the preset sending conditions, including: When the sending condition is full data sending, the data of the current scanning cycle is obtained and sent externally; Alternatively, when the sending condition is variable data sending, the data of the current scanning cycle obtained is compared with the data of the previous adjacent scanning cycle, the changed data is identified and sent externally; Alternatively, when the sending condition is to subscribe to data sending, based on the preset subscription condition, the data in the current scanning cycle that meets the preset subscription condition is obtained and sent externally, and the subscription condition at least includes the name and address information of the data to be subscribed.

6. The method according to claim 1, Features: The data acquisition module sending the acquired data based on the preset sending condition includes: The data acquisition module sends the acquired data to a third-party component connected to the controller.

7. A data acquisition device, It is characterized in that include: A control module, executing a control program and generating data of at least one scanning cycle, wherein the control module is arranged in a controller for controlling the device; A data acquisition module, used to acquire data of at least one scanning cycle generated during the operation of the control program when the control program is in operation, and to send the data acquired by the data acquisition module based on a preset sending condition; The data acquisition module is arranged in the controller.

8. An electronic device, It is characterized in that include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the data acquisition method described in any one of claims 1 to 6.

9. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the data collection method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program or instructions, It is characterized in that When the computer program or instruction is executed by a processor, the data collection method according to any one of claims 1 to 6 is implemented.