Method, system, device and medium for optimizing access efficiency of real-time library

By designing suitable data structures and relational tables, the historical data of the real-time database is converted and stored into the relational database, solving the problem of low access efficiency of historical data in the real-time supervision system, and achieving faster web page access speed and better user experience.

CN114595276BActive Publication Date: 2025-04-25XIAN THERMAL POWER RES INST CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210256205.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-16
Publication Date
2025-04-25
Estimated Expiration
2042-03-16

AI Technical Summary

Technical Problem

In the real-time supervision system, the long time span and high data density of historical data lead to low real-time database access efficiency, which in turn makes the web page query time too long and the display performance is poor.

Method used

A data structure is designed, including fan number, label name, timestamp, 15-minute interpolation and per-minute interpolation, and multiple relationship tables of the same structure are created in MySQL. The historical data of the previous day's real-time database is converted into the relational database according to the relational table at a fixed time every day, and dynamically select the best query statement to return the data set required by the web page.

Benefits of technology

By reducing the number and frequency of access to real-time databases, the access pressure of real-time databases is reduced, the stability of the real-time supervision system and the speed of web page access is improved, thereby improving the user's query experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114595276B_ABST
    Figure CN114595276B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device and medium for optimizing access efficiency for a real-time library, a new relational database TPRIHistInterp is created in MySQL; a data structure composed of key information of the real-time database is designed according to the business requirements of the real-time supervision system; multiple relational tables with the same structure are created in the relational database TPRIHistInterp according to the data structure; a label mask required by the real-time supervision system business is configured, and the historical data of the real-time database of the previous day is converted and stored in the relational database according to the relational table at a fixed time every day; when the real-time supervision system Web page calls a background query service, the query service dynamically selects the best query statement in the relational database according to the query time range, and returns the data set required by the Web page. The present invention optimizes the speed of accessing the Web page of the real-time supervision system, thereby greatly improving the query experience of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data processing, and in particular relates to a method, system, device and medium for optimizing access efficiency of a real-time library. Background Art

[0002] In the process of developing real-time monitoring systems for power companies, it is necessary to frequently access data in real-time databases. Currently, the Rython real-time database is commonly used in real-time monitoring systems. Although the Rython real-time database provides a rich data access interface for real-time monitoring systems, in actual applications, when the historical data access time span is long and the data density is high, it will cause the query time of the real-time monitoring system Web page to be too long and the display performance to be poor. Summary of the invention

[0003] The purpose of the present invention is to provide a method, system, device and medium for optimizing access efficiency for a real-time database, so as to overcome the problem that direct access to historical data with a long time span and high data density in a real-time database leads to long query time and poor display performance of the web page of the real-time supervision system. The present invention optimizes the speed of access to the web page of the real-time supervision system, thereby greatly improving the query experience of users.

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

[0005] A method for optimizing access efficiency for a real-time library, the method comprising:

[0006] Create a new relational database TPRIHistInterp in MySQL;

[0007] Design a data structure consisting of key information of the real-time database according to the business requirements of the real-time monitoring system;

[0008] Create multiple relational tables with the same structure in the relational database TPRIHistInterp according to the data structure;

[0009] Configure the label mask required by the real-time monitoring system business, and convert the historical data of the real-time database of the previous day into the relational database according to the relational table at a fixed time every day;

[0010] When the real-time monitoring system web page calls the background query service, the query service dynamically selects the best query statement in the relational database according to the query time range and returns the data set required by the web page.

[0011] Furthermore, the data structure includes a wind turbine number, a tag name, a timestamp, a 15-minute interpolation value, and a per-minute interpolation value.

[0012] Furthermore, the number of the relationship tables is equal to the number of wind turbines in the wind farm; and the name of the relationship table is composed of the wind farm pinyin code and the wind turbine number.

[0013] Furthermore, the tag mask required by the real-time monitoring system business is configured, and the historical data of the real-time database of the previous day is converted and stored in the relational database according to the relational table at a fixed time every day, specifically:

[0014] Configure the label mask *.UT.N#US_W_G required by the real-time monitoring system service;

[0015] Obtain the wind farm pinyin code and wind turbine number, and use the wind farm pinyin code and wind turbine number to replace * and # in the label mask respectively;

[0016] The real-time database interpolation method is used to obtain 1440 pieces of data per minute of the wind turbine starting from zero o'clock the previous day;

[0017] Divide the 1440 data into 96 parts at intervals of 15 minutes, save the first value of each part into the IntervalVal field, and save the 15 values ​​of each part separated by semicolons into the MinutesVal field to form a relational table corresponding to the fan number;

[0018] The above process is repeated to obtain the relational table corresponding to each fan number and form a relational database.

[0019] A system that optimizes access efficiency for real-time libraries, including:

[0020] Relational database TPRIHistInterp creation module: used to create a new relational database TPRIHistInterp in MySQL;

[0021] Data structure design module: used to design the data structure composed of key information of the real-time database according to the business requirements of the real-time supervision system;

[0022] Relation table creation module: used to create multiple relation tables with the same structure in the relational database TPRIHistInterp according to the data structure;

[0023] Conversion and storage module: used to configure the label mask required by the real-time supervision system business, and convert the historical data of the real-time database of the previous day into the relational database according to the relational table at a fixed time every day;

[0024] Access module: When the real-time monitoring system web page calls the background query service, the query service dynamically selects the best query statement in the relational database according to the query time range and returns the data set required by the web page.

[0025] Furthermore, the data structure includes a wind turbine number, a tag name, a timestamp, a 15-minute interpolation value, and a per-minute interpolation value.

[0026] Furthermore, the number of the relationship tables is equal to the number of wind turbines in the wind farm; and the name of the relationship table is composed of the wind farm pinyin code and the wind turbine number.

[0027] Furthermore, the conversion storage module includes:

[0028] Label mask configuration module: used to configure the label mask *.UT.N#US_W_G required by the real-time monitoring system business;

[0029] Replacement module: used to obtain the wind farm pinyin code and wind turbine number, and use the wind farm pinyin code and wind turbine number to replace * and # in the label mask respectively;

[0030] Data acquisition module: used to obtain 1440 pieces of data per minute of the fan starting from zero o'clock the previous day through the real-time library interpolation method;

[0031] Data processing module: used to divide 1440 data into 96 parts at intervals of 15 minutes, save the first value of each part to the IntervalVal field, and save the 15 values ​​of each part separated by semicolons to the MinutesVal field to form a relational table corresponding to the fan number;

[0032] Relational database establishment module: used to loop through the processes of the label mask configuration module, the replacement module and the data processing module, obtain the relationship table corresponding to each fan number, and form a relational database.

[0033] 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 optimizing access efficiency for a real-time library are implemented.

[0034] A computer-readable storage medium stores a computer program, which implements the steps of the method for optimizing access efficiency for a real-time library when executed by a processor.

[0035] Compared with the prior art, the present invention has the following beneficial technical effects:

[0036] According to the business needs of the real-time supervision system, the present invention designs a new data structure composed of key information of the real-time database, and regularly converts the historical data of the real-time database into a relational database according to the new data structure. The access to the relational database greatly reduces the number and frequency of real-time database access, alleviates the pressure of real-time database access, improves the stability of the real-time supervision system, and also optimizes the speed of system Web page access, thereby greatly improving the user's query experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The drawings in the specification are used to provide further understanding of the present invention and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0038] Figure 1 is a flow chart of the method of the present invention;

[0039] Figure 2 It is a system structure diagram of the present invention;

[0040] Figure 3 It is a relational database TPRIHistInterp;

[0041] Figure 4 It is a data conversion flow chart;

[0042] Figure 5 This is the data of the NRF1_001 table after conversion. DETAILED DESCRIPTION

[0043] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 only 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 should fall within the scope of protection of the present invention.

[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0045] A method for optimizing access efficiency for a real-time library comprises the following steps:

[0046] Step 1: Create a new relational database TPRIHistInterp in MySQL.

[0047] Step 2: According to the business requirements of the real-time monitoring system, a data structure consisting of key information of the real-time database is designed. The data structure (as shown in Table 1) includes fan number, tag name, timestamp, 15-minute interpolation and every-minute interpolation.

[0048] Table 1 Data structure composition

[0049]

[0050]

[0051] Step 3: Create multiple relational tables with the same structure in TPRIHistInterp according to the data structure described in step 2. The number of relational tables is created according to the number of wind turbines in the wind farm. The name of the relational table is composed of the wind turbine pinyin code plus the wind turbine number. For example, NRF1_001 represents the relational table of wind turbine No. 1 in Naren Wind Farm. Naren Wind Farm currently has 58 wind turbines. 58 relational tables need to be created in the TPRIHistInterp relational database, such as Figure 3 shown.

[0052] Step 4: Configure the label mask required by the business, and use the self-developed computing station scheduling to convert the historical data of the previous day's real-time database into a relational database according to the relational table at a fixed time every day. The specific process is as follows: Figure 4 :

[0053] Step 4.1: Configure the label mask and power (*.UT.N#US_W_G) required by the service.

[0054] Step 4.2: Obtain the pinyin code of the wind farm and the wind turbine number, and use the pinyin code of the wind farm and the wind turbine number to replace * and # in the label mask respectively; for example: the pinyin code of the Naren wind farm is NRF1, and the number of wind turbine 1 is 001, and the power point of wind turbine No. 1 in the Naren wind farm is generated as NRF1.UT.N001US_W_G;

[0055] Step 4.3: Through the self-developed computer station scheduling, according to the interpolation method of the real-time database, obtain 1440 data of the fan every minute starting from zero o'clock the previous day, divide the 1440 data into 96 parts at intervals of 15 minutes, save the first value of each part to the IntervalVal field, and save the 15 values ​​of each part separated by semicolons to the MinutesVal field, and save them to the NRF1_001 data table. Figure 5 As shown, one fan has one tag with 96 records per day, and a total of 35,040 records per year.

[0056] Step 5: The real-time monitoring system web page calls the background query service. The query service dynamically selects the best data field for the web page to use based on the query time range. For example, the web page displays the power curve of the wind turbine. When the query time is less than or equal to 3 months, the data of the MinutesVal field is returned. When the query time is about 3 months, the data of the IntervalVal field is returned.

[0057] The present invention also provides a system for optimizing access efficiency for a real-time library, such as Figure 2 ,include:

[0058] Relational database TPRIHistInterp creation module: used to create a new relational database TPRIHistInterp in MySQL;

[0059] Data structure design module: used to design the data structure composed of key information of the real-time database according to the business requirements of the real-time supervision system;

[0060] Relation table creation module: used to create multiple relation tables with the same structure in the relational database TPRIHistInterp according to the data structure;

[0061] Conversion and storage module: used to configure the label mask required by the real-time supervision system business, and convert the historical data of the real-time database of the previous day into the relational database according to the relational table at a fixed time every day;

[0062] Access module: When the real-time monitoring system web page calls the background query service, the query service dynamically selects the best query statement in the relational database according to the query time range and returns the data set required by the web page.

[0063] Among them, the conversion storage module includes:

[0064] Label mask configuration module: used to configure the label mask *.UT.N#US_W_G required by the real-time monitoring system business;

[0065] Replacement module: used to obtain the wind farm pinyin code and wind turbine number, and use the wind farm pinyin code and wind turbine number to replace * and # in the label mask respectively;

[0066] Data acquisition module: used to obtain 1440 pieces of data per minute of the fan starting from zero o'clock the previous day through the real-time library interpolation method;

[0067] Data processing module: used to divide 1440 data into 96 parts at intervals of 15 minutes, save the first value of each part to the IntervalVal field, and save the 15 values ​​of each part separated by semicolons to the MinutesVal field to form a relational table corresponding to the fan number;

[0068] Relational database establishment module: used to loop through the processes of the label mask configuration module, the replacement module and the data processing module, obtain the relationship table corresponding to each fan number, and form a relational database.

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

[0070] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 produce 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.

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

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

[0073] 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 its protection scope. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that after reading the present invention, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the pending claims of the invention.

Claims

1. A method for optimizing access efficiency for a real-time library, characterized in that: The method comprises: Create a new relational database in MySQL; Design a data structure consisting of key information of the real-time database according to the business requirements of the real-time monitoring system; According to the data structure, multiple relational tables with the same structure are created in the relational database, wherein the number of the relational tables is equal to the number of wind turbines in the wind farm; the name of the relational table is composed of the wind farm pinyin code and the wind turbine number; Configure the label mask required by the real-time monitoring system business, and convert the historical data of the real-time database of the previous day into the relational database according to the relational table at a fixed time every day. Specifically: Configure the label mask *.UT.N#US_W_G required by the real-time monitoring system service; Obtain the wind farm pinyin code and wind turbine number, and use the wind farm pinyin code and wind turbine number to replace * and # in the label mask respectively; The real-time database interpolation method is used to obtain 1440 pieces of data per minute of the wind turbine starting from zero o'clock the previous day; Divide the 1440 data into 96 parts at intervals of 15 minutes, save the first value of each part into the IntervalVal field, and save the 15 values ​​of each part separated by semicolons into the MinutesVal field to form a relational table corresponding to the fan number; The above process is repeated to obtain the relational table corresponding to each fan number, forming a relational database; When the real-time monitoring system web page calls the background query service, the query service dynamically selects query statements in the relational database according to the query time range and returns the data set required by the web page.

2. The method for optimizing access efficiency for a real-time library according to claim 1, characterized in that: The data structure includes a wind turbine number, a tag name, a timestamp, a 15-minute interpolation value, and a per-minute interpolation value.

3. A system for optimizing access efficiency for real-time libraries, characterized in that: include: Relational database creation module: used to create a new relational database in MySQL; Data structure design module: used to design the data structure composed of key information of the real-time database according to the business requirements of the real-time supervision system; Relation table creation module: used to create multiple relationship tables with the same structure in the relationship database according to the data structure, the number of the relationship tables is equal to the number of wind turbines in the wind farm; the name of the relationship table is composed of the wind farm pinyin code and the wind turbine number; Conversion and storage module: used to configure the label mask required by the real-time monitoring system business, and convert the historical data of the real-time database of the previous day into the relational database according to the relational table at a fixed time every day; Access module: When the real-time monitoring system Web page calls the background query service, the query service dynamically selects the query statement in the relational database according to the query time range and returns the data set required by the Web page; The conversion storage module comprises: Label mask configuration module: used to configure the label mask *.UT.N#US_W_G required by the real-time monitoring system business; Replacement module: used to obtain the wind farm pinyin code and wind turbine number, and use the wind farm pinyin code and wind turbine number to replace * and # in the label mask respectively; Data acquisition module: used to obtain 1440 pieces of data per minute of the fan starting from zero o'clock the previous day through the real-time library interpolation method; Data processing module: used to divide 1440 data into 96 parts at intervals of 15 minutes, save the first value of each part to the IntervalVal field, and save the 15 values ​​of each part separated by semicolons to the MinutesVal field to form a relational table corresponding to the fan number; Relational database establishment module: used to loop through the processes of the label mask configuration module, the replacement module and the data processing module, obtain the relationship table corresponding to each fan number, and form a relational database.

4. The system for optimizing access efficiency for real-time libraries according to claim 3, characterized in that: The data structure includes a wind turbine number, a tag name, a timestamp, a 15-minute interpolation value, and a per-minute interpolation value.

5. 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 optimizing access efficiency for a real-time library as claimed in claim 1 or 2 are implemented.

6. 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 optimizing access efficiency for a real-time library as claimed in claim 1 or 2 are implemented.

Citation Information

Patent Citations

  • Method for performing transactions on data and a transactional database

    US20130110766A1