Data acquisition method and apparatus, storage medium, and program product

By simulating the operation of the PLC device's control program through a simulation control program, generating and storing intermediate simulation process data, the network limitation problem of data acquisition within the PLC device's scanning cycle is solved, enabling continuous data acquisition and improving the integrity and accuracy of data acquisition.

WO2026021046A1PCT designated stage Publication Date: 2026-01-29BEIJING XINGHANQIYUN TECHNOLOGY CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/101010
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-07-24
Filing Date
2025-06-13
Publication Date
2026-01-29

AI Technical Summary

Technical Problem

In existing technologies, the acquisition of full intermediate process data by PLC equipment within a scanning cycle is limited by network bandwidth and communication load, making it difficult to obtain continuous intermediate process data.

Method used

The simulation control program simulates the operation of the PLC device's control program, generates and stores intermediate simulation data, thus avoiding the limitations of network bandwidth and communication load.

Benefits of technology

It enables continuous acquisition of intermediate process data within the scanning cycle of the PLC device, improving the integrity and accuracy of data acquisition and supporting subsequent troubleshooting and process tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025101010_29012026_PF_FP_ABST
    Figure CN2025101010_29012026_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a data acquisition method and apparatus, a storage medium, and a program product. The data acquisition method comprises: acquiring input data corresponding to a target controller for device control (S110); running a simulation control program on the basis of the input data, and generating simulated data, wherein the simulation control program is configured to simulate the running process of a control program in the target controller, and the simulated data comprises simulated intermediate process data generated by the simulation control program performing a logical operation, or the simulated intermediate process data and simulated output data (S120); and acquiring and storing the simulated data (S130). Therefore, the input data of the target controller can be used as input data of the simulation control program, the running process of the control program in the target controller is simulated by means of the simulation control program to obtain the simulated data, and the simulated data is stored, so that continuous intermediate process data of the target controller within one scanning period, or the intermediate process data and output data are acquired by means of simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Data acquisition method and device, storage medium and program product

[0001] Cross-reference to related applications

[0002] The present application claims priority from the Chinese patent application No. 202411000759X entitled "Data acquisition method and device, electronic device, storage medium and program product" filed on July 24, 2024 with the China Patent Office, the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0003] The present application relates to the technical field of computers, and in particular to a data acquisition method and device, a storage medium and a program product. BACKGROUND

[0004] With the wide application of programmable logic controllers (PLC), the data in the running process of the PLC device is of great significance for subsequent troubleshooting and process tracking, and therefore the collection and storage of the data in the running process of the PLC device has become one of the technical problems to be solved. At present, the collection of the data in the running process of the PLC device is mainly achieved by sending a data acquisition request to the PLC device through network communication, receiving the data returned by the PLC device according to the data acquisition request, and then collecting the data.

[0005] However, the amount of data generated by the PLC device in each scanning cycle is generally in the order of millions or even tens of millions, and therefore the related collection method is limited by the network bandwidth, and cannot collect all the intermediate process data of the PLC device in a scanning cycle, but only can collect some discrete and discontinuous intermediate process data. Even if the network bandwidth is increased, due to the influence of the PLC communication load, it is also difficult to collect all the data of the PLC device in a scanning cycle, and therefore how to collect the continuous intermediate process data of the PLC device in a scanning cycle is a technical problem to be solved.

[0006] SUMMARY

[0007] The present application provides a data acquisition method and device, a storage medium and a program product.

[0008] The first aspect of the present application provides a data acquisition method, comprising:

[0009] acquiring input data corresponding to a target controller for device control;

[0010] running the simulation control program based on the input data, the simulation control program being configured to simulate a running process of the control program in the target controller, and generating simulation data, the simulation data comprising simulation intermediate process data generated by the simulation control program performing logical operation, or the simulation intermediate process data and simulation output data;

[0011] obtaining the simulation data and storing the simulation data.

[0012] A second aspect of the embodiment of the present application provides a data obtaining apparatus, comprising:

[0013] a data obtaining module configured to obtain input data corresponding to a target controller for device control;

[0014] a program running module configured to run a simulation control program based on the input data, the simulation control program being configured to simulate a running process of the control program in the target controller, and generate simulation data, the simulation data comprising simulation intermediate process data generated by the simulation control program performing logical operation, or the simulation intermediate process data and simulation output data;

[0015] a data processing module configured to obtain the simulation data and store the simulation data.

[0016] A third aspect of the embodiment of the present application provides a data obtaining apparatus, comprising:

[0017] a processor;

[0018] a memory configured to store executable instructions;

[0019] The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the data obtaining method provided in the first aspect.

[0020] A fourth aspect of the embodiment of the present application provides a computer readable storage medium, the storage medium storing a computer program, when the computer program is executed by a processor, the processor implements the data obtaining method provided in the first aspect.

[0021] A fifth aspect of the embodiment of the present application provides a computer program product, the computer program product comprising a computer program or instructions, when the computer program or instructions are executed by a processor, the data obtaining method in the first aspect is implemented. BRIEF DESCRIPTION OF DRAWINGS

[0022] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the embodiments or the related art description. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

[0024] Fig. 1 is a flow chart of a data acquisition method according to an embodiment of the present application;

[0025] Fig. 2 is a flow chart of a data storage method according to an embodiment of the present application;

[0026] Fig. 3 is a schematic structural diagram of a data acquisition device according to an embodiment of the present application;

[0027] Fig. 4 is another schematic structural diagram of a data acquisition device according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the embodiments or the related art description. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

[0029] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, but the present application can also be implemented in other ways different from those described herein; obviously, the embodiments described in the specification are only some of the embodiments of the present application, not all the embodiments.

[0030] It should be understood that each of the steps recorded in the method embodiments of the present application can be executed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present application is not limited in this respect.

[0031] It should be noted that, in this document, relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the phrase "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0032] It should be noted that the modification of "one", "multiple" mentioned in the present application is illustrative but not restrictive, and those skilled in the art should understand that unless otherwise explicitly indicated in the context, it should be understood as "one or more".

[0033] Generally, the existing collection method is limited by network bandwidth, and cannot collect all intermediate process data of PLC in a scan cycle, and can only obtain discrete and discontinuous partial intermediate process data. Even if the network bandwidth is increased, it is difficult to obtain all data of PLC in a scan cycle. In view of the problem, the embodiment of the present application provides a data acquisition method, which will be introduced below in combination with specific embodiments.

[0034] Fig. 1 is a flowchart of a data acquisition method provided by an embodiment of the present application. The method can be executed by a data acquisition device, which can be realized in software and / or hardware, and can be configured in an electronic device, such as a server or a terminal. The terminal specifically includes a computer or a tablet computer, etc.

[0035] As shown in Fig. 1, the data acquisition method provided by the embodiment includes the following steps.

[0036] S110, acquiring input data corresponding to a target controller for device control.

[0037] In the embodiment of the present application, the electronic device acquires input data corresponding to a target controller for device control after responding to a target operation of a user or receiving a data acquisition instruction.

[0038] In the embodiment of the present application, the target operation can be a click operation or a start operation performed by the user for data acquisition.

[0039] The data acquisition instruction can be understood as an instruction sent by the user to acquire data.

[0040] In the embodiment of the present application, the target controller can be any controller that can be configured for device control, such as a programmable logic controller (PLC) or a distributed controller (DCS).

[0041] In the embodiments of the present application, the input data can be understood as input parameters required for the target controller to control the configuration device connected to the target controller, such as state parameters of the configuration device or current running parameters of the configuration device, etc. The configuration device can be understood as a device connected to the target controller and controlled by the target controller, including but not limited to sensors, cameras, motors, frequency converters or robots in an industrial field, etc. These devices are controlled by the controller and executed in order according to a predetermined program.

[0042] The input data can include on-off input data or analog input data, etc. The on-off input data includes input signals related to buttons, switches or sensors, etc., and is usually used to indicate the on-off state of the device or the occurrence of some events.

[0043] In some embodiments of the present application, the electronic device can send an input data acquisition request to the target controller in a polling manner through network connection with the target controller, and then receive input data returned by the target controller in response to the input data acquisition request, and then acquire the input data.

[0044] In some embodiments of the present application, the electronic device can acquire the input data corresponding to the target controller through network listening.

[0045] In some embodiments of the present application, the electronic device can collect input data in the target controller based on a preset collection manner after responding to a target operation of a user or receiving a data acquisition instruction, and then acquire the input data.

[0046] S120, running the simulation control program based on the input data and generating simulation data, the simulation control program being configured to simulate the running process of the control program in the target controller, the simulation data including simulation intermediate process data generated by the simulation control program performing logical operation, or the simulation intermediate process data and simulation output data.

[0047] In the embodiments of the present application, the electronic device runs the simulation control program based on the input data and generates simulation data after acquiring the input data corresponding to the target controller.

[0048] The simulation control program is a control program configured to simulate the running process of the control program in the target controller. The simulation control program can be a program having the same or approximately the same logical operation function as the target controller.

[0049] The running data generated by the running process of the control program in the target controller is configured as device control. The running data includes running intermediate process data, or the running intermediate process data and running output data.

[0050] The simulation control program obtains simulation data that is the same as or approximately the same as the operating data of the target controller by simulating the operation process of the control program in the target controller.

[0051] Simulated data is configured into statistical analysis of industrial big data to determine the root cause of on-site equipment failures or to optimize on-site equipment.

[0052] Simulation data includes intermediate simulation data generated during the simulation control program's scan cycle, or a combination of intermediate simulation data and simulation output data. The simulation data is identical or nearly identical to the operational data generated by the control program in the target controller.

[0053] Optionally, the simulation data includes all intermediate simulation data generated during the simulation control program's scan cycle, or all intermediate simulation data and all simulation output data.

[0054] The scan cycle refers to the time required for the controller to complete one loop of operations, including input refresh, program execution, and output refresh, during operation. It can be understood as the controller's operating cycle, typically measured in milliseconds.

[0055] Program execution refers to the controller program executing the user's program sequentially, from left to right and from top to bottom, starting with the first instruction, until the program terminates. Then, the next scan begins, and this process repeats continuously.

[0056] Intermediate process data refers to internal data generated during the execution of the control program and overwritten by 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. The intermediate process data includes simulation intermediate process data generated during the execution of the simulation control program and / or runtime intermediate process data generated by the control program in the target controller during its operation.

[0057] Intermediate process data includes, but is not limited to, pulse signal data, variable data corresponding to data blocks, data corresponding to calculators, or data corresponding to timers.

[0058] The output data includes the calculation results output by the target controller at the end of a scan cycle, and / or the calculation results output by the simulation control program at the end of a scan cycle. Specifically, the output data can be output to the device connected to the controller via the controller's output terminals. The output data includes analog output data from the running simulation control program and / or running output data from the control program in the target controller.

[0059] Optionally, the analog control program can run on a hardware redundant controller (such as a redundant PLC device or a redundant DCS device), or on a data acquisition module integrated in the hardware controller, or on any electronic device capable of running an analog control program; there are no restrictions on this.

[0060] Specifically, after acquiring input data, the electronic device inputs the input data into the analog control program to control the operation of the analog control program, thereby generating analog data. The analog data may include intermediate process data generated by the analog control program during logical operations, and may also include analog output data generated after the logical operations are performed.

[0061] S130. Acquire simulation data and store the simulation data.

[0062] In this embodiment of the application, after the electronic device controls the simulation control program to run and generates simulation data, it acquires the simulation data and stores the simulation data.

[0063] In this embodiment, input data corresponding to the target controller for device control can be obtained, a simulation control program can be run based on the input data, and simulation data can be generated. The simulation control program is configured to simulate the operation process of the control program in the target controller. The simulation data includes simulation intermediate process data generated by the simulation control program performing logical operations, or simulation intermediate process data and simulation output data. The simulation data is obtained and stored. Thus, the input data of the target controller can be used as the input data of the simulation control program. The simulation control program simulates the operation process of the control program in the target controller to obtain simulation data and stores it. In this way, the continuous intermediate process data of the target controller within a scan cycle, or intermediate process data and output data, can be obtained through simulation, without being affected by network bandwidth and controller communication load.

[0064] In this embodiment of the application, obtaining the input data corresponding to the target controller for device control may specifically include: obtaining the project file corresponding to the target controller; extracting the configuration device information from the project file; and obtaining the input data corresponding to the target controller based on the configuration device information.

[0065] In the embodiments of this application, the engineering file corresponding to the target controller can be understood as a file created and used during the development of the target controller, which contains all the information required to achieve a specific automated control task. For example, when the target controller is a target programmable logic controller, the engineering file includes a configuration file configured to describe the hardware configuration, communication configuration, parameter configuration, etc. of the target programmable logic controller, or a program file configured to describe the control logic of the target programmable logic controller.

[0066] Optionally, the original project file can be in XML, JSON, or other formats. The original project file includes information such as the configuration device information or the spatial addresses of the input and / or output data corresponding to the target controller.

[0067] Specifically, electronic devices can export project files from the target controller by calling a dedicated export tool, thereby obtaining the project files corresponding to the target controller.

[0068] In this embodiment of the application, the configuration device information may include the name and MAC address of the configuration device.

[0069] Specifically, after obtaining the engineering file corresponding to the target controller, the electronic device parses the engineering file and extracts the configuration device information from the engineering file. Based on the configuration device information, it obtains the input data corresponding to the target controller from the configuration device through a preset network communication protocol.

[0070] In this embodiment of the application, configuration device information can be extracted from the engineering file, thereby obtaining the input data corresponding to the target controller, which improves the accuracy of input data acquisition.

[0071] In this embodiment of the application, before running the simulation control program based on the input data, the data acquisition method may further include: synchronizing the clock corresponding to the preset operating environment of the simulation control program so that the clock corresponding to the simulation control program is synchronized with the clock corresponding to the control program of the target controller.

[0072] In the embodiments of this application, the specific implementation of clock synchronization processing is similar to the existing implementation of clock synchronization processing, and will not be described in detail here.

[0073] Therefore, the simulation control program can run when the clock corresponding to the simulation control program is synchronized with the clock corresponding to the control program of the target controller, which improves the accuracy of the calculation results of the simulation control program and facilitates the verification and use of the generated simulation data.

[0074] In this embodiment of the application, the storage types of the simulation data include full storage and variable storage.

[0075] Full storage can be understood as storing all the acquired simulation data; variable storage can be understood as storing the data that has changed compared to the simulation data in adjacent scan cycles (such as the previous scan cycle or several scan cycles).

[0076] As shown in Figure 2, this application embodiment provides a flowchart of a data storage method. Specifically, storing simulated data may include the following steps:

[0077] S210. Determine whether the scan cycle corresponding to the simulation data is the first scan cycle.

[0078] In this embodiment, the scan period can be understood as the time corresponding to a series of processes from inputting the target controller's input data and performing logical operations to generating analog output data.

[0079] In this embodiment of the application, when the scanning period corresponding to the analog data is the first scanning period, the electronic device executes step S220; when the scanning period corresponding to the analog data is not the first scanning period, it executes steps S230-S250.

[0080] S220. Determine that the storage type of the simulation data is full storage, and perform full storage of the simulation data.

[0081] In this embodiment of the application, when the electronic device determines that the scanning cycle corresponding to the simulated data is the first scanning cycle, it means that the value of the variable corresponding to the simulated data has not been stored before. At this time, the storage type of the simulated data is determined to be full storage, and then all the simulated data is stored.

[0082] In this embodiment, the location for storing the simulation data may include, but is not limited to, memory cache or disk, and the storage method may include, but is not limited to, ordinary file storage or database storage. Specifically, database storage may be performed in a server database, a cloud database, or a local database, and no limitation is imposed here.

[0083] S230. Determine the time interval between the last time a full data storage was performed and the current time corresponding to the current data storage.

[0084] In this embodiment of the application, when the electronic device determines that the scanning cycle corresponding to the simulated data is not the first scanning cycle, it obtains the time corresponding to the last full data storage, calculates the time interval between the time corresponding to the last full data storage and the current time corresponding to the current data storage, and compares the time interval with the preset time interval.

[0085] For example, when the preset time interval is 5 seconds, the time corresponding to the last full data storage is 5 seconds, and the current time corresponding to the current data storage is 7 seconds. At this time, the time interval between the time corresponding to the last full data storage and the current time corresponding to the current data storage is 2 seconds. Since 2 seconds is less than the preset time interval of 5 seconds, variable storage is performed. If the current time corresponding to the current data storage is 11 seconds, then the time interval between the time corresponding to the last full data storage and the current time corresponding to the current data storage is 6 seconds. Since 6 seconds is greater than the preset time interval of 5 seconds, full storage is performed.

[0086] If the time interval is greater than or equal to the preset time interval, proceed to step S240; otherwise, proceed to step S250.

[0087] S240. When the time interval is greater than or equal to the preset time interval, determine that the storage type of the simulation data is full storage and perform full storage of the simulation data.

[0088] In this embodiment of the application, when the electronic device determines that the time interval is greater than or equal to a preset time interval based on the comparison result, it determines that the storage type of the simulated data is full storage and performs full storage on the simulated data. Thus, by performing full storage on the simulated data periodically, the accuracy and integrity of the data can be ensured.

[0089] S250. When the time interval is less than the preset time interval, determine that the storage type of the simulation data is variable storage, identify the target simulation data in the simulation data that has changed compared to the simulation data corresponding to the previous scan cycle, and store the changed target simulation data.

[0090] In this embodiment of the application, when the electronic device determines that the time interval is less than a preset time interval based on the comparison result, it determines that the storage type of the simulation data is variable storage, and then determines the target simulation data that has changed from the simulation data corresponding to the previous scan cycle. The changed target simulation data is stored. Thus, the simulation data can be stored by means of variable storage, saving transmission bandwidth and storage space.

[0091] In the embodiments of this application, the storage type of the simulated data can be determined, and different storage methods can be adopted according to different storage types. Thus, while ensuring the accuracy and integrity of the data, transmission bandwidth and storage space are saved.

[0092] In this embodiment of the application, before storing the simulation data, the data acquisition method may further include: acquiring the running data corresponding to the target controller, the running data including intermediate process data; determining at least one variable name and the value corresponding to each variable corresponding to the running data; and verifying the simulation data based on at least one variable name and the value corresponding to each variable.

[0093] In this embodiment, the specific implementation method for the electronic device to obtain the operating data corresponding to the target controller is similar to the specific implementation method for obtaining the input data corresponding to the target controller described above, and will not be repeated here.

[0094] In some embodiments of this application, the running data may include intermediate process data, and the running data may also include intermediate process data and running output data. The intermediate process data can be understood as the data generated by the target controller during the execution of the computational logic corresponding to the control program. However, due to factors such as network conditions, the intermediate process data of the target controller obtained here is only a portion of the process data generated by the target controller during operation; it can also be understood that the amount of intermediate process data is less than the intermediate process data generated in the obtained simulation control program.

[0095] After acquiring the operating data corresponding to the target controller, the electronic device can compare the values ​​of the variables with the same variable names in the intermediate process data of the operating data with the values ​​of the variables with the same variable names in the intermediate process data of the simulation data. If all the values ​​of the same variable names in the intermediate process data of the operating data and the intermediate process data of the simulation data are consistent, the verification result of the simulation data is determined to be passed; otherwise, it is not.

[0096] In other embodiments of this application, the runtime data may further include intermediate runtime data and runtime output data. Runtime output data can be understood as the output data generated by the target controller after executing its computational logic, configured to control the configured device.

[0097] When the simulation data includes intermediate process data and simulation output data, the electronic device can, after acquiring the operation data corresponding to the target controller, compare the variable values ​​corresponding to the same variable name in the intermediate process data included in the operation data with the variable values ​​corresponding to the same variable name in the simulation intermediate process data included in the simulation data to obtain a first result. At the same time, it can compare the output data included in the operation data with the output data corresponding to the same variable name in the simulation output data included in the simulation data to obtain a second result. If there are variables with inconsistent values ​​in the first result and the second result, the verification is determined to fail; otherwise, the verification is reversed.

[0098] Optionally, the simulated data can be stored if the verification result is satisfactory.

[0099] If the verification result is unsuccessful, the system continues to acquire the operating data of the target controller and the simulation data of the simulation control program for the next scan cycle, and compares them to determine whether the simulation data has passed the verification. If the verification result for the next scan cycle or multiple subsequent scan cycles is unsuccessful, the simulation data is determined to be unsuccessful and incorrect. In this case, the operating data of the target controller is stored, or the operating data of the target controller and the simulation data are stored together, so as to facilitate subsequent error analysis or correction of the simulation control program. If the verification result for the next scan cycle or multiple subsequent scan cycles is successful, the simulation data is determined to be successful and correct. In this case, the simulation data is stored.

[0100] In this embodiment of the application, the simulation data can be verified by collecting intermediate process data and / or output data during the operation of the target controller, thereby ensuring the accuracy and validity of the stored simulation data.

[0101] In some embodiments of this application, before storing the simulation data, the data acquisition method may further include: acquiring the running output data corresponding to the target controller.

[0102] Optionally, storing the simulation data may include storing the input data, simulation data, and runtime output data.

[0103] In other embodiments of this application, before storing the simulation data, the data acquisition method may further include: acquiring the intermediate process data and output data of the target controller.

[0104] Optionally, storing the simulation data may include storing input data, simulation data, intermediate process data, and output data.

[0105] In this embodiment, the electronic device can store input data, simulation data, intermediate process data, and output data in different database tables, or it can store them in the same database table. The database table includes information such as the data's name, value, timestamp, or attributes.

[0106] In this embodiment, by acquiring the simulation data generated by the simulation control program and the data corresponding to the target controller (including input data, or input data and running data), i.e., by adopting the "simulation calculation + acquisition" method, continuous intermediate process data of the target controller within at least one scan cycle can be obtained. This allows for the acquisition of all or nearly all the data of the target controller within one scan cycle, thereby providing more comprehensive and accurate data support for subsequent fault diagnosis, process tracking and big data analysis.

[0107] Figure 3 is one of the structural schematic diagrams of a data acquisition device provided in an embodiment of this application.

[0108] In this embodiment, the data acquisition device can be housed within an electronic device and is understood as a functional module within the aforementioned electronic device. Specifically, the electronic device can be a server or a terminal, wherein the terminal specifically includes a computer or tablet computer, or any device capable of processing the data acquisition method, without limitation herein.

[0109] As shown in Figure 3, the data acquisition device 300 may include a data acquisition module 310, a program execution module 320, and a data processing module 330.

[0110] The data acquisition module 310 can be configured to acquire input data corresponding to the target controller used for device control.

[0111] The program execution module 320 can be configured to run a simulation control program based on input data and generate simulation data. The simulation control program is configured to simulate the operation process of the control program in the target controller. The simulation data includes simulation intermediate process data generated by the simulation control program performing logical operations, or simulation intermediate process data and simulation output data.

[0112] The data processing module 330 can be configured to acquire and store simulation data.

[0113] In this embodiment, input data corresponding to the target controller for device control can be obtained, a simulation control program can be run based on the input data, and simulation data can be generated. The simulation control program is configured to simulate the operation process of the control program in the target controller. The simulation data includes simulation intermediate process data generated by the simulation control program performing logical operations, or simulation intermediate process data and simulation output data. The simulation data is obtained and stored. Thus, the input data of the target controller can be used as the input data of the simulation control program. The simulation control program simulates the operation process of the control program in the target controller to obtain simulation data and stores it. In this way, the continuous intermediate process data of the target controller within a scan cycle, or intermediate process data and output data, can be obtained through simulation, without being affected by network bandwidth and controller communication load.

[0114] In some embodiments of this application, the data acquisition module 310 may be specifically configured to acquire the project file corresponding to the target controller; extract the configuration device information in the project file; and acquire the input data corresponding to the target controller based on the configuration device information.

[0115] In some embodiments of this application, the data acquisition device 300 may further include a clock synchronization module.

[0116] The clock synchronization module can be configured to synchronize the clock corresponding to the preset operating environment of the simulation control program before running the simulation control program based on the input data, so that the clock corresponding to the simulation control program is synchronized with the clock corresponding to the control program of the target controller.

[0117] In some embodiments of this application, the storage types of simulation data include full storage and variable storage.

[0118] The data processing module 330 can be specifically configured to determine the storage type of the simulation data as full storage when the scan cycle corresponding to the simulation data is the first scan cycle, and to perform full storage of the simulation data.

[0119] In some embodiments of this application, the data processing module 330 may be further configured to: when the scan period corresponding to the simulated data is not the first scan period, determine the time interval between the time corresponding to the last full data storage and the current time corresponding to the current data storage; when the time interval is greater than or equal to a preset time interval, determine that the storage type of the simulated data is full storage and perform full storage of the simulated data; when the time interval is less than the preset time interval, determine that the storage type of the simulated data is variable storage, identify the target simulated data in the simulated data that has changed compared to the simulated data corresponding to the previous scan period, and store the changed target simulated data.

[0120] In some embodiments of this application, the data acquisition device 300 may further include a data verification module.

[0121] The data verification module can be configured to acquire the running data corresponding to the target controller before storing the simulation data. The running data includes intermediate process data. It can also determine at least one variable name and the value of each variable corresponding to the running data. Finally, it can verify the simulation data based on at least one variable name and the value of each variable.

[0122] The data processing module 330 can be specifically configured to store the simulated data when the verification result is passed.

[0123] In some embodiments of this application, the data acquisition device 300 may further include an output data acquisition module.

[0124] The output data acquisition module can be configured to acquire the operating output data of the target controller before storing the simulation data.

[0125] The data processing module 330 can also be specifically configured to store input data, simulation data, and runtime output data.

[0126] It should be noted that the data acquisition device 300 shown in Figure 3 can execute each step in the above method embodiments and realize each process and effect in the above method embodiments, which will not be elaborated here.

[0127] Figure 4 is a second schematic diagram of the structure of a data acquisition device provided in an embodiment of this application.

[0128] In this embodiment of the application, the data acquisition device shown in FIG4 can be an electronic device, such as a server or terminal. Specifically, the terminal includes a computer or tablet computer, or any device capable of processing the data acquisition method, without limitation.

[0129] As shown in Figure 4, the electronic device may include a processor 410 and a memory 420 storing computer program instructions.

[0130] Specifically, the processor 410 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0131] Memory 420 may include a large-capacity memory configured to provide information or instructions. For example, and not limitingly, memory 420 may include a hard disk drive (HDD), a floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 420 may include removable or non-removable (or fixed) media. Where appropriate, memory 420 may be internal or external to the integrated gateway device. In a particular embodiment, memory 420 is a non-volatile solid-state memory. In a particular embodiment, memory 420 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (Electrically Programmable ROM, EPROM), an electrically erasable programmable ROM (EEPROM), an electrically alterable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0132] The processor 410 reads and executes computer program instructions stored in the memory 420 to perform the steps of the data acquisition method provided in the embodiments of this application.

[0133] In one example, the electronic device may also include a transceiver 430 and a bus 440. As shown in Figure 4, the processor 410, memory 420, and transceiver 430 are connected via the bus 440 and communicate with each other.

[0134] Bus 440 may include hardware, software, or both. For example, and not limitingly, 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 Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel 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, bus 440 may include one or more buses.

[0135] This application also provides a computer-readable storage medium that can store a computer program. When the computer program is executed by a processor, the processor implements the data acquisition method provided in this application.

[0136] The aforementioned storage medium may include, for example, a memory 420 containing computer program instructions, which can be executed by a processor 410 of an electronic device to complete the data acquisition method provided in this application embodiment. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), compact disc-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device.

[0137] This application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, they implement the data acquisition method provided in this application and can achieve the various processes and effects in the above embodiments of this application, which will not be elaborated here.

[0138] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein. Industrial applicability

[0139] The data acquisition method, apparatus, storage medium, and program product of this application can use the input data of the target controller as the input data of the simulation control program, simulate the operation process of the control program in the target controller through the simulation control program to obtain simulation data and store it, and then obtain the continuous intermediate process data of the target controller within a scan cycle, or the intermediate process data and output data, through simulation, without being affected by network bandwidth and communication load.

Claims

1. A data acquisition method, characterized by, The method comprises the following steps: acquiring input data corresponding to a target controller for device control; running a simulation control program based on the input data, and generating simulation data, wherein the simulation control program is configured to simulate the running process of a control program in the target controller, and the simulation data comprises simulation intermediate process data generated by logical operation of the simulation control program, or the simulation intermediate process data and simulation output data; acquiring the simulation data and storing the simulation data.

2. The method of claim 1, wherein, The step of acquiring input data corresponding to a target controller for device control comprises the following steps: acquiring an engineering file corresponding to the target controller; extracting configuration device information in the engineering file, and acquiring input data corresponding to the target controller based on the configuration device information.

3. The method of claim 1, wherein, Before the step of running a simulation control program based on the input data, the method further comprises the following steps: synchronizing a clock corresponding to a preset running environment of the simulation control program, so that the clock corresponding to the simulation control program is synchronized with a clock corresponding to a control program of the target controller.

4. The method of claim 1, wherein, The storage type of the simulation data comprises full-amount storage and variable storage. The step of storing the simulation data comprises the following steps: when a scanning period corresponding to the simulation data is a first scanning period, determining that the storage type of the simulation data is full-amount storage, and storing the simulation data in full amount.

5. The method of claim 4, wherein, When a scanning period corresponding to the simulation data is a non-first scanning period, the step of storing the simulation data comprises the following steps: determining a time interval between a time point corresponding to last data full-amount storage and a current time point corresponding to current data storage; when the time interval is greater than or equal to a preset time interval, determining that the storage type of the simulation data is full-amount storage, and storing the simulation data in full amount; when the time interval is less than the preset time interval, determining that the storage type of the simulation data is variable storage, determining target simulation data in the simulation data which changes compared with simulation data corresponding to a last scanning period, and storing the target simulation data which changes.

6. The method of claim 1, wherein, Before the step of storing the simulation data, the method further comprises the following steps: acquiring running data corresponding to the target controller, wherein the running data comprises running intermediate process data; determining at least one variable name corresponding to the running data and a numerical value corresponding to each variable; verifying the simulation data based on the at least one variable name and the numerical value corresponding to each variable; The step of storing the simulation data comprises the following steps: when the verification result is passed, storing the simulation data.

7. The method according to claim 1 or 6, characterized in that, Before the step of storing the simulation data, the method further comprises the following steps: acquiring running output data corresponding to the target controller; The step of storing the simulation data comprises the following steps: storing the input data, the simulation data and the running output data.

8. A data acquisition device, characterized by The method comprises the following steps: a data acquisition module configured to acquire input data corresponding to a target controller for device control; a program running module, configured to run a simulation control program based on the input data, and generate simulation data, the simulation control program being configured to simulate a running process of a control program in the target controller, the simulation data comprising simulation intermediate process data generated by the simulation control program performing logical operation, or the simulation intermediate process data and simulation output data; a data processing module, configured to acquire the simulation data, and store the simulation data.

9. A data acquisition device, characterized by comprise: a processor; a memory, configured to store executable instructions; wherein the processor is configured to read the executable instructions from the memory, and execute the executable instructions to implement the data acquisition method in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, causes the processor to implement the data acquisition method in any one of claims 1-7.

11. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions, when executed by a processor, implement the data acquisition method in any one of claims 1-7.

Citation Information

Patent Citations

  • Equipment operation process reproduction method and system

    CN113031574A

  • Fault scene simulation method and device, electronic equipment and storage medium

    CN114048053A

  • Browser testing method and device, electronic equipment and storage medium

    CN115344472A

  • Analog output data acquisition method and device, electronic equipment and storage medium

    CN117806895A

  • Prefabricated part production management and control method and system, computer and storage medium

    CN117993698A