Design method and device of data acquisition equipment
By deploying the runtime environment in the data acquisition device, the functional files are isolated from the underlying hardware and operating system, the problems of long development cycle and low flexibility in the existing technology are solved, and the flexible expansion and stability of the functions of the data acquisition device are achieved. Sex improvement.
Patent Information
- Application Number
- CN202310952824.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-02-14
AI Technical Summary
The existing data acquisition equipment has a long development cycle, low flexibility, poor stability, and needs to be redeveloped or compiled according to different underlying hardware and operating systems, and has fewer reuse resources.
Deploy the runtime environment of the first program language in the data acquisition device so that the functional files do not need to rely on the underlying hardware and operating system, and realize functional expansion by obtaining and loading functional files.
It improves the flexibility of the expansion of the function of data acquisition equipment, simplifies the development process, reduces development costs, and improves the stability and flexibility of the equipment.
Smart Images

Figure CN119440481A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the field of digitization, and in particular to a design method and device for data acquisition equipment. Background Art
[0002] Data acquisition equipment is a key device in digital technology, used to collect data. Common data acquisition equipment includes data acquisition gateways and edge devices. Data acquisition equipment programs are usually developed in C or C++. After development, the source code is compiled into target code for execution. C or C++ language features and dependencies on underlying hardware and operating systems require redevelopment or compilation for different underlying hardware and operating systems. There are fewer reusable resources and the reused resources also have underlying dependencies, resulting in a long development cycle, low flexibility, and poor stability. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a design method and device for a data acquisition device to improve the flexibility of function expansion of the data acquisition device.
[0004] To achieve the above-mentioned purpose, the present invention proposes a design method for a data acquisition device, the design method comprising: initializing the data acquisition device, wherein a runtime environment of a first programming language is burned into the data acquisition device; obtaining a configuration file and a function file from a file server in the data acquisition device, wherein the function file is developed in the first programming language; reading configuration information from the configuration file, and loading the function file in the runtime environment according to the configuration information, so that the data acquisition device executes the function corresponding to the function file. To this end, by deploying the runtime environment in the data acquisition device, the operation of the function file does not need to rely on the underlying hardware and operating system, that is, the isolation of the function file from the underlying hardware or operating system is achieved. For the data acquisition device, it is only necessary to obtain the newly developed function file and load it in the runtime environment to enable the data acquisition device to achieve functional expansion, thereby improving the flexibility of the data acquisition device's functional expansion.
[0005] Optionally, initializing the data acquisition device includes: loading a basic service program on the data acquisition device, configuring connection parameters, and establishing a connection between the data acquisition device and the file server according to the connection parameters. To this end, by initializing the data acquisition device, the data acquisition device is provided with basic functions and connection capabilities.
[0006] Optionally, the data acquisition device obtains the configuration file and the function file from the file server, including: determining an acquisition cycle, and the data acquisition device obtains the configuration file and the function file from the file server according to the acquisition cycle. To this end, by obtaining the configuration file and the function file from the file server according to the acquisition cycle, the file acquisition process is simplified.
[0007] Optionally, the data acquisition device obtains configuration files and function files from the file server, including: monitoring the file server, and when a new function file is detected in the file server, obtaining the new function file from the file server. To this end, by monitoring the file server, and when a new function file is detected in the file server, obtaining the new function file from the file server, the efficiency of file acquisition is improved and system resources are saved.
[0008] Optionally, configuration information is read from the configuration file, and the function file is loaded in the runtime environment according to the configuration information, so that the data acquisition device executes the function corresponding to the function file, including: the data acquisition device adds a data acquisition protocol, a data upload protocol or a data processing function after executing the function file. To this end, the expansion of the data acquisition protocol, the data upload protocol and the data processing function of the data acquisition device is realized.
[0009] Optionally, the first program language is Python or Java Script. Therefore, the flexible expansion of the data acquisition device function is achieved through Python or Java Script.
[0010] The present invention also proposes a design device for a data acquisition device, the design device comprising: an initialization module, for initializing the data acquisition device, wherein the data acquisition device has a runtime environment of a first programming language burned into it; an acquisition module, for the data acquisition device to acquire configuration files and function files from a file server, wherein the function files are developed using the first programming language; a loading module, for reading configuration information from the configuration file, and loading the function files in the runtime environment according to the configuration information, so that the data acquisition device executes the function corresponding to the function file.
[0011] The present invention also proposes an electronic device, comprising a processor, a memory and instructions stored in the memory, wherein the instructions implement the above method when executed by the processor.
[0012] The present invention also provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed, the method described above is executed.
[0013] The present invention also provides a computer program product, characterized in that it comprises a computer program, and when the computer program is executed by a processor, the method described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The following drawings are intended only to illustrate and explain the present invention, and do not limit the scope of the present invention.
[0015] Figure 1 is a flow chart of a method for designing a data acquisition device according to an embodiment of the present invention;
[0016] Figure 2 is a schematic diagram of a data acquisition system according to an embodiment of the present invention;
[0017] Figure 3 is a flow chart of a design device for a data acquisition device according to an embodiment of the present invention;
[0018] Figure 4 is a schematic diagram of an electronic device according to an embodiment of the present invention.
[0019] Description of Reference Numerals
[0020] 100 Design Methods of Data Acquisition Equipment
[0021] Steps 110-130
[0022] 20 Data Acquisition System
[0023] 21Data acquisition equipment
[0024] 211 basic function modules
[0025] 212 File Management Module
[0026] 213 Runtime Environment
[0027] 214 transceiver
[0028] 23 Cloud
[0029] 300 Data Acquisition Equipment Design Device
[0030] 310 Initialization module
[0031] 320 Acquisition Module
[0032] 330 Loading Module
[0033] 400 Electronic equipment
[0034] 410 processor
[0035] 420 Memory DETAILED DESCRIPTION
[0036] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described with reference to the accompanying drawings.
[0037] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0038] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0039] The present invention proposes a design method for a data acquisition device. Figure 1 is a flow chart of a method 100 for designing a data acquisition device according to an embodiment of the present invention. Figure 1 As shown, the design method 100 includes:
[0040] Step 110, initializing a data acquisition device, in which a runtime environment of a first programming language is burned.
[0041] The data acquisition device can be a collection gateway or an edge device. The collection gateway and edge device are deployed at the factory site to collect data. After the collected data is processed and analyzed, the factory site can be used for status monitoring and predictive maintenance, thereby realizing the digitization of the factory. Initialize the data acquisition device, that is, perform initial configuration on the data acquisition device. The data acquisition device is burned with a runtime environment of the first program language, and the function files developed by the first program language can be directly run in the runtime environment in an interpreted execution manner without compilation. In some embodiments, the first program language can be Python or Java Script. Accordingly, the runtime environment can be a Python runtime environment and a Node.js runtime environment.
[0042] In some embodiments, initializing the data acquisition device includes: loading a basic service program on the data acquisition device, configuring connection parameters, and establishing a connection between the data acquisition device and the file server according to the connection parameters. Specifically, the basic service program may include programs corresponding to basic functions of the gateway, such as a gateway configuration module, a network connection jump, local data buffering, data processing, data upload services, and file management services. By loading the basic service program, the data acquisition device has basic functions such as a network connection jump, local data buffering, and data processing; establishing a connection between the data acquisition device and the file server, so that the data acquisition and the file server can communicate according to the set protocol. To this end, by initializing the data acquisition device, the data acquisition device is equipped with basic functions and connection capabilities.
[0043] Figure 2 is a schematic diagram of a data acquisition system 20 according to an embodiment of the present invention. Figure 2 As shown, the data acquisition system 20 includes a plurality of data acquisition devices 21 and a file server 22 connected to the plurality of data acquisition devices 21. It is understandable that the data acquisition system 20 may include more data acquisition devices 21. The data acquisition device 21 includes a basic function module 211 and a file management module 212. The basic function module 211 endows the data acquisition device 21 with basic functions such as network hopping, local data buffering, and data processing. The file management module 212 may receive files from the file server 22 through a connection established with the file server 22. The basic service program may include a basic function module 211 and a transceiver 214.
[0044] Step 120, the data acquisition device obtains a configuration file and a function file from a file server, where the function file is developed using a first programming language.
[0045] The configuration file can be generated by a configuration tool, and the configuration file is used to configure the connection parameters and communication parameters required by the data acquisition device. The function file is developed in the first program language, and the function file can realize corresponding functions after running, such as data acquisition protocol, data upload protocol, data processing function, etc. The function file developed in the first program language can be directly run in the runtime environment in an interpreted execution mode without compilation.
[0046] In some embodiments, the data acquisition device obtains configuration files and function files from a file server, including: determining an acquisition cycle, and the data acquisition device obtains the configuration files and function files from the file server according to the acquisition cycle. The file suffix of the configuration file may be .cfg, and the suffix of the function file may be .py. The configuration files and function files may be identified by identifying the suffixes, thereby periodically obtaining the configuration files and function files. To this end, by obtaining the configuration files and function files from the file server according to the acquisition cycle at the data acquisition device, the file acquisition process is simplified.
[0047] In some embodiments, the data acquisition device obtains configuration files and function files from a file server, including: monitoring the file server, and when a new function file is detected in the file server, obtaining the new function file from the file server. For example, when a new file with a suffix of .cfg or .py is detected in the file server, it is determined that there is a new function file in the file server, and the new function file is obtained from the file server. To this end, by monitoring the file server, and when a new function file is detected in the file server, the new function file is obtained from the file server, the efficiency of file acquisition is improved and system resources are saved.
[0048] Step 130, reading configuration information from the configuration file, and loading the function file in the runtime environment according to the configuration information, so that the data acquisition device executes the function corresponding to the function file.
[0049] Configuration information may include points, device IP ports, etc. After obtaining the configuration file and function file, stop the original function in the data acquisition device, load the function file in the runtime environment according to the configuration information in the configuration file, and after loading, the data acquisition device can have the function corresponding to the function file. By deploying the runtime environment in the data acquisition device, the operation of the function file does not need to rely on the underlying hardware, that is, the isolation of the function file and the underlying hardware is achieved. For the data acquisition device, you only need to obtain the newly developed function file and load it in the runtime environment to enable the data acquisition device to achieve functional expansion, which improves the flexibility of the data acquisition device function expansion.
[0050] refer to Figure 2 Taking the first programming language as Python as an example, the file management module 212 obtains the configuration file .cfg and the function file .py from the file server 22, loads the Python function file .py in the Python runtime environment 213, and collects data for the device according to the configuration file .cfg, so that the data collection device 21 has the function corresponding to the Python function file. After the data collection device 21 processes the data using the extended function, it uploads the data to the cloud 23 through the transceiver 214.
[0051] In some embodiments, configuration information is read from a configuration file, and a function file is loaded in a runtime environment according to the configuration information, so that the data acquisition device executes the function corresponding to the function file, including: the data acquisition device adds a data acquisition protocol, a data upload protocol, or a data processing function after executing the function file. Exemplarily, the data acquisition protocol can be Modbus, S7 protocol, etc., the data upload protocol can be MQTT protocol, and the data processing function can be data cleaning, data screening, and data aggregation, etc. To this end, the expansion of the data acquisition protocol, data upload protocol, and data processing function of the data acquisition device is realized.
[0052] The embodiment of the present invention provides a design method for a data acquisition device, which deploys a runtime environment in the data acquisition device so that the operation of the function file does not need to rely on the underlying hardware and operating system, that is, the isolation of the function file from the underlying hardware or operating system is achieved. For the data acquisition device, it only needs to obtain the newly developed function file and load it in the runtime environment to enable the data acquisition device to achieve functional expansion, thereby improving the flexibility of the data acquisition device's functional expansion.
[0053] The present invention also proposes a design device for data acquisition equipment. Figure 3 is a flow chart of a design device 300 for a data acquisition device according to an embodiment of the present invention. Figure 3 As shown, the design device 300 includes:
[0054] Initialization module 310, initializing a data acquisition device, in which a runtime environment of a first programming language is burned;
[0055] An acquisition module 320, in which the data acquisition device acquires a configuration file and a function file from a file server, wherein the function file is developed in a first programming language;
[0056] The loading module 330 reads configuration information from the configuration file, and loads the function file in the runtime environment according to the configuration information, so that the data acquisition device executes the function corresponding to the function file.
[0057] The present invention also provides an electronic device 400 . Figure 4 FIG. 4 is a schematic diagram of an electronic device 400 according to an embodiment of the present invention. Figure 4 As shown, the electronic device 400 includes a processor 410 and a memory 420 , wherein the memory 420 stores instructions, wherein when the instructions are executed by the processor 410 , the method 100 described above is implemented.
[0058] The present invention further provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed, the method 100 described above is executed.
[0059] The present invention further provides a computer program product, comprising a computer program, and when the computer program is executed by a processor, the method 100 described above is implemented.
[0060] Some aspects of the methods and apparatus of the present invention may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". The processor may be one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLCs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors or combinations thereof. In addition, various aspects of the present invention may be expressed as computer products located in one or more computer-readable media, which include computer-readable program codes. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, tapes, etc.), optical disks (e.g., compact disks (CDs), digital versatile disks (DVDs) ...), smart cards, and flash memory devices (e.g., cards, sticks, key drives ...).
[0061] Flowchart is used here to illustrate the operations performed according to the method of the embodiment of the present application. It should be understood that the above operations are not necessarily performed accurately in order. On the contrary, various steps can be processed in reverse order or simultaneously. At the same time, other operations may be added to these processes, or a certain step or several steps of operations may be removed from these processes.
[0062] It should be understood that although this specification is described according to various embodiments, not every embodiment contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0063] The above description is only an illustrative embodiment of the present invention and is not intended to limit the scope of the present invention. Any equivalent changes, modifications and combinations made by any person skilled in the art without departing from the concept and principle of the present invention shall fall within the scope of protection of the present invention.
[0064] Nouns and pronouns relating to persons in this patent application are not limited to a specific gender.
Claims
1. A method (100) for designing a data acquisition device, characterized in that: The design method (100) comprises: Initializing the data acquisition device, wherein the runtime environment of the first programming language is burned into the data acquisition device (110); The data acquisition device obtains a configuration file and a function file from a file server, wherein the function file is developed using the first programming language (120); Configuration information is read from the configuration file, and the function file is loaded in the runtime environment according to the configuration information, so that the data acquisition device executes the function corresponding to the function file (130).
2. The design method (100) according to claim 1, characterized in that: Initializing the data acquisition device includes: loading a basic service program on the data acquisition device, configuring connection parameters, and establishing a connection between the data acquisition device and the file server according to the connection parameters.
3. The design method (100) according to claim 1 or 2, characterized in that: The data acquisition device acquires the configuration file and the function file from the file server, including: determining an acquisition cycle, and the data acquisition device acquires the configuration file and the function file from the file server according to the acquisition cycle.
4. The design method (100) according to claim 1 or 2, characterized in that: The data acquisition device obtains the configuration file and the function file from the file server, including: monitoring the file server, and when detecting that there is a new function file in the file server, obtaining the new function file from the file server.
5. The design method (100) according to claim 1, characterized in that: Configuration information is read from the configuration file, and the function file is loaded in the runtime environment according to the configuration information so that the data acquisition device executes the function corresponding to the function file, including: the data acquisition device adds a data acquisition protocol, a data upload protocol or a data processing function after executing the function file.
6. The design method (100) according to claim 1, characterized in that: The first programming language is Python or Java Script.
7. A design device (300) for a data acquisition device, characterized in that: The design device (300) comprises: An initialization module (310) is used to initialize the data acquisition device, wherein the data acquisition device has a runtime environment of a first programming language burned into it; An acquisition module (320), in which the data acquisition device acquires a configuration file and a function file from a file server, wherein the function file is developed using the first programming language; A loading module (330) reads configuration information from the configuration file, and loads the function file in the runtime environment according to the configuration information, so that the data acquisition device executes the function corresponding to the function file.
8. An electronic device (400), comprising a processor (410), a memory (420), and instructions stored in the memory (420), wherein the instructions, when executed by the processor (410), implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed, execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises a computer program, which, when executed by a processor, implements the method (100) according to any one of claims 1 to 6.