Paging query calculation method, system and equipment based on openPlant real-time database according to measuring points or equipment, and medium

By using the paginated query method of the openPlant real-time database, the page lag problem caused by large-volume data queries is solved, achieving fast response and efficient data observation, which is suitable for data analysis in new energy systems.

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

Patent Information

Application Number
CN202411043651.9
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

In the new energy industry, large-scale data queries in the openPlant real-time database cause page lag, especially when maintenance or implementation personnel analyze equipment data. Existing technologies struggle to process large amounts of real-time or historical data within millisecond-level response times.

Method used

The method of pagination query by measurement point or device based on the OpenPlant real-time database is adopted. By obtaining the query conditions, calculating the data volume, and judging whether it is greater than the preset value, if it is greater, the number of devices and measurement points are separated, the total number of records is calculated, and the start and end times are calculated according to the query conditions and the total number of records for pagination query, converting the data into row data and dividing it into N records per page.

Benefits of technology

It effectively avoids page lag during data querying, improves the efficiency of data observation and analysis, and meets the needs of rapid response in new energy systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964406A_ABST
    Figure CN118964406A_ABST
Patent Text Reader

Abstract

The invention discloses an openPlant real-time database-based paging query calculation method and system according to measurement points or equipment, equipment and a medium. The method comprises the following steps of: obtaining a query condition; calculating a data volume according to the query condition; judging whether the data volume is greater than or equal to a preset value; when the data volume is smaller than a preset value, the total number of the data volume is calculated; when the data volume is greater than or equal to a preset value, separating the number of the devices and the measuring points to enable the data volume to be smaller than the preset value, and then calculating the total number of the devices; according to the query condition and the total number of pieces, calculating the start time and the end time of querying the N pieces of data in one page; performing data query according to the step length in the query condition and the calculated starting time and ending time, and converting the queried data into row data; and dividing the row data into N pieces of data in one page. The method, the system, the equipment and the medium can avoid the problem of page lagging in the data query process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of data processing, and relates to a paging query calculation method, system, equipment and medium based on an openPlant real-time database by measuring point or equipment. Background Art

[0002] Real-time database is a common technology in the new energy industry, used to process large amounts of real-time data. Since the amount of data in the new energy industry is huge and changes frequently, higher requirements are placed on the performance and scalability of real-time databases.

[0003] Faced with large amounts of data in the openPlant real-time database, when operation and maintenance or implementation personnel analyze equipment data, they need to query a large amount of real-time or historical data. The new energy system has many functions, and the page response needs to reach milliseconds. Querying a large amount of data at one time will cause problems such as page freezes. Summary of the invention

[0004] 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 paging query calculation by measuring point or equipment based on the openPlant real-time database. The method, system, device and medium can avoid the page jamming problem that occurs during the data query process.

[0005] To achieve the above object, the present invention provides a paging query calculation method based on an openPlant real-time database by measuring point or equipment, including:

[0006] Get the query conditions;

[0007] Calculate the data volume according to the query condition;

[0008] Determining whether the data volume is greater than or equal to a preset value;

[0009] When the data volume is less than the preset value, the total number of items is calculated; when the data volume is greater than or equal to the preset value, the number of devices and the measuring points are separated so that the data volume is less than the preset value, and then the total number of items is calculated;

[0010] According to the query conditions and the total number of records, calculate the start time and end time of querying one page of N records;

[0011] Query data based on the step length in the query condition and the calculated start time and end time, and convert the queried data into row data;

[0012] The row data is divided into N pieces of data per page.

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

[0014] Furthermore, the data volume=(end time-start time)*step length*number of devices.

[0015] Furthermore, the preset value is 14.4w.

[0016] Furthermore, end time = start time + step length * page size.

[0017] Furthermore, according to the paging parameters, the row data is divided into 20 pieces of data per page.

[0018] Furthermore, the paging parameters include the current page, the total number of entries and the page size.

[0019] The present invention provides a paging query calculation system based on an openPlant real-time database by measuring point or equipment, comprising:

[0020] The acquisition module is used to obtain the query conditions;

[0021] A first calculation module, used to calculate the data volume according to the query condition;

[0022] A judging module, used to judge whether the data volume is greater than or equal to a preset value;

[0023] A second calculation module is used to calculate the total number of items when the data volume is less than a preset value; when the data volume is greater than or equal to the preset value, separate the number of devices and measuring points so that the data volume is less than the preset value, and then calculate the total number of items;

[0024] The third calculation module is used to calculate the start time and end time of querying one page of N data according to the query conditions and the total number of data;

[0025] The query module is used to query data according to the step length in the query condition and the calculated start time and end time, and convert the queried data into row data;

[0026] The segmentation module is used to segment the row data into a page of N pieces of data.

[0027] The computer device of the present invention 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 paging query calculation method based on the openPlant real-time database by measuring point or equipment are implemented.

[0028] The computer-readable storage medium of the present invention stores a computer program, and when the computer program is executed by a processor, the steps of the paging query calculation method based on the openPlant real-time database by measuring point or equipment are implemented.

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

[0030] The method, system, device and medium for paging query calculation by measuring point or equipment based on the openPlant real-time database described in the present invention calculate the data volume according to the query conditions during specific operation. When the data volume is greater than a preset value, the number of devices and measuring points queried at one time are separated to avoid excessive data volume in one query. In addition, the present invention converts the queried data into row data, and divides the row data into N data items on a page to avoid jamming when there are many pages, which is more conducive to the observation and analysis of data by operation and maintenance and real-time personnel. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] 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:

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

[0033] 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.

[0034] 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.

[0035] 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.

[0036] 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.

[0037] 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.

[0038] 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.

[0039] 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.

[0040] 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.

[0041] Embodiment 1

[0042] refer to Figure 1 The paging query calculation method based on the openPlant real-time database by measuring point or equipment of the present invention comprises the following steps:

[0043] 1) Obtain query conditions;

[0044] The query conditions include start time, end time, step length, device ID and measurement point;

[0045] 2) Calculating the data volume according to the query condition;

[0046] It should be noted that the data volume = (end time - start time) * step length * number of devices, and the start time, end time and step length are all in seconds;

[0047] 3) Determine whether the data volume is greater than or equal to a preset value. When the data volume is less than the preset value, go to step 5). When the data volume is greater than or equal to the preset value, go to step 4). The preset value is 14.4w.

[0048] According to the number of devices, every 100 devices are divided into a group to prevent too many devices and measuring points, which will make the SQL too long. The query is then divided into one piece, and then the data volume is queried to make the data volume less than the preset value.

[0049] 5) Query the total number of items according to the query conditions, divide multiple device IDs into 10 parts, and if less than 10, use the number of devices, and loop the thread to query the number of items in each device, and calculate the total number by accumulating the number of devices. Among them, the thread query is based on the device level, which will be faster when querying multiple devices and more data, and a small amount of data can be directly queried.

[0050] 6) According to the query start time, query end time, step length, paging parameters, and total number of entries, calculate the start time and end time of the 20 entries in a page, where end time = start time + step length * page size;

[0051] 7) According to the step length in the query condition and the start time and end time calculated in step 6), perform data query in the openPlant real-time database and convert the queried data into row data;

[0052] 8) Using paging parameters, the row data is divided into 20 data items per page.

[0053] The paging parameters include the current page, the total number of entries and the page size.

[0054] Embodiment 2

[0055] The data parameters of this embodiment are:

[0056] Page size: 10

[0057] Start time: 2023-11-7 00:00:00

[0058] End time: 2023-11-7 00:30:00

[0059] Step length: 60s

[0060] Device id: 1,2

[0061] Measuring point: EK, DS

[0062] The total number of items is 63

[0063] Calculate the start and end time of 10 data items on a page according to the query conditions

[0064] Start time: 2023-11-7 00:00:00

[0065] End time: 2023-11-7 00:04:00

[0066] Query sql:

[0067] select GN,AV,TM from Archive where GN in

[0068] ('W3.XR.SD_HK_1_001_EK','W3.XR.SD_HK_1_001_DS','W3.XR.SD_HK_1_002_EK','W3.XR.SD_HK_1_002_DS')

[0069] and mode='span'and interval='60s'

[0070] and TM>='2023-11-7 00:00:00'and TM<='2023-11-7 00:04:00';

[0071] The query time in sql is only 4 minutes, and the step length is 1 minute, so the amount of data after the query is very small, just one page of data, and different from the mysql common limit query, it is faster and more efficient.

[0072] The query results are shown in Table 1:

[0073] Table 1

[0074]

[0075] According to the data shown in Table 1, it can be seen that:

[0076] Although the query time of the initial condition is 2023-11-7 00:00:00 to 2023-11-7

[0077] 00:30:00 is half an hour, but only 10 pages need to be displayed on one page. The actual query time is only 4 minutes. You can click the next page later.

[0078] The present invention pages the data of the openPlant real-time database. First, the time range of a page is determined according to the number of items displayed on a page, the query time and the number of devices. No matter how many items of total data there are, a function page can display up to 20 items. Then, the key parameter is determined as the TM time range according to the number of devices to be queried and the step size, and then the column data is converted into row data.

[0079] The present invention is different from the paging query limit method of ordinary MySQL. Among them, penPlant belongs to column storage and is not suitable for device-level paging query. MySQL is row storage, and limit can be directly called. However, when the amount of data is too large, the limit parameter will also be larger, which will cause performance problems and memory usage will also increase. In the face of a large amount of data, according to the actual display of the page, the limit parameter is changed to TM, which avoids jamming when there are many pages, and is more conducive to the observation and analysis of data by operation and maintenance and real-time personnel.

[0080] Embodiment 3

[0081] The present invention provides a paging query calculation system based on an openPlant real-time database by measuring point or equipment, comprising:

[0082] The acquisition module is used to obtain the query conditions;

[0083] A first calculation module, used to calculate the data volume according to the query condition;

[0084] A judging module, used to judge whether the data volume is greater than or equal to a preset value;

[0085] A second calculation module is used to calculate the total number of items when the data volume is less than a preset value; when the data volume is greater than or equal to the preset value, separate the number of devices and measuring points so that the data volume is less than the preset value, and then calculate the total number of items;

[0086] The third calculation module is used to calculate the start time and end time of querying one page of N data according to the query conditions and the total number of data;

[0087] The query module is used to query data according to the step length in the query condition and the calculated start time and end time, and convert the queried data into row data;

[0088] The segmentation module is used to segment the row data into a page of N pieces of data.

[0089] As an implementation manner of the present invention, the query conditions include a start time, an end time, a step length, a device ID and a measurement point.

[0090] As an implementation manner of the present invention, the data volume=(end time-start time)*step length*number of devices.

[0091] As an implementation manner of the present invention, the preset value is 14.4w.

[0092] As an implementation manner of the present invention, end time=start time+step length*page size.

[0093] As an implementation manner of the present invention, the row data is divided into 20 pieces of data per page according to the paging parameters.

[0094] As an implementation manner of the present invention, the paging parameters include the current page, the total number of entries and the page size.

[0095] 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.

[0096] Embodiment 3

[0097] 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 paging query calculation method based on the openPlant real-time database by measuring point or equipment are implemented, for example, comprising: obtaining query conditions; calculating the data volume according to the query conditions; judging whether the data volume is greater than or equal to a preset value; when the data volume is less than the preset value, calculating the total number of items; when the data volume is greater than or equal to the preset value, separating the number of equipment and measuring points so that the data volume is less than the preset value, and then calculating the total number of items; calculating the start time and end time of querying a page of N items of data according to the query conditions and the total number of items; querying data according to the step size in the query conditions and the calculated start time and end time, and converting the queried data into row data; dividing the row data into a page of N items of data. The memory may include a memory, such as a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk memory, etc. The processor, network interface, and memory are interconnected through an internal bus, and the internal bus may be an industrial standard architecture bus, a peripheral component interconnection standard bus, an extended industrial standard architecture bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory is used to store programs. Specifically, the program may include a program code, and the program code includes computer operation instructions. The memory may include a memory and a non-volatile memory, and provide instructions and data to the processor.

[0098] Embodiment 4

[0099] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the paging query calculation method based on the openPlant real-time database by measuring point or equipment are implemented, for example, including: obtaining query conditions; calculating the amount of data according to the query conditions; judging whether the amount of data is greater than or equal to a preset value; when the amount of data is less than the preset value, calculating the total number of items; when the amount of data is greater than or equal to the preset value, separating the number of equipment and measuring points so that the amount of data is less than the preset value, and then calculating the total number of items; calculating the start time and end time of querying a page of N items of data according to the query conditions and the total number of items; performing data query according to the step size in the query conditions and the calculated start time and end time, and converting the queried data into row data; dividing the row data into a page of N items of data. 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.

[0100] 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.

[0101] 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.

[0102] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0103] 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.

[0104] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and disclosure of the invention. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0105] It should be understood that the present invention is not limited to the exact construction that has 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 invention is limited only by the appended claims.

[0106] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A paging query calculation method based on openPlant real-time database by measuring point or equipment, characterized in that: include: Get the query conditions; Calculate the data volume according to the query condition; Determining whether the data volume is greater than or equal to a preset value; When the data volume is less than the preset value, the total number of items is calculated; when the data volume is greater than or equal to the preset value, the number of devices and the measuring points are separated so that the data volume is less than the preset value, and then the total number of items is calculated; According to the query conditions and the total number of records, calculate the start time and end time of querying one page of N records; Query data based on the step length in the query condition and the calculated start time and end time, and convert the queried data into row data; The row data is divided into N pieces of data per page.

2. The paging query calculation method based on the openPlant real-time database by measuring point or equipment according to claim 1 is characterized in that: The query conditions include start time, end time, step length, device ID and measurement point.

3. The paging query calculation method based on the openPlant real-time database by measuring point or equipment according to claim 1 is characterized in that: The data volume = (end time - start time) * step length * number of devices.

4. The paging query calculation method based on the openPlant real-time database by measuring point or equipment according to claim 1 is characterized in that: The preset value is 14.4w.

5. The paging query calculation method based on openPlant real-time database by measuring point or equipment according to claim 1 is characterized in that: End time = start time + step length * page size.

6. The paging query calculation method based on openPlant real-time database by measuring point or equipment according to claim 1 is characterized in that: According to the paging parameters, the row data is divided into 20 pieces of data per page.

7. The paging query calculation method based on openPlant real-time database by measuring point or equipment according to claim 6 is characterized in that: The paging parameters include the current page, the total number of entries and the page size.

8. A paging query and calculation system based on openPlant real-time database by measuring point or equipment, characterized in that: include: The acquisition module is used to obtain the query conditions; A first calculation module, used to calculate the data volume according to the query condition; A judging module, used to judge whether the data volume is greater than or equal to a preset value; A second calculation module is used to calculate the total number of items when the data volume is less than a preset value; when the data volume is greater than or equal to the preset value, separate the number of devices and measuring points so that the data volume is less than the preset value, and then calculate the total number of items; The third calculation module is used to calculate the start time and end time of querying one page of N data according to the query conditions and the total number of data; The query module is used to query data according to the step length in the query condition and the calculated start time and end time, and convert the queried data into row data; The segmentation module is used to segment the row data into a page of N pieces of data.

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 paging query calculation method based on the openPlant real-time database by measuring point or equipment are implemented as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, the steps of the paging query calculation method based on the openPlant real-time database by measuring point or equipment are implemented as described in any one of claims 1 to 7.