Data acquisition method and device, electronic equipment, storage medium and program product
Through the simulation control program, simulate the control program of the PLC device, generate simulated data and store it, solving the problem of obtaining full data in the data acquisition of PLC device, realizing the acquisition of continuous intermediate process data, and improving the integrity and accuracy of data acquisition sex.
Patent Information
- Application Number
- CN202411000759.X
- 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
The prior art cannot effectively collect the full amount of intermediate process data of PLC equipment in one scanning cycle. Due to the limitations of network bandwidth and communication load, only discrete and discontinuous part of the data can be obtained.
By running the simulation control program, simulate the control program of the target controller, generate simulation data, and store it, thereby obtaining continuous intermediate process data of the PLC device in one scan cycle, avoiding the limitation of network bandwidth and communication load.
It realizes the acquisition of continuous intermediate process data of PLC equipment in one scan cycle, improves the integrity and accuracy of data acquisition, and supports subsequent troubleshooting and big data analysis.
Smart Images

Figure CN118938797A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data acquisition method, device, electronic device, storage medium and program product. Background Art
[0002] With the widespread application of programmable logic controllers (PLCs), the data collected during the operation of PLC devices is of great significance for subsequent troubleshooting, process tracking, etc. Therefore, the collection and storage of data during the operation of PLC devices has become one of the technical problems that need to be solved urgently. At present, the collection of data during the operation of PLC devices is mainly carried out by sending data acquisition requests to PLC devices through network communication, receiving data returned by PLC devices according to the data acquisition requests, and then realizing data collection.
[0003] However, the amount of data generated by PLC devices in each scanning cycle is generally in the millions or even tens of millions. Therefore, the existing acquisition method is limited by the network bandwidth and cannot acquire the full amount of intermediate process data of the PLC device in one scanning cycle. Only discrete and discontinuous partial intermediate process data can be acquired. Even if the network bandwidth is increased, it is difficult to acquire the full amount of data of the PLC device in one scanning cycle due to the influence of the PLC communication load. Therefore, how to acquire the continuous intermediate process data of the PLC device in one scanning cycle is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a data acquisition method, device, electronic device, storage medium and program product.
[0005] A first aspect of an embodiment of the present disclosure provides a data acquisition method, including:
[0006] Obtain input data corresponding to the target controller for device control;
[0007] Running a simulation control program based on input data and generating simulation data, the simulation control program is used to simulate the running process of the control program in the target controller, and the simulation data includes simulation intermediate process data generated by the simulation control program performing logic operations, or simulation intermediate process data and simulation output data;
[0008] Get the simulation data and store it.
[0009] A second aspect of an embodiment of the present disclosure provides a data acquisition device, including:
[0010] A data acquisition module, used to acquire input data corresponding to a target controller for device control;
[0011] A program running module, used to run a simulation control program based on input data and generate simulation data, the simulation control program is used to simulate the running process of the control program in the target controller, and 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;
[0012] The data processing module is used to obtain simulation data and store the simulation data.
[0013] A third aspect of the embodiments of the present disclosure provides an electronic device, including:
[0014] processor;
[0015] A memory for storing executable instructions;
[0016] 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.
[0017] 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.
[0018] 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 acquisition method of the first aspect is implemented.
[0019] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0020] The data acquisition method, device, electronic device, storage medium and program product provided by the embodiments of the present disclosure can acquire input data corresponding to a target controller for device control, run a simulation control program based on the input data, and generate simulation data. The simulation control program is used to simulate the running process of the control program in the target controller. The simulation data includes simulated intermediate process data generated by logical operations of the simulation control program, or simulated intermediate process data and simulated output data. The simulation data is acquired and stored. Thus, the input data of the target controller can be used as the input data of the simulation control program. The running process of the control program in the target controller is simulated by the simulation control program to obtain the simulation data and store it. Then, the continuous intermediate process data of the target controller within a scanning cycle, or the intermediate process data and output data, can be acquired by simulation, and will not be affected by network bandwidth and communication load. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] 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.
[0022] 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.
[0023] Figure 1 is a flow chart of a data acquisition method provided by an embodiment of the present disclosure;
[0024] Figure 2 is a flow chart of a data storage method provided by an embodiment of the present disclosure;
[0025] Figure 3 is a structural schematic diagram of a data acquisition device provided by an embodiment of the present disclosure;
[0026] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] 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.
[0028] 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.
[0029] 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.
[0030] 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.
[0031] 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".
[0032] Generally, the existing acquisition method is limited by the network bandwidth and cannot acquire the full amount of intermediate process data of the PLC in one scanning cycle. It can only acquire discrete and discontinuous part of the intermediate process data. Even if the network bandwidth is increased, it is still difficult to acquire the full amount of data of the PLC in one scanning cycle. To address this problem, the embodiments of the present disclosure provide a data acquisition method, which is described below in conjunction with specific embodiments.
[0033] Figure 1 It is a flow chart of a data acquisition method provided by an embodiment of the present disclosure. The method can be executed by a data acquisition device. The data acquisition device can be implemented in software and / or hardware. The data acquisition device can be configured in an electronic device, such as a server or a terminal, wherein the terminal specifically includes a computer or a tablet computer, etc.
[0034] like Figure 1 As shown, the data acquisition method provided in this embodiment includes the following steps.
[0035] S110, obtaining input data corresponding to a target controller for device control.
[0036] In an embodiment of the present disclosure, the electronic device acquires input data corresponding to a target controller for device control in response to a target operation of a user or after receiving a data acquisition instruction.
[0037] In the embodiment of the present disclosure, the target operation may be a click operation, a start operation, etc. performed by the user for data acquisition.
[0038] The data acquisition instruction can be understood as an instruction sent by a user to acquire data.
[0039] In the embodiments of the present disclosure, the target controller may be any controller that can be used for device control, such as a programmable logic controller (PLC), a distributed control system (DCS), and the like.
[0040] In the embodiments of the present disclosure, 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 the state parameters of the configuration device, the current operating parameters of the configuration device, etc. Among them, 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, inverters, robots and other automation equipment in industrial sites, which are controlled by the controller and executed in an orderly manner according to a predetermined program.
[0041] Input data may include switch input data, analog input data, etc. Switch input data includes input signals related to buttons, switches, sensors, etc., which are usually used to indicate the switch state of the device or the occurrence of certain events.
[0042] In some embodiments of the present disclosure, the electronic device may connect to the target controller through a network and send an input data acquisition request to the target controller in a polling manner, and then receive input data returned by the target controller in response to the input data acquisition request, thereby acquiring the input data.
[0043] In some other embodiments of the present disclosure, the electronic device may obtain input data corresponding to the target controller by means of network monitoring.
[0044] In some other embodiments of the present disclosure, the electronic device may acquire the input data in the target controller based on a preset acquisition method in response to a user's target operation or after receiving a data acquisition instruction, thereby acquiring the input data.
[0045] S120. Run a simulation control program based on input data and generate simulation data. The simulation control program is used to simulate the operation process of the control program in the target controller. The simulation data includes simulation intermediate process data generated by logical operations of the simulation control program, or simulation intermediate process data and simulation output data.
[0046] In the embodiment of the present disclosure, after acquiring the input data corresponding to the target controller, the electronic device runs a simulation control program based on the input data and generates simulation data.
[0047] The simulation control program is a control program used to simulate the operation process of the control program in the target controller. The simulation control program can be a program with the same or approximately the same logical operation function as the target controller.
[0048] The operation data generated by the operation process of the control program in the target controller is used for equipment control. The operation data includes operation intermediate process data, or operation intermediate process data and operation output data.
[0049] The simulation control program obtains simulation data that is the same or approximately the same as the operating data of the target controller by simulating the operating process of the control program in the target controller.
[0050] Simulation data is used for statistical analysis of industrial big data, determining the root cause of field equipment failure, or optimizing field equipment.
[0051] The simulation data includes the simulation intermediate process data generated during the simulation control program scan cycle, or the simulation intermediate process data and the simulation output data. The simulation data is the same or approximately the same as the operation data generated by the control program running in the target controller.
[0052] Preferably, the simulation data includes all simulation intermediate process data generated within a simulation control program scanning cycle, or all simulation intermediate process data and all simulation output data.
[0053] 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 operation cycle of the controller, and its unit is generally milliseconds.
[0054] Program execution means that the controller program follows the rules from left to right and from top to bottom, starting from the first instruction, and executes the user's program one by one until the program ends. Then it starts the next round of scanning, and repeats this cycle.
[0055] Intermediate process data refers to 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, where the intermediate process data includes the simulated intermediate process data generated during the running of the simulated control program and / or the running intermediate process data generated during the running of the control program in the target controller.
[0056] 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.
[0057] The output data includes the operation result output by the target controller at the end of a scanning cycle, and / or the operation result output by the simulation control program at the end of a scanning cycle. Specifically, the output data can be output to the device connected to the controller through the output terminal of the controller. The output data includes the simulation output data output by the running simulation control program and / or the running output data output by the control program in the target controller.
[0058] Optionally, the simulation control program can run on a hardware redundant controller (such as a redundant PLC device, redundant DCS device, etc.), on a data acquisition module integrated in the hardware controller, or on any electronic device that can run the simulation control program, without limitation.
[0059] Specifically, after acquiring the input data, the electronic device inputs the input data into the simulation control program, controls the operation of the simulation control program, and then generates simulation data, wherein the simulation data may include intermediate process data generated by the simulation control program during the logical operation process, and may also include simulation output data generated after executing the logical operation.
[0060] S130: Acquire simulation data and store the simulation data.
[0061] In the embodiment of the present disclosure, after controlling the simulation control program to run and generate simulation data, the electronic device obtains the simulation data and stores the simulation data.
[0062] In the disclosed embodiments, it is possible to obtain input data corresponding to a target controller for device control, run a simulation control program based on the input data, and generate simulation data. The simulation control program is used to simulate the running process of the control program in the target controller. The simulation data includes simulated intermediate process data generated by logical operations of the simulation control program, or simulated intermediate process data and simulated output data. The simulation data is obtained and stored. Thus, 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 the simulation control program to obtain simulation data and store the simulation data. Furthermore, the continuous intermediate process data of the target controller within a scanning cycle, or the intermediate process data and output data, can be obtained by simulation, and will not be affected by network bandwidth and controller communication load.
[0063] In an embodiment of the present disclosure, obtaining input data corresponding to a target controller for device control may specifically include: obtaining a project file corresponding to the target controller; extracting configuration device information in the project file, and obtaining input data corresponding to the target controller based on the configuration device information.
[0064] In the embodiments of the present disclosure, the project file corresponding to the target controller can be understood as a file created and used during the development process of the target controller, which contains all the information required to implement a specific automation control task. For example, when the target controller is a target programmable logic controller, the project file includes a configuration file for describing the hardware configuration, communication configuration, parameter configuration, etc. of the target programmable logic controller, a program file for describing the control logic of the target programmable logic controller, etc.
[0065] Optionally, the format of the original project file may be XML format, JSON format or other formats. The original project file includes configuration device information, input data corresponding to the target controller, and / or spatial address of output data.
[0066] Specifically, the electronic device can export the project file from the target controller by calling a dedicated export tool, and then obtain the project file corresponding to the target controller.
[0067] In the embodiment of the present disclosure, the configuration device information may include the name, MAC address, etc. of the configuration device.
[0068] Specifically, after obtaining the engineering file corresponding to the target controller, the electronic device parses the engineering file and extracts the configuration device information in the engineering file, and obtains the input data corresponding to the target controller from the configuration device through a preset network communication protocol based on the configuration device information.
[0069] In the disclosed embodiment, the configuration device information can be extracted from the engineering file, thereby obtaining the input data corresponding to the target controller, thereby improving the accuracy of input data acquisition.
[0070] In an embodiment of the present disclosure, before running the simulation control program based on input data, the data acquisition method may also include: synchronizing the clock corresponding to the preset operating environment for running 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.
[0071] In the embodiment of the present disclosure, the specific implementation of performing clock synchronization processing is similar to the existing implementation of clock synchronization processing, and will not be described in detail here.
[0072] As a result, the simulation control program can be 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.
[0073] In the disclosed embodiment, the storage types of simulation data include full storage and variable storage.
[0074] Among them, 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 with the simulation data corresponding to the adjacent scanning cycle (such as the previous scanning cycle or the previous few scanning cycles).
[0075] like Figure 2 As shown, an embodiment of the present disclosure provides a flow chart of a data storage method. Specifically, storing simulation data may include the following steps:
[0076] S210: Determine whether the scanning cycle corresponding to the simulation data is the first scanning cycle.
[0077] In the embodiment of the present disclosure, the scanning cycle can be understood as the time corresponding to a series of processes of the simulation control program from inputting input data corresponding to the target controller, executing logic operations to generating simulation output data.
[0078] In the embodiment of the present disclosure, the electronic device executes step S220 when the scanning cycle corresponding to the analog data is the first scanning cycle; and executes steps S230-S250 when the scanning cycle corresponding to the analog data is not the first scanning cycle.
[0079] S220: Determine that the storage type of the simulation data is full storage, and store the simulation data in full.
[0080] In the disclosed embodiment, when the electronic device determines that the scan cycle corresponding to the analog data is the first scan cycle, it means that the value of the variable corresponding to the analog data has not been stored before. At this time, the storage type of the analog data is determined to be full storage, and then the analog data is completely stored.
[0081] In the embodiments of the present disclosure, the location where the simulation data is stored may include but is not limited to a memory cache, a disk, etc., and the storage method may include but is not limited to ordinary file storage, database storage, etc. The database storage may be stored in a database in a server, a cloud database, a local database, etc., which is not limited here.
[0082] S230, determining the time interval between the time corresponding to the last full data storage and the current time corresponding to the current data storage.
[0083] In an embodiment of the present disclosure, when the electronic device determines that the scanning cycle corresponding to the analog 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 this data storage, and compares the time interval with the preset time interval.
[0084] Exemplarily, when the preset time interval is 5 seconds, the moment corresponding to the last full data storage is 5 seconds, and the current moment corresponding to this data storage is 7 seconds. At this time, the time interval between the moment corresponding to the last full data storage and the current moment corresponding to this data storage is 2 seconds, and 2 seconds is less than the preset time interval of 5 seconds, so variable storage is performed; if the current moment corresponding to this data storage is 11 seconds, at this time, the time interval between the moment corresponding to the last full data storage and the current moment corresponding to this data storage is 6 seconds, and 6 seconds is greater than the preset time interval of 5 seconds, so full storage is performed.
[0085] When the time interval is greater than or equal to the preset time interval, step S240 is executed; otherwise, step S250 is executed.
[0086] 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 store the simulation data in full.
[0087] In an embodiment of the present disclosure, when the electronic device determines based on the comparison result that the time interval is greater than or equal to the preset time interval, it determines that the storage type of the simulation data is full storage, and stores the simulation data in full. Thus, the accuracy and completeness of the data can be ensured by periodically storing the simulation data in full.
[0088] S250. When the time interval is less than the preset time interval, determine that the storage type of the simulation data is variable storage, determine the target simulation data in the simulation data that has changed from the simulation data corresponding to the previous scanning cycle, and store the changed target simulation data.
[0089] In the embodiment of the present disclosure, when the electronic device determines that the time interval is less than the preset time interval based on the comparison result, it determines that the storage type of the analog data is variable storage, and then determines the target analog data in the analog data that has changed compared with the analog data corresponding to the previous scanning cycle, and stores the changed target analog data. In this way, the analog data can be stored in a variable storage manner, saving transmission bandwidth and storage space.
[0090] In the embodiments of the present disclosure, the storage type of the simulation data can be determined, and different storage methods are used according to different storage types, thereby saving transmission bandwidth and storage space while ensuring the accuracy and integrity of the data.
[0091] In an embodiment of the present disclosure, before storing the simulation data, the data acquisition method may also include: acquiring operation data corresponding to the target controller, the operation data including operation intermediate process data; determining at least one variable name corresponding to the operation data and the numerical value corresponding to each variable; and verifying the simulation data based on at least one variable name and the numerical value corresponding to each variable.
[0092] In the embodiment of the present disclosure, the specific implementation method of the electronic device obtaining the operation data corresponding to the target controller is similar to the specific implementation method of obtaining the input data corresponding to the target controller described above, and will not be described in detail here.
[0093] In some embodiments of the present disclosure, the operation data may include operation intermediate process data, and the operation data may also include operation intermediate process data and operation output data. The operation intermediate process data may be understood as data generated by the target controller in the operation logic process corresponding to the operation control program, wherein, due to the influence of factors such as the network, the operation intermediate process data of the target controller obtained here is part of the process data generated by the target controller during the operation process, and it may also be understood that the amount of the operation intermediate process data is less than the intermediate process data generated in the obtained simulation control program.
[0094] After obtaining the operating data corresponding to the target controller, the electronic device can compare the variable values corresponding to the same variable name in the operating intermediate process data contained in the operating data with the simulated intermediate process data contained in the simulation data. If the values corresponding to all the same variable names in the operating intermediate process data and the simulated intermediate process data are consistent, the verification result of the simulation data is determined to be passed, otherwise, vice versa.
[0095] In some other embodiments of the present disclosure, the operation data may also include operation intermediate process data and operation output data, wherein the operation output data may be understood as output data for controlling the configuration device generated after the target controller executes the operation logic.
[0096] 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 operation intermediate process data contained in the operation data with the simulation intermediate process data contained in the simulation data to obtain a first result, and at the same time compare the output data corresponding to the same variable name in the operation output data contained in the operation data with the simulation output data contained in the simulation data to obtain a second result. When there are variables with inconsistent values in the first result and the second result, it is determined that the verification fails, otherwise, vice versa.
[0097] Furthermore, when the verification result is passed, the simulation data is stored.
[0098] When the verification result is failed, continue to obtain the operating data corresponding to the target controller of the next scan cycle and the simulation data corresponding to the simulation control program, and compare them to determine whether the simulation data has passed the verification. If the verification results of the next scan cycle or subsequent multiple scan cycles are all failed, at this time, it is determined that the simulation data verification has failed and the simulation data is wrong, and the operating data of the target controller is stored, or the operating data and simulation data of the target controller are stored together to facilitate subsequent error analysis or correction of the simulation control program; if the verification result of the next scan cycle or subsequent multiple scan cycles is passed, at this time, it is determined that the simulation data verification has passed and the simulation data is correct, and the simulation data is stored.
[0099] In the disclosed embodiment, the simulation data can be verified by collecting the intermediate operation process data and / or the operation output data of the target controller during operation, so as to ensure the accuracy and validity of the stored simulation data.
[0100] In some embodiments of the present disclosure, before storing the simulation data, the data acquisition method may further include: acquiring operation output data corresponding to the target controller.
[0101] Furthermore, storing the simulation data may include: storing input data, simulation data and operation output data.
[0102] In some other embodiments of the present disclosure, before storing the simulation data, the data acquisition method may further include: acquiring operation intermediate process data and operation output data corresponding to the target controller.
[0103] Furthermore, storing the simulation data may include: storing input data, simulation data, operation intermediate process data and operation output data.
[0104] In the disclosed embodiment, the electronic device may store input data, simulation data, operation intermediate process data, and operation output data in different database tables, or in the same database table, wherein the database table includes information such as the name, value, timestamp, and attributes of the data.
[0105] In the embodiments of the present disclosure, it is possible to obtain simulation data generated by a simulation control program and data corresponding to a target controller (including input data, or input data and operating data), that is, to obtain continuous intermediate process data within at least one scanning cycle of the target controller by adopting a "simulation calculation + acquisition" method, and then obtain all or nearly all data of the target controller within a scanning cycle, thereby providing more comprehensive and accurate data support for subsequent troubleshooting, process tracking, big data analysis, etc.
[0106] Figure 3 It is a structural schematic diagram of a data acquisition device provided in an embodiment of the present disclosure.
[0107] In the embodiments of the present disclosure, the data acquisition device may be disposed in an electronic device and may be understood as a part of the functional modules in the electronic device. Specifically, the electronic device may be a server or a terminal, wherein the terminal specifically includes a computer or a tablet computer, etc., or may be any device capable of processing the data acquisition method, which is not limited here.
[0108] like Figure 3 As shown, the data acquisition device 300 may include a data acquisition module 310 , a program running module 320 and a data processing module 330 .
[0109] The data acquisition module 310 may be used to acquire input data corresponding to a target controller for device control.
[0110] The program running module 320 can be used to run a simulation control program based on input data and generate simulation data. The simulation control program is used to simulate the running process of the control program in the target controller. The simulation data includes simulated intermediate process data generated by logical operations of the simulation control program, or simulated intermediate process data and simulated output data.
[0111] The data processing module 330 can be used to obtain simulation data and store the simulation data.
[0112] In the disclosed embodiments, it is possible to obtain input data corresponding to a target controller for device control, run a simulation control program based on the input data, and generate simulation data. The simulation control program is used to simulate the running process of the control program in the target controller. The simulation data includes simulated intermediate process data generated by logical operations of the simulation control program, or simulated intermediate process data and simulated output data. The simulation data is obtained and stored. Thus, 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 the simulation control program to obtain simulation data and store the simulation data. Furthermore, the continuous intermediate process data of the target controller within a scanning cycle, or the intermediate process data and output data, can be obtained by simulation, and will not be affected by network bandwidth and controller communication load.
[0113] In some embodiments of the present disclosure, the data acquisition module 310 may be specifically used to acquire a project file corresponding to a target controller; extract configuration device information in the project file, and acquire input data corresponding to the target controller based on the configuration device information.
[0114] In some embodiments of the present disclosure, the data acquisition device 300 may further include a clock synchronization module.
[0115] The clock synchronization module can be used to synchronize the clock corresponding to the preset operating environment of the simulation control program before running the simulation control program based on 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.
[0116] In some embodiments of the present disclosure, the storage types of simulation data include full storage and variable storage.
[0117] The data processing module 330 may be specifically configured to determine that the storage type of the simulation data is full storage when the scanning cycle corresponding to the simulation data is the first scanning cycle, and to store the simulation data in full.
[0118] In some embodiments of the present disclosure, the data processing module 330 can also be specifically used to determine the time interval between the moment corresponding to the last full data storage and the current moment corresponding to this data storage when the scanning cycle corresponding to the simulation data is not the first scanning cycle; when the time interval is greater than or equal to the preset time interval, determine the storage type of the simulation data as full storage, and store the simulation data in full; when the time interval is less than the preset time interval, determine the storage type of the simulation data as variable storage, determine the target simulation data in the simulation data that has changed from the simulation data corresponding to the previous scanning cycle, and store the changed target simulation data.
[0119] In some embodiments of the present disclosure, the data acquisition device 300 may further include a data verification module.
[0120] The data verification module can be used to obtain the operating data corresponding to the target controller before storing the simulation data, the operating data including the intermediate process data of the operation; determine at least one variable name corresponding to the operating data and the numerical value corresponding to each variable; and verify the simulation data based on at least one variable name and the numerical value corresponding to each variable.
[0121] The data processing module 330 may be specifically configured to store the simulation data when the verification result is passed.
[0122] In some embodiments of the present disclosure, the data acquisition device 300 may further include an output data acquisition module.
[0123] The output data acquisition module can be used to acquire the operation output data corresponding to the target controller before storing the simulation data.
[0124] The data processing module 330 may also be specifically used to store input data, simulation data and operation output data.
[0125] It should be noted that Figure 3 The data acquisition device 300 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.
[0126] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure.
[0127] In the disclosed embodiment, Figure 4 The electronic device shown may be a server or a terminal, wherein the terminal specifically includes a computer or a tablet computer, etc., and may also be any device capable of processing the data acquisition method, which is not limited here.
[0128] like Figure 4 As shown, the electronic device may include a processor 410 and a memory 420 storing computer program instructions.
[0129] Specifically, the processor 410 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.
[0130] The memory 420 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 420 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 420 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 420 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 420 is a non-volatile solid-state memory. In a particular embodiment, the memory 420 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.
[0131] The processor 410 reads and executes the computer program instructions stored in the memory 420 to perform the steps of the data acquisition method provided in the embodiment of the present disclosure.
[0132] In one example, the electronic device may further include a transceiver 430 and a bus 440. Figure 4 As shown, the processor 410, the memory 420 and the transceiver 430 are connected via a bus 440 and communicate with each other.
[0133] The bus 440 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 440 may include one or more buses.
[0134] 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 acquisition method provided by the embodiments of the present disclosure.
[0135] The above-mentioned storage medium may, for example, include a memory 420 of computer program instructions, and the above-mentioned instructions may be executed by the processor 410 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.
[0136] 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.
[0137] The above description is only a specific embodiment 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 may 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 the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data acquisition method, characterized in that: include: Obtain input data corresponding to the 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 used to simulate the operation process of the control program in the target controller, and the simulation data includes simulation intermediate process data generated by the simulation control program performing a logical operation, or the simulation intermediate process data and simulation output data; The simulation data is acquired and stored.
2. The method according to claim 1, characterized in that The step of obtaining input data corresponding to a target controller for controlling the device includes: Obtaining the engineering file corresponding to the target controller; The configuration device information in the engineering file is extracted, and input data corresponding to the target controller is acquired based on the configuration device information.
3. The method according to claim 1, characterized in that Before running the simulation control program based on the input data, the method further includes: A clock corresponding to a preset operating environment for running the simulation control program is synchronized so that the clock corresponding to the simulation control program is synchronized with the clock corresponding to the control program of the target controller.
4. The method according to claim 1, characterized in that: The storage types of the simulation data include full storage and variable storage; The storing of the simulation data comprises: When the scanning cycle corresponding to the simulation data is the first scanning cycle, it is determined that the storage type of the simulation data is full storage, and the simulation data is fully stored.
5. The method according to claim 4, characterized in that When the scanning cycle corresponding to the simulation data is not the first scanning cycle, storing the simulation data includes: 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, determining that the storage type of the simulation data is full storage, and storing the simulation data in full; When the time interval is less than the preset time interval, the storage type of the simulation data is determined to be variable storage, the target simulation data in the simulation data that has changed from the simulation data corresponding to the previous scanning cycle is determined, and the changed target simulation data is stored.
6. The method according to claim 1, characterized in that Before storing the simulation data, the method further includes: Acquire operation data corresponding to the target controller, wherein the operation data includes operation intermediate process data; Determine at least one variable name corresponding to the operating data and a value corresponding to each variable; Verifying the simulation data based on the at least one variable name and a value corresponding to each variable; The storing of the simulation data comprises: When the verification result is passed, the simulation data is stored.
7. The method according to claim 1 or 6, characterized in that: Before storing the simulation data, the method further includes: Obtaining operation output data corresponding to the target controller; The storing of the simulation data comprises: The input data, the simulation data and the operation output data are stored.
8. A data acquisition device, characterized in that: include: A data acquisition module, used to acquire input data corresponding to a target controller for device control; a program running module, used to run a simulation control program based on the input data and generate simulation data, wherein the simulation control program is used to simulate the running process of the control program in the target controller, and the simulation data includes simulation intermediate process data generated by the simulation control program performing logical operations, or the simulation intermediate process data and simulation output data; The data processing module is used to obtain the simulation data and store the simulation data.
9. An electronic device, 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 7.
10. A computer-readable storage medium, 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 acquisition method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program or instructions, characterized in that: When the computer program or instruction is executed by a processor, the data acquisition method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Data acquisition method and apparatus, storage medium, and program product
WO2026021046A1
