OpenPlant real-time database data column-to-row conversion method, system and device and medium

By obtaining, merging and sorting data in the openPlant real-time database, the specific operational problem of data column conversion is solved, the data is quickly read and simple structure is realized, and the efficiency of data display and complex transaction processing capabilities are improved.

CN118964452APending Publication Date: 2024-11-15BEIJING HUANENG XINRUI CONTROL TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411043511.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing technology has failed to effectively solve the specific operation of data column conversion in openPlant real-time database, which has affected the data query speed and the data display efficiency of front-end pages.

Method used

By obtaining the data in the openPlant real-time database, merging and sorting, forming several rows of data, and assembling them to the front end. The specific steps include obtaining data according to query conditions, combining and combining them according to the timestamp and device GN, and performing the data Device or time sort.

Benefits of technology

It realizes the rapid reading and simple data structure of data in the openPlant real-time database, which is suitable for complex transaction processing and data analysis, and improves the efficiency and observability of data display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964452A_ABST
    Figure CN118964452A_ABST
Patent Text Reader

Abstract

The invention discloses an openPlant real-time database data column-to-row conversion method, system and device and a medium, and the method comprises the steps: obtaining data in an openPlant real-time database according to a query condition; combining the obtained data in the openPlant real-time database to form a plurality of rows of data; sorting each row of data; and assembling each row of data according to a sorting result and then sending the data to a front end. The method, the system, the equipment and the medium can realize column-to-row conversion of the data in the openPlant real-time database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of big data and relates to a method, system, device and medium for converting data columns into rows in an openPlant real-time database. Background Art

[0002] The real-time or historical column data queried is converted into row data through calculation methods. This method reduces the time of front-end page processing data format, realizes ready-to-use, and the row-by-row data display effect is convenient for real-time personnel to observe and analyze.

[0003] With the development of the Internet and the Internet of Things, the application scope of real-time databases has expanded to a wider range of fields, including industrial automation, financial transactions, transportation and logistics, etc.

[0004] Real-time databases focus on the storage and access of real-time data and time-sensitive data (such as sensor data, log data, etc.). As time goes by, the data will become more and more, and the speed of querying data is also particularly critical.

[0005] In this context, considering the characteristics of the openPlant database, converting the original column data into the desired row data is a key point to be considered, but the prior art does not provide a specific operation on how to perform the conversion. Summary of the invention

[0006] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method, system, device and medium for converting columns into rows of data in an openPlant real-time database. The method, system, device and medium can realize the column-to-row conversion of data in an openPlant real-time database.

[0007] In order to achieve the above object, the present invention adopts the following technical scheme:

[0008] In one aspect, the present invention provides a method for converting data columns into rows in an openPlant real-time database, comprising:

[0009] Obtain data from the openPlant real-time database based on query conditions;

[0010] Merge the acquired data in the openPlant real-time database to form several rows of data;

[0011] Sort each row of data;

[0012] According to the sorting results, each row of data is assembled and sent to the front end.

[0013] The method for converting data columns into rows in the openPlant real-time database of the present invention is further improved in that:

[0014] Furthermore, the query conditions include start and end time, device ID and measurement point.

[0015] Furthermore, the data in the openPlant real-time database is real-time data or historical data.

[0016] Furthermore, the process of sorting each row of data is as follows:

[0017] Sort each row of data by device or time.

[0018] Furthermore, a row of data includes data of multiple measurement points of the same device at the same time.

[0019] Furthermore, it also includes:

[0020] The rows of data are displayed through the front end.

[0021] Furthermore, the process of merging the acquired data in the openPlant real-time database is as follows:

[0022] The data in the openPlant real-time database are grouped and merged according to timestamps and device GNs.

[0023] In a second aspect of the present invention, the present invention provides a system for converting data columns into rows in an openPlant real-time database, comprising:

[0024] The acquisition module is used to obtain data from the openPlant real-time database according to the query conditions;

[0025] A merging module is used to merge the data acquired from the openPlant real-time database to form several rows of data;

[0026] Sorting module, used to sort each row of data;

[0027] The assembly module is used to assemble each row of data according to the sorting result and send it to the front end.

[0028] In a third aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for converting columns of data in the openPlant real-time database into rows when executing the computer program.

[0029] In a fourth aspect of the present invention, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for converting data columns into rows in the openPlant real-time database are implemented.

[0030] The present invention has the following beneficial effects:

[0031] The method, system, device and medium for converting columns of data into rows in the openPlant real-time database described in the present invention merge the acquired data in the openPlant real-time database to form a plurality of rows of data during specific operation, thereby converting columns of data into rows in the openPlant real-time database, and the reading operation of the row of data is faster and the data structure is simpler. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0033] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0036] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0037] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.

[0038] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.

[0039] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0040] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0041] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.

[0042] Embodiment 1

[0043] refer to Figure 1 The method for converting large quantities of data columns into rows based on the openPlant real-time database of the present invention comprises the following steps:

[0044] 1)According to the query conditions, obtain the data in the openPlant real-time database;

[0045] Specifically, the query conditions include start and end time, device ID, and measurement point; in addition, the data in the openPlant real-time database may be real-time data or historical data.

[0046] 2) Merge the acquired data in the openPlant real-time database to form several rows of data;

[0047] Specifically, in this embodiment, the data in the openPlant real-time database is grouped and merged according to the timestamp and the device GN. When there is no data at any measuring point at this time, the time and value are spliced ​​to avoid the problem of unequal number of paging items in subsequent queries, and all devices are obtained when there is no device id.

[0048] 3) Sort each row of data by device or time.

[0049] 4) Assemble each row of data according to the sorting results and send it to the front end for display.

[0050] Embodiment 2

[0051] The historical data in the openPlant real-time database is shown in Table 1.

[0052] 1) Query the data of wind speed and status of estuary A01 and estuary A02 from 2023-11-01 00:00:01 to 2023-11-01 00:00:03.

[0053] Table 1

[0054]

[0055]

[0056] 2) Loop through multiple pieces of data

[0057] 3) Combine the roll call data GN and time TM in the openPlant real-time database to obtain:

[0058] W3.XR.SD_HK_1_001_CL-2023-11-01 00:00:01

[0059] 4) After splicing, multiple measurement point data of the same device and the same time are combined into one line. One line of data shows multiple measurement points. It is suitable for large-scale data. No matter how many measurement points there are, they all belong to one line under the device after merging. In addition, the spliced ​​characters are used as the key and value of the device and stored in the historical data, and the time, device name and other information are continued to be inserted.

[0060] 5) Re-traverse the assembled data and sort them by device ID or time. After the assembly is completed, the data is shown in Table 2:

[0061] Table 2

[0062]

[0063]

[0064] Referring to Table 2, the converted data is intuitive and clear, suitable for multi-device and multi-measurement point data analysis.

[0065] It should be noted that the present invention has the following characteristics:

[0066] The commonly used clickhouse database is a column storage, and the openPlant real-time database is also a column storage. Advantages of column data storage: 1) High compression rate: It can better utilize the repetitiveness of data and reduce storage space; 2) Efficient query: Since each column is stored separately, column storage can only read the columns required for the query, improving query performance; Disadvantages: It is not suitable for complex transaction processing. Column storage is usually more suitable for analytical queries rather than complex transaction processing.

[0067] The present invention converts the data in the openPlant real-time database into more intuitive row data, which has the following advantages:

[0068] 1) Suitable for transaction processing: Row storage is suitable for complex transaction processing and can handle more complex data operations and associated queries, paging queries, etc.; 2) Better read performance: Since row storage data is organized by row, the read operation for the entire row of data is faster and the data structure is simpler.

[0069] The present invention is applicable to the special data structure of openPlant, and can quickly convert a large amount of column data in the openPlant real-time database into row data according to its GN and TM attributes.

[0070] Embodiment 3

[0071] The present invention discloses a system for converting data columns into rows in an openPlant real-time database, comprising:

[0072] The acquisition module is used to obtain data from the openPlant real-time database according to the query conditions;

[0073] A merging module is used to merge the data acquired from the openPlant real-time database to form several rows of data;

[0074] Sorting module, used to sort each row of data;

[0075] The assembly module is used to assemble each row of data according to the sorting result and send it to the front end;

[0076] The display module is used to display the rows of data through the front end.

[0077] As an implementation manner of the present invention, the query condition includes start and end time, device ID and measurement point.

[0078] As an implementation manner of the present invention, the data in the openPlant real-time database is real-time data or historical data.

[0079] As an implementation mode of the present invention, the process of sorting each row of data is as follows:

[0080] Sort each row of data by device or time.

[0081] As an implementation manner of the present invention, a row of data includes data of multiple measurement points of the same device and at the same time.

[0082] As an implementation mode of the present invention, the process of merging the acquired data in the openPlant real-time database is as follows:

[0083] The data in the openPlant real-time database are grouped and merged according to timestamps and device GNs.

[0084] The division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0085] Embodiment 4

[0086] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for converting columns of data in an openPlant real-time database into rows are implemented, for example, comprising: acquiring data in the openPlant real-time database according to query conditions; merging the acquired data in the openPlant real-time database to form a plurality of rows of data; sorting each row of data; assembling each row of data according to the sorting result and sending the result to a front end; and displaying each row of data through the front end.

[0087] In addition, the computer device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above are examples of computer devices and do not constitute a limitation on computer devices. The computer device may include more components than the above, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.

[0088] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer.

[0089] Embodiment 5

[0090] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for converting columns of data in the openPlant real-time database to rows are implemented, for example, including: obtaining data in the openPlant real-time database according to query conditions; merging the obtained data in the openPlant real-time database to form several rows of data; sorting each row of data; assembling each row of data according to the sorting result and sending it to the front end; displaying each row of data through the front end. Specifically, the computer-readable storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. The volatile memory may include random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include read-only memory (ROM), hard disk, flash memory, optical disk, magnetic disk, etc.

[0091] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0092] Based on this understanding, the present invention implements all or part of the process in the above-mentioned method of automatically detecting task status and starting and stopping, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of the above-mentioned method of converting data columns to rows in the openPlant real-time database can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or preset intermediate form, etc.

[0093] It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electrical carrier signals and telecommunication signals.

[0094] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0095] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for converting data columns into rows in an openPlant real-time database, characterized in that: include: Obtain data from the openPlant real-time database based on query conditions; Merge the acquired data in the openPlant real-time database to form several rows of data; Sort each row of data; According to the sorting results, each row of data is assembled and sent to the front end.

2. The method for converting data columns into rows in an openPlant real-time database according to claim 1, characterized in that: The query conditions include start and end time, device ID and measurement point.

3. The method for converting data columns into rows in an openPlant real-time database according to claim 1, characterized in that: The data in the openPlant real-time database is real-time data or historical data.

4. The method for converting data columns into rows in an openPlant real-time database according to claim 1, characterized in that: The process of sorting each row of data is as follows: Sort each row of data by device or time.

5. The method for converting data columns into rows in an openPlant real-time database according to claim 1, characterized in that: A row of data includes data from multiple measurement points of the same device at the same time.

6. The method for converting data columns to rows in an openPlant real-time database according to claim 1, characterized in that: Also includes: The rows of data are displayed through the front end.

7. The method for converting data columns to rows in an openPlant real-time database according to claim 1, characterized in that: The process of merging the data obtained in the openPlant real-time database is as follows: The data in the openPlant real-time database are grouped and merged according to timestamps and device GNs.

8. A system for converting data columns into rows in an openPlant real-time database, characterized in that: include: The acquisition module is used to obtain data from the openPlant real-time database according to the query conditions; A merging module is used to merge the data acquired from the openPlant real-time database to form several rows of data; Sorting module, used to sort each row of data; The assembly module is used to assemble each row of data according to the sorting result and send it to the front end.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for converting columns and rows of data in the openPlant real-time database as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for converting columns and rows of data in an openPlant real-time database as described in any one of claims 1 to 7 are implemented.