Data acquisition method and device based on object model, medium and electronic equipment

Through the data acquisition method based on object model, constructing object model and communication protocol adapter, the problems of high development costs and poor compatibility in traditional methods are solved, and the flexibility and efficiency of data acquisition are achieved.

CN119829665APending Publication Date: 2025-04-15HUAXI NEW ENERGY TECH (FUJIAN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411889758.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Traditional data acquisition methods require the development of specialized software or hardware according to the communication protocols of different IoT devices, resulting in high development costs, high maintenance difficulties, poor compatibility, and difficult to adapt to rapidly changing equipment needs.

Method used

By building a material model corresponding to the device to be collected, establishing a communication protocol adapter instance to connect to the device, data collection and format conversion are performed, standardized target data is generated, and SQL insertion statements are automatically generated to store them in the database.

Benefits of technology

On the basis of ensuring data validity, it has expanded the scope of application of data acquisition methods, reduced the acquisition complexity, improved data storage efficiency, and avoided storage errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829665A_ABST
    Figure CN119829665A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data acquisition method and device based on an object model, a medium and electronic equipment. The method comprises the following steps: constructing an object model corresponding to equipment to be collected; establishing a communication protocol adapter instance corresponding to the to-be-acquired equipment, and establishing connection between the communication protocol adapter instance and the to-be-acquired equipment; performing data acquisition on the to-be-acquired equipment through the communication protocol adapter instance, and performing format conversion on the acquired data to obtain standardized target data; according to the target data, generating a corresponding SQL insertion statement so as to store the target data in a database, and the database is pre-constructed according to the attribute of the object model. According to the technical scheme provided by the embodiment of the invention, the application range of the data acquisition method can be expanded on the basis of ensuring the validity of the acquired data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data acquisition technology, and in particular to a data acquisition method, device, medium and electronic device based on a physical model. Background Art

[0002] With the rapid development of IoT technology, various IoT devices and communication protocols have emerged one after another. Traditional data collection methods often require the development of specialized collection software or hardware according to the communication protocols of different devices, resulting in high development costs, difficult maintenance, and poor compatibility. In addition, due to the dynamic changes of IoT devices, traditional data collection methods are also difficult to adapt to rapidly changing needs. Therefore, how to expand the scope of application of data collection methods while ensuring the validity of the collected data has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The embodiments of the present application provide a data collection method, device, medium and electronic device based on a physical model, thereby expanding the scope of application of the data collection method while ensuring the validity of the collected data, at least to a certain extent.

[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0005] According to one aspect of an embodiment of the present application, a data collection method based on a physical model is provided, comprising:

[0006] Construct a physical model corresponding to the device to be collected;

[0007] Establishing a communication protocol adapter instance corresponding to the device to be collected, and establishing a connection between the adapter and the device to be collected;

[0008] Collect data from the device to be collected through the communication protocol adapter instance, and convert the format of the collected data to obtain standardized target data;

[0009] According to the target data, a corresponding SQL insert statement is generated to store the target data in a database, and the database is pre-built according to the attributes of the object model.

[0010] According to one aspect of an embodiment of the present application, a data acquisition device based on a physical model is provided, comprising:

[0011] The first construction module is used to construct a physical model corresponding to the device to be collected;

[0012] The second building module is used to establish a communication protocol adapter instance corresponding to the device to be collected, and establish a connection between the communication protocol adapter and the device to be collected;

[0013] A collection module, used for collecting data from the device to be collected through the communication protocol adapter instance, and converting the format of the collected data to obtain standardized target data;

[0014] A processing module is used to generate a corresponding SQL insert statement according to the target data to store the target data in a database, and the database is pre-built according to the attributes of the object model.

[0015] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the physical model-based data acquisition method as described in the above embodiment is implemented.

[0016] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the physical model-based data acquisition method as described in the above embodiments.

[0017] According to one aspect of an embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data acquisition method based on the object model provided in the above embodiment.

[0018] In the technical solutions provided in some embodiments of the present application, by constructing a physical model corresponding to the device to be collected, establishing a communication protocol adapter instance corresponding to the device to be collected, and establishing a connection between the device to be collected and the device to be collected, then, through the communication protocol adapter instance, data is collected from the device to be collected, and the collected data is formatted to obtain standardized target data, and then a corresponding SQL insert statement is generated based on the target data to store the target data in a database. In this way, by constructing a physical model and a communication protocol adapter instance corresponding to the device to be collected, and collecting data from the device to be collected based on the communication protocol adapter instance, not only can the validity of the collected data be guaranteed, but also the complexity of data collection can be reduced, thereby expanding the scope of application of the data collection method.

[0019] In addition, SQL insert statements are automatically generated based on the target data, and the target data can be sent to the database for storage in the form of standard SQL statements, which not only improves data storage efficiency but also avoids storage errors.

[0020] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0022] Figure 1 A schematic diagram of a process of a data acquisition method based on a physical model according to an embodiment of the present application is shown;

[0023] Figure 2 A schematic diagram of a data structure of a physical model attribute according to an embodiment of the present application is shown;

[0024] Figure 3 A block diagram of a data acquisition device based on a physical model according to an embodiment of the present application is shown;

[0025] Figure 4 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0027] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0028] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0029] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0030] Figure 1 A schematic flow chart of a data collection method based on a physical model according to an embodiment of the present application is shown.

[0031] like Figure 1 As shown, the data collection method based on the physical model at least includes steps S110 to S140, which are described in detail as follows:

[0032] In step S110, a physical model corresponding to the device to be collected is constructed.

[0033] The device to be collected may be an IoT device for which data collection is required. After the device to be collected is determined, a physical model corresponding to the device to be collected can be constructed to abstract the functions, attributes, services and events of the device to be collected and express them in a digital form.

[0034] In one example, when constructing a physical model corresponding to a device to be collected, the function, performance parameters, operation mode, etc. of the device to be collected can be analyzed first to determine the properties that need to be monitored and controlled. Then, the physical model corresponding to the device to be collected is obtained by defining the properties, methods, and events of the device to be collected.

[0035] Among them, attributes can be data points used to describe the status of the device, such as temperature, humidity, pressure, etc. When defining attributes, you need to define the name, data type, read and write permissions, unit, range, etc. for each attribute.

[0036] A method (or service) can be an operation that can be performed by a device, such as starting, stopping, adjusting parameters, etc. When defining a method, it is necessary to define input parameters, output results, and execution conditions for each method.

[0037] An event can be a signal triggered by a device under specific conditions, such as an alarm, fault, or state change. When defining an event, you need to define the trigger condition and response action for each event.

[0038] In addition, if necessary, the relationship between the acquisition devices can also be defined, that is, the hierarchical relationship and interaction relationship between the devices can be determined, such as one device is a sub-device of another device, or the devices need to work together, etc.

[0039] In this way, by constructing a physical model of the device to be collected, it is ensured that all relevant parties can use a unified language in the digital world to describe, control and understand the functions of these devices. It should be noted that the embodiment of the present application mainly focuses on the attribute part in the physical model. The standard data structure definition of the physical model attribute is as follows: Figure 2 Based on Figure 2 The data structure shown below takes a chiller as an example to describe the object model elements in JSON format:

[0040]

[0041]

[0042]

[0043] Please continue to refer to Figure 1 In step S120, a communication protocol adapter instance corresponding to the device to be collected is established, and a connection is established between the adapter and the device to be collected.

[0044] In this embodiment, by creating a communication protocol adapter instance, it is possible to communicate with different devices to be collected, and convert the collected data into a unified standard format.

[0045] In one embodiment, establishing a communication protocol adapter instance corresponding to the device to be collected includes:

[0046] Determine the target communication protocol corresponding to the device to be collected;

[0047] An adapter object is created to encapsulate functions related to the target communication protocol, and parameters of the adapter object are configured to obtain a communication protocol adapter instance, wherein the parameter configuration includes at least one of a connection address setting, a port number setting, a collection frequency setting, and a connection duration setting.

[0048] Taking the aforementioned chiller as an example, building a corresponding communication protocol adapter instance mainly includes the following steps:

[0049] (1) Select the communication protocol: such as Modbus TCP.

[0050] (2) Create an adapter instance: Create an adapter object to encapsulate Modbus TCP-related functions. This object will be responsible for managing the connection status, sending requests, and receiving responses.

[0051] (3) Configuration parameters:

[0052] Connection address: Set the IP address of the device to be collected, for example: "The Modbus address of the chiller host is 192.168.X.XXX".

[0053] Port number: Set the port number of the device to be collected. The default port number of Modbus TCP is 502.

[0054] Protocol selection: Make sure to use Modbus TCP and not other variants (such as Modbus RTU or ASCII).

[0055] Collection frequency: defines the time interval for collecting data from the device, for example, collecting data every 5 seconds.

[0056] Connection duration: Set the length of time the connection remains active. After this time, the connection will be automatically closed to save resources.

[0057] After the communication protocol adapter instance is established, it can be used to try to establish a connection with the device to be collected. Before establishing the connection, it is necessary to ensure that the device to be collected is in an accessible state and is listening to the specified port.

[0058] In step S130, data is collected from the device to be collected through the communication protocol adapter instance, and the collected data is format-converted to obtain standardized target data.

[0059] In this embodiment, after the communication protocol adapter instance is created and a connection is established with the device to be collected, data can be collected from the collection device through the communication protocol adapter instance. In one example, data collection can be achieved by reading data from a specific register address of the device to be collected.

[0060] After collecting the data, the communication protocol adapter instance can convert the data of each communication protocol into a standardized data format to obtain the target data.

[0061] In some embodiments of the present application, step S130 includes:

[0062] Establishing a mapping relationship between the communication data point address of the device to be collected and the attributes of the object model;

[0063] Based on the communication protocol adapter instance, collecting data from the communication data point address of the device to be collected;

[0064] The data collected from each of the communication data point addresses is converted into a data format of attribute information corresponding to the communication data point address to obtain standardized target data.

[0065] In this embodiment, a mapping relationship between the communication data point address of the device to be collected and the attribute of the physical model can be established in advance. By establishing the mapping relationship, the original data of the device to be collected can be correctly mapped to the attribute of the physical model, ensuring the accuracy of the collected data. In addition, when performing subsequent data conversion, the original data can be correctly converted into the required format based on the mapping relationship, which is convenient for storage and analysis.

[0066] After the above mapping relationship is established, the communication protocol adapter instance can read data from the corresponding communication data point address and convert the read data into the data format of the attribute of the object model corresponding to the communication data point address, thereby obtaining standardized target data.

[0067] Taking the physical model of the aforementioned chiller as an example, the mapping relationship between its communication data point address and the physical model attribute is established as follows: Modbus register address 0x0001 is mapped to the physical model attribute is_on, Modbus register address 0x0002 is mapped to the physical model attribute fault_status, Modbus register address 0x0003 is mapped to the physical model attribute outlet_temp, and Modbus register address 0x0004 is mapped to the physical model attribute load.

[0068] The communication protocol adapter instance initiates communication with the device to be collected according to the above mapping relationship and reads the register data of the device to be collected. After collecting data, the communication protocol adapter instance can parse the original data packet from the device to be collected and convert the data format according to the data type of the corresponding object model attribute to obtain standardized target data.

[0069] For example, if a value of 1 is read from Modbus register address 0x0001, it is converted to a Boolean value of true; if a value of 1 is read from 0x0002, it is converted to a Boolean value of true; if a value of 255 is read from 0x0003, it is converted to a floating point value of 25.5; and if a value of 75 is read from 0x0004, it is kept as an integer value of 75.

[0070] Please continue to refer to Figure 1 In step S140, a corresponding SQL insert statement is generated according to the target data to store the target data in a database, and the database is pre-built according to the attributes of the object model.

[0071] In this embodiment, a corresponding database and its corresponding table structure can be established first according to the object model attributes and the database type. After the standardized target data is obtained, a corresponding SQL insert statement can be automatically generated according to the target data, and the SQL insert statement can be sent to the database, thereby realizing real-time storage of the collected data, ensuring the consistency and integrity of the data, and simplifying the data storage process.

[0072] In one embodiment, before generating a corresponding SQL insert statement according to the target data, the method further includes:

[0073] According to the attributes contained in the physical model, a corresponding relational database and a time series database are established;

[0074] Then, according to the target data, a corresponding SQL insert statement is generated, including:

[0075] According to the target data, a corresponding first SQL insert statement and a second SQL insert statement are generated respectively, wherein the first SQL insert statement is used to store the target data in the relational database, and the second SQL insert statement is used to store the target data in the time series database.

[0076] In this embodiment, the database may include a relational database and a time series database. Establishing both a relational database and a time series database can combine the advantages of both. Relational databases are good at processing complex queries and transactional operations, and are suitable for storing and managing data with fixed structures and requiring complex associated operations; while time series databases optimize the writing and query efficiency of time series data, and are suitable for processing a large amount of data recorded in chronological order, such as monitoring and sensor data, thus providing more comprehensive data processing capabilities.

[0077] Taking the aforementioned cold water host as an example, when creating a relational database table structure, the following steps can be included:

[0078] Define table name: Create a chiller data table named CH001_data.

[0079] Define the primary key: Create a self-incrementing primary key id to identify the uniqueness of each piece of data, and use the database primary key ID self-increment mechanism to automatically generate an ID serial number.

[0080] Define device information columns: Create device_id and device_name columns to record the chiller host corresponding to each piece of data.

[0081] Define timestamp column: Create a timestamp column to record the time of data collection. The default value can be set to the current time.

[0082] Define object model attribute columns: traverse the object model attribute list and create a corresponding column for each attribute. The column name is the code value of the attribute. The data type is determined by the data_type field, and a comment is added to describe the meaning of the column.

[0083] Add unique constraint: Add a unique constraint for the (device_id, timestamp) combination to prevent duplicate records.

[0084] The corresponding SQL statement example is as follows:

[0085] CREATE TABLE IF NOT EXISTS CH001_data(

[0086] id bigint AUTO_INCREMENT PRIMARY KEY,

[0087] device_id VARCHAR(255)NOT NULL COMMENT'Device ID',

[0088] device_name VARCHAR(255)NOT NULL COMMENT'Device name',

[0089] Timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT'Data collection time',

[0090] is_on CHAR NOT NULL COMMENT'operating status',

[0091] fault_status BOOLEAN NOT NULL COMMENT'fault status',

[0092] outlet_temp decimal NOT NULL COMMENT'outlet temperature',

[0093] load decimal NOT NULL COMMENT'load',

[0094] UNIQUE(device_id,timestamp)

[0095] ).

[0096] When creating a time series database table structure, you can include the following steps:

[0097] Define database: Create database ch001_db.

[0098] Define measurements: It should be understood that in InfluxDB, measurements are similar to tables in relational databases and are used to store time series data. To store the data of the chiller, define a measurement called CH001_data. This measurement will contain static information about the device as tags, such as the device ID, etc. At the same time, the device's status information or measurements, such as the outlet water temperature, load, etc., are stored as fields.

[0099] Define timestamp: Use the built-in timestamp field time.

[0100] Therefore, after obtaining the target data, the corresponding first SQL insert statement and second SQL insert statement can be generated respectively. The first SQL insert statement is used to store the target data in the relational database, which can be as follows:

[0101] INSERT INTO CH001_data(device_id,device_name,is_on,fault_status,outlet_temp,load)VALUES('CH001','Cooler host',1,0,25.5,75).

[0102] The second SQL insert statement is used to store the target data in the time series database, which can be as follows:

[0103] WRITE CH001_data, device_id=CH001, device_name=cold water host is_on=1, fault_status=0, outlet_temp=25.5, load=75 time=now().

[0104] In some embodiments of the present application, the data collection method based on the physical model further includes:

[0105] Sending a device control instruction to the communication protocol adapter instance, wherein the device control instruction includes standardized instruction data;

[0106] The communication protocol adapter converts the instruction data into the original data format of the device to be collected for distribution.

[0107] In this embodiment, the communication protocol adapter instance not only supports data collection, but also can convert standardized instruction data into the original data format of the device to be collected, thereby supporting the issuance of device control instructions.

[0108] The following describes an apparatus embodiment of the present application, which can be used to execute the physical model-based data acquisition method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the embodiment of the physical model-based data acquisition method in the above-mentioned embodiment of the present application.

[0109] Figure 3 A block diagram of a data acquisition device based on a physical model according to an embodiment of the present application is shown.

[0110] Reference Figure 3 As shown, according to an embodiment of the present application, a data acquisition device based on a physical model includes:

[0111] The first construction module is used to construct a physical model corresponding to the device to be collected;

[0112] The second building module is used to establish a communication protocol adapter instance corresponding to the device to be collected, and establish a connection between the communication protocol adapter and the device to be collected;

[0113] A collection module, used for collecting data from the device to be collected through the communication protocol adapter instance, and converting the format of the collected data to obtain standardized target data;

[0114] A processing module is used to generate a corresponding SQL insert statement according to the target data to store the target data in a database, and the database is pre-built according to the attributes of the object model.

[0115] In some embodiments of the present application, data is collected from the device to be collected through the communication protocol adapter instance, and the collected data is formatted to obtain standardized target data, including:

[0116] Establishing a mapping relationship between the communication data point address of the device to be collected and the attributes of the object model;

[0117] Based on the communication protocol adapter instance, collecting data from the communication data point address of the device to be collected;

[0118] The data collected from each of the communication data point addresses is converted into a data format of attribute information corresponding to the communication data point address to obtain standardized target data.

[0119] In some embodiments of the present application, before generating a corresponding SQL insert statement according to the target data, the processing module is further used to:

[0120] According to the attribute information contained in the object model, a corresponding relational database and a time series database are established;

[0121] Then, according to the target data, a corresponding SQL insert statement is generated, including:

[0122] According to the target data, a corresponding first SQL insert statement and a second SQL insert statement are generated respectively, wherein the first SQL insert statement is used to store the target data in the relational database, and the second SQL insert statement is used to store the target data in the time series database.

[0123] In some embodiments of the present application, establishing a communication protocol adapter instance corresponding to the device to be collected includes:

[0124] Determine the target communication protocol corresponding to the device to be collected;

[0125] An adapter object is created to encapsulate functions related to the target communication protocol, and parameters of the adapter object are configured to obtain a communication protocol adapter instance, wherein the parameter configuration includes at least one of a connection address setting, a port number setting, a collection frequency setting, and a connection duration setting.

[0126] In some embodiments of the present application, the processing module is further used to:

[0127] Sending a device control instruction to the communication protocol adapter instance, wherein the device control instruction includes standardized instruction data;

[0128] The communication protocol adapter converts the instruction data into the original data format of the device to be collected for distribution.

[0129] Figure 4 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0130] It should be noted that Figure 4 The computer system of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0131] like Figure 4As shown, the computer system includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage part 408 to the random access memory (RAM) 403, such as executing the method described in the above embodiment. In RAM 403, various programs and data required for system operation are also stored. CPU 401, ROM 402 and RAM 403 are connected to each other through bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0132] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed so that a computer program read therefrom is installed into the storage section 408 as needed.

[0133] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 409, and / or installed from a removable medium 411. When the computer program is executed by a central processing unit (CPU) 401, various functions defined in the system of the present application are executed.

[0134] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0135] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0136] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0137] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.

[0138] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0139] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0140] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0141] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A data collection method based on a physical model, characterized in that: include: Construct a physical model corresponding to the device to be collected; Establishing a communication protocol adapter instance corresponding to the device to be collected, and establishing a connection between the adapter and the device to be collected; Collect data from the device to be collected through the communication protocol adapter instance, and convert the format of the collected data to obtain standardized target data; According to the target data, a corresponding SQL insert statement is generated to store the target data in a database, and the database is pre-built according to the attributes of the object model.

2. The method according to claim 1, characterized in that: The communication protocol adapter instance is used to collect data from the device to be collected, and the collected data is formatted to obtain standardized target data, including: Establishing a mapping relationship between the communication data point address of the device to be collected and the attributes of the object model; Based on the communication protocol adapter instance, collecting data from the communication data point address of the device to be collected; The data collected from each of the communication data point addresses are converted into a data format of the attributes of the physical model corresponding to the communication data point address to obtain standardized target data.

3. The method according to claim 1, characterized in that Before generating a corresponding SQL insert statement according to the target data, the method further includes: According to the attributes contained in the physical model, a corresponding relational database and a time series database are established; Then, according to the target data, a corresponding SQL insert statement is generated, including: According to the target data, a corresponding first SQL insert statement and a second SQL insert statement are generated respectively, wherein the first SQL insert statement is used to store the target data in the relational database, and the second SQL insert statement is used to store the target data in the time series database.

4. The method according to claim 1, characterized in that: Establishing a communication protocol adapter instance corresponding to the device to be collected, including: Determine the target communication protocol corresponding to the device to be collected; An adapter object is created to encapsulate functions related to the target communication protocol, and parameters of the adapter object are configured to obtain a communication protocol adapter instance, wherein the parameter configuration includes at least one of a connection address setting, a port number setting, a collection frequency setting, and a connection duration setting.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Sending a device control instruction to the communication protocol adapter instance, wherein the device control instruction includes standardized instruction data; The communication protocol adapter converts the instruction data into the original data format of the device to be collected for distribution.

6. A data acquisition device based on a physical model, characterized in that: include: The first construction module is used to construct a physical model corresponding to the device to be collected; The second building module is used to establish a communication protocol adapter instance corresponding to the device to be collected, and establish a connection between the communication protocol adapter and the device to be collected; A collection module, used for collecting data from the device to be collected through the communication protocol adapter instance, and converting the format of the collected data to obtain standardized target data; The processing module is used to generate a corresponding SQL insert statement according to the target data to store the target data in a database, and the database is pre-built according to the attributes of the object model.

7. The device according to claim 6, characterized in that The communication protocol adapter instance is used to collect data from the device to be collected, and the collected data is formatted to obtain standardized target data, including: Establishing a mapping relationship between the communication data point address of the device to be collected and the attributes of the object model; Based on the communication protocol adapter instance, collecting data from the communication data point address of the device to be collected; The data collected from each of the communication data point addresses is converted into a data format of attribute information corresponding to the communication data point address to obtain standardized target data.

8. The device according to claim 6, characterized in that Before generating a corresponding SQL insert statement according to the target data, the processing module is further used to: According to the attribute information contained in the object model, a corresponding relational database and a time series database are established; Then, according to the target data, a corresponding SQL insert statement is generated, including: According to the target data, a corresponding first SQL insert statement and a second SQL insert statement are generated respectively, wherein the first SQL insert statement is used to store the target data in the relational database, and the second SQL insert statement is used to store the target data in the time series database.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the object model-based data collection method according to any one of claims 1 to 5 is implemented.

10. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the physical model-based data acquisition method as described in any one of claims 1 to 5.

Citation Information

Cited By

  • Distributed adapter dynamic management method based on equipment allocation list

    CN121262232A

  • Distributed adapter dynamic management method based on device assignment list

    CN121262232B