CN113742344A - Method and device for indexing power system data - Google Patents
Method and device for indexing power system data Download PDFInfo
- Publication number
- CN113742344A CN113742344A CN202111020093.0A CN202111020093A CN113742344A CN 113742344 A CN113742344 A CN 113742344A CN 202111020093 A CN202111020093 A CN 202111020093A CN 113742344 A CN113742344 A CN 113742344A
- Authority
- CN
- China
- Prior art keywords
- target
- data
- power system
- key
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000013507 mapping Methods 0.000 claims abstract description 36
- 230000015654 memory Effects 0.000 claims description 23
- 238000012216 screening Methods 0.000 claims description 5
- 238000013523 data management Methods 0.000 abstract description 12
- 238000001514 detection method Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 2
- 239000003814 drug Substances 0.000 description 2
- 230000002349 favourable effect Effects 0.000 description 2
- 238000007405 data analysis Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/06—Energy or water supply
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Business, Economics & Management (AREA)
- Economics (AREA)
- Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Human Resources & Organizations (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Public Health (AREA)
- Water Supply & Treatment (AREA)
- General Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Marketing (AREA)
- Primary Health Care (AREA)
- Strategic Management (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses an indexing method and a device for power system data, wherein the method comprises the following steps: acquiring target power system data; mapping the target power system data to generate a key-value data table; determining a target retrieval element; and determining corresponding target retrieval data from the key-value data table according to the target retrieval elements to obtain an index table comprising the target retrieval elements and the corresponding target retrieval data. Therefore, the index can be generated from the key value data table corresponding to the power system data according to the retrieval elements, so that the power system data can be integrated and combed again according to the data characteristics of the power system, the index efficiency during subsequent data retrieval can be improved, and more intelligent power system data management can be realized.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to an indexing method and device for power system data.
Background
With the improvement of the informatization degree of the power system, the data volume of the power system is increasing day by day, and the data analysis task for the data of the power system is heavier and heavier, so that the problem of reasonably and efficiently managing the data of the power system is inevitably caused.
In the prior art, management of power system data is usually limited to acquisition and query of power system data, and how to combine characteristics of power system data to effectively index power system data is not considered, so as to facilitate subsequent retrieval. Therefore, the defects of the prior art are found to be urgently solved.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide an indexing method and apparatus for power system data, which can generate an index from a key value data table corresponding to the power system data according to a search element, so that the power system data can be re-integrated and sorted according to the data characteristics of the power system, which is beneficial to improving the index efficiency when subsequently performing data search, and further, more intelligent power system data management is realized.
In order to solve the technical problem, a first aspect of the present invention discloses an indexing method for power system data, including:
acquiring target power system data;
mapping the target power system data to generate a key-value data table;
determining a target retrieval element;
and determining corresponding target retrieval data from the key-value data table according to the target retrieval elements to obtain an index table comprising the target retrieval elements and the corresponding target retrieval data.
As an optional implementation manner, in the first aspect of the present invention, the mapping the target power system data to generate a key-value data table includes:
determining a plurality of target data values and corresponding data types in the target power system data;
and mapping the target power system data to generate a key-value data table according to a plurality of target data values in the target power system data and corresponding data types.
As an optional implementation manner, in the first aspect of the present invention, the determining a plurality of target data values and corresponding data types in the target power system data includes:
determining a plurality of target data sets in the target power system data;
a plurality of target data values and corresponding data types in each of the target data sets are determined.
As an optional implementation manner, in the first aspect of the present invention, the mapping the target power system data to generate a key-value data table according to a plurality of target data values in the target power system data and corresponding data types includes:
determining a data set identification for each of the target data sets in the target power system data as a first key;
generating a first value from a plurality of target data values and corresponding data types of each target data set;
and combining the corresponding first key and the corresponding first value of each target data set into a first key-value corresponding data to generate a key-value data table comprising a plurality of first key-value corresponding data in a mapping mode.
As an optional implementation manner, in the first aspect of the present invention, the generating a first value from a plurality of target data values and corresponding data types of each of the target data sets includes:
determining any of the target data values in each of the target data sets to be a second value;
determining the data type corresponding to the target data value as a second key;
determining the second key and the second value corresponding to each target data value in each target data set as a second key-value corresponding data;
and determining all the second key-value corresponding data corresponding to each target data set as the first value corresponding to each target data set.
As an optional implementation manner, in the first aspect of the present invention, the determining a target search element includes:
acquiring a history retrieval record; the historical retrieval record comprises retrieval keywords of a plurality of historical time periods;
determining a target retrieval element from the historical retrieval record; the target search element includes one or more of the search keywords.
As an optional implementation manner, in the first aspect of the present invention, the determining a target search element from the history search record includes:
screening out one or more target retrieval keywords with the highest occurrence frequency or higher than a preset frequency threshold from the retrieval keywords of a plurality of historical time periods in the historical retrieval records;
and determining the target search keyword as a target search element.
As an optional implementation manner, in the first aspect of the present invention, the determining, according to the target search element, corresponding target search data from the key-value data table to obtain an index table including the target search element and the corresponding target search data includes:
determining a corresponding target index element from the key-value data table according to the target retrieval element; the target index element comprises one or more of the first key and/or the second key and/or the first value and/or the second value;
determining target information corresponding to the target index element in the key-value data table; the target information comprises key-value data and/or an index address corresponding to the target index element;
and generating an index table according to the target index element and the corresponding target information.
The second aspect of the present invention discloses an indexing apparatus for data of an electric power system, which includes:
the acquisition module is used for acquiring target power system data;
the mapping module is used for mapping the target power system data to generate a key-value data table;
a determination module for determining a target search element;
and the index module is used for determining corresponding target retrieval data from the key-value data table according to the target retrieval elements so as to obtain an index table comprising the target retrieval elements and the corresponding target retrieval data.
As an optional implementation manner, in the second aspect of the present invention, the manner in which the mapping module maps the target power system data to generate the key-value data table includes:
determining a plurality of target data values and corresponding data types in the target power system data;
and mapping the target power system data to generate a key-value data table according to a plurality of target data values in the target power system data and corresponding data types.
As an optional implementation manner, in the second aspect of the present invention, a specific manner of determining a plurality of target data values and corresponding data types in the target power system data by the mapping module includes:
determining a plurality of target data sets in the target power system data;
a plurality of target data values and corresponding data types in each of the target data sets are determined.
As an optional implementation manner, in the second aspect of the present invention, a specific manner in which the mapping module maps the target power system data to generate a key-value data table according to a plurality of target data values and corresponding data types in the target power system data includes:
determining a data set identification for each of the target data sets in the target power system data as a first key;
generating a first value from a plurality of target data values and corresponding data types of each target data set;
and combining the corresponding first key and the corresponding first value of each target data set into a first key-value corresponding data to generate a key-value data table comprising a plurality of first key-value corresponding data in a mapping mode.
As an optional implementation manner, in the second aspect of the present invention, a specific manner of generating a first value by the mapping module from a plurality of target data values and corresponding data types of each of the target data sets includes:
determining any of the target data values in each of the target data sets to be a second value;
determining the data type corresponding to the target data value as a second key;
determining the second key and the second value corresponding to each target data value in each target data set as a second key-value corresponding data;
and determining all the second key-value corresponding data corresponding to each target data set as the first value corresponding to each target data set.
As an optional implementation manner, in the second aspect of the present invention, the specific manner of determining the target search element by the determining module includes:
acquiring a history retrieval record; the historical retrieval record comprises retrieval keywords of a plurality of historical time periods;
determining a target retrieval element from the historical retrieval record; the target search element includes one or more of the search keywords.
As an optional implementation manner, in the second aspect of the present invention, a specific manner of determining a target search element from the history search record by the determining module includes:
screening out one or more target retrieval keywords with the highest occurrence frequency or higher than a preset frequency threshold from the retrieval keywords of a plurality of historical time periods in the historical retrieval records;
and determining the target search keyword as a target search element.
As an optional implementation manner, in the second aspect of the present invention, a specific manner in which the index module determines corresponding target search data from the key-value data table according to the target search element to obtain an index table including the target search element and the corresponding target search data includes:
determining a corresponding target index element from the key-value data table according to the target retrieval element; the target index element comprises one or more of the first key and/or the second key and/or the first value and/or the second value;
determining target information corresponding to the target index element in the key-value data table; the target information comprises key-value data and/or an index address corresponding to the target index element;
and generating an index table according to the target index element and the corresponding target information.
The third aspect of the present invention discloses another indexing apparatus for power system data, the apparatus comprising:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute part or all of the steps in the method for indexing the power system data disclosed by the first aspect of the embodiment of the invention.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, target power system data is acquired; mapping the target power system data to generate a key-value data table; determining a target retrieval element; and determining corresponding target retrieval data from the key-value data table according to the target retrieval elements to obtain an index table comprising the target retrieval elements and the corresponding target retrieval data. Therefore, the index can be generated from the key value data table corresponding to the power system data according to the retrieval elements, so that the power system data can be integrated and combed again according to the data characteristics of the power system, the index efficiency during subsequent data retrieval can be improved, and more intelligent power system data management can be realized.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an indexing method for power system data according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an indexing apparatus for power system data according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of another indexing apparatus for power system data according to an embodiment of the disclosure.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," and the like in the description and claims of the present invention and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, article, or article that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or article.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The invention discloses an indexing method and device for power system data, which can generate indexes from key value data tables corresponding to the power system data according to retrieval elements, so that the power system data can be integrated and combed again according to the data characteristics of a power system, the indexing efficiency during subsequent data retrieval is improved, and more intelligent power system data management is realized. The following are detailed below.
Example one
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating an indexing method for power system data according to an embodiment of the present invention. The method described in fig. 1 may be applied to a corresponding detection terminal, detection device, or detection server, and the server may be a local server or a cloud server. As shown in fig. 1, the method for indexing power system data may include the following operations:
101. target power system data is acquired.
102. And mapping the target power system data to generate a key-value data table.
103. And determining a target retrieval element.
104. And determining corresponding target retrieval data from the key-value data table according to the target retrieval elements to obtain an index table comprising the target retrieval elements and the corresponding target retrieval data.
Therefore, the method described by the embodiment of the invention can generate the index from the key value data table corresponding to the power system data according to the retrieval element, so that the power system data can be integrated and combed again according to the data characteristics of the power system, the index efficiency in subsequent data retrieval is improved, and more intelligent power system data management is realized.
As an optional implementation manner, in the step 102, mapping the target power system data to generate the key-value data table includes:
determining a plurality of target data values and corresponding data types in the target power system data;
and mapping the target power system data to generate a key-value data table according to a plurality of target data values in the target power system data and corresponding data types.
Optionally, the data type may include one or more of a region, a device, a power site, and a device description.
Therefore, by implementing the optional implementation mode, multiple data and data types in the power system data can be mapped to generate the key value data table, so that the power system data can be integrated and combed again according to the data characteristics of the power system, the efficiency of subsequent data acquisition or processing is improved, and more intelligent power system data management is realized.
As an optional implementation manner, in the foregoing step, determining a plurality of target data values and corresponding data types in the target power system data includes:
determining a plurality of target data sets in the target power system data;
a plurality of target data values and corresponding data types in each target data set are determined.
For example, the target power system data may be a data table as shown in table 1 below:
ID | region of land | Power station | Device | Description of the apparatus |
1 | Guangzhou province | C site | Device 1 | AAAAA |
2 | Shenzhen (Shenzhen medicine) | B site | Device 2 | BBBBB |
3 | Pearl sea | Site A | Device 3 | CCCCC |
TABLE 1
It can be seen that, a plurality of rows of data are included in the data, which are three rows of data ID1, 2, and 3, and these three rows of data can be determined as three target data sets, and target data values corresponding to four data types, namely, the region, the equipment, the power station, and the equipment description in the three target data sets are determined.
Therefore, by the optional embodiment, a plurality of target data values and corresponding data types in each of a plurality of target data sets in the target power system data can be determined, so as to facilitate subsequent mapping operations.
As an optional implementation manner, in the foregoing step, mapping the target power system data to generate a key-value data table according to a plurality of target data values in the target power system data and corresponding data types includes:
determining a data set identification for each target data set in the target power system data as a first key;
generating a first value from a plurality of target data values and corresponding data types of each target data set;
and combining the corresponding first key and the first value of each target data set into a first key-value corresponding data to generate a key-value data table comprising a plurality of first key-value corresponding data in a mapping mode.
It can be seen that, according to the optional embodiment, the corresponding first key and the corresponding first value of each target data set can be combined into one piece of first key-value corresponding data to map and generate the key-value data table including a plurality of pieces of first key-value corresponding data, so that the data of the power system can be integrated and combed again according to the data characteristics of the power system, the efficiency of subsequent data acquisition or processing can be improved, and more intelligent data management of the power system can be realized.
As an optional implementation manner, in the above step, generating a first value from a plurality of target data values and corresponding data types of each target data set includes:
determining any target data value in each target data set as a second value;
determining the data type corresponding to the target data value as a second key;
determining a second key and a second value corresponding to each target data value in each target data set as second key-value corresponding data;
and determining all the second key-value corresponding data corresponding to each target data set as the first value corresponding to each target data set.
For example, the target power system data shown in table 1 may be mapped to the following table 2 by implementing the above embodiment:
TABLE 2
Therefore, subsequently, corresponding data can be found only through the corresponding first key or the second key in the first value, the efficiency of data acquisition and retrieval is improved, and the method is favorable for storing relevant model data of the power system in the relational database, and the data needs to be frequently read and written by each application in the system, so that the model data is converted into a key-value structure and stored in the key-value memory database for all applications of the system to read and write, and the problem of bottleneck caused by frequent operation of the relational database is avoided.
As an optional implementation manner, in step 103, determining the target retrieval element includes:
and acquiring a history retrieval record.
Optionally, the history search record includes search keywords of a plurality of history time periods. Alternatively, the historical search records may be search keywords of the current user or all users of the current user group in a plurality of historical time periods. In general, the search keyword is related to or identical to the first key, the second key, the first value or the second value in the above embodiments, and may be all the same or partially the same.
And determining a target retrieval element from the historical retrieval records.
Optionally, the target search element includes one or more search keywords.
Therefore, by the alternative embodiment, the target retrieval element can be determined from the history retrieval record, so that the retrieval element which may be proposed can be determined according to the history retrieval record, and the subsequent index generation is facilitated.
As an optional implementation manner, in the foregoing step, determining the target search element from the history search record includes:
screening out one or more target retrieval keywords with the highest occurrence frequency or the occurrence frequency higher than a preset frequency threshold from the retrieval keywords of a plurality of historical time periods in the historical retrieval records;
and determining the target search keyword as a target search element.
Therefore, through the optional embodiment, one or more target retrieval keywords with the highest occurrence frequency or higher than a preset frequency threshold can be screened from the historical retrieval records as the target retrieval elements, so that the most probable retrieval elements can be determined according to the historical retrieval records, and subsequent index generation is facilitated.
As an optional implementation manner, in step 104, determining corresponding target search data from the key-value data table according to the target search element to obtain an index table including the target search element and the corresponding target search data, includes:
and determining a corresponding target index element from the key-value data table according to the target retrieval element.
Optionally, the target index element may comprise one or more first keys and/or second keys and/or first values and/or second values. That is, the target index element may be any element or combination of any plurality of elements in the key-value data table.
And determining target information corresponding to the target index element in the key-value data table.
Optionally, the target information includes key-value data and/or an index address corresponding to the target index element. For example, when the target index element is a key or a value, the target information may be a value or a key in a pair-wise relationship, and for example, when the target index element is a particular value, the target information may be an index address of the value, and the index address may be a target data set in which the target index element is located.
And generating an index table according to the target index elements and the corresponding target information.
For example, when it is determined that the target search element is a power station, an index table shown in the following table may be generated from this element and the key-value data table shown in table 2:
search element | Object information (corresponding data) | Target information (index address) |
Power station | Site A | Table=3 |
Power station | B site | Table=2 |
Power station | C site | Table=1 |
Therefore, the above embodiment can solve the problem in the prior art that specific retrieval is inconvenient when the power model data is stored in the memory database in the key value form, and then, taking table 2 above as an example, all devices with a power station "B station" are queried, and the query statement is as follows:
select Device from Table where Station ═ YY Station;
the query condition needs to traverse KEY of all the Table prefixes in the KEY value form database, and the performance is low.
After obtaining the corresponding index Table through the above embodiment, the query statement may first search the value memory of Key ═ B site ", then find the content of Key ═ Table-2", and finally obtain the result.
Therefore, through the optional implementation mode, the index table can be generated according to the target index elements and the corresponding target information, the data of the power system can be integrated and combed again according to the data characteristics of the power system, the index efficiency during subsequent data retrieval can be improved, and more intelligent data management of the power system can be realized.
Example two
Referring to fig. 2, fig. 2 is a schematic structural diagram of an index device for power system data according to an embodiment of the present invention. The apparatus described in fig. 2 may be applied to a corresponding detection terminal, a detection device, or a detection server, and the server may be a local server or a cloud server, which is not limited in the embodiment of the present invention. As shown in fig. 2, the apparatus may include:
an obtaining module 201, configured to obtain target power system data;
a mapping module 202, configured to map the target power system data to generate a key-value data table;
a determining module 203, configured to determine a target search element;
the index module 204 is configured to determine corresponding target search data from the key-value data table according to the target search element, so as to obtain an index table including the target search element and the corresponding target search data.
Therefore, the device described by the embodiment of the invention can generate the index from the key value data table corresponding to the power system data according to the retrieval element, so that the power system data can be integrated and combed again according to the data characteristics of the power system, the index efficiency in subsequent data retrieval is improved, and more intelligent power system data management is realized.
As an alternative embodiment, the mapping module 202 maps the target power system data to generate a key-value data table, including:
determining a plurality of target data values and corresponding data types in the target power system data;
and mapping the target power system data to generate a key-value data table according to a plurality of target data values in the target power system data and corresponding data types.
Optionally, the data type may include one or more of a region, a device, a power site, and a device description.
Therefore, by implementing the optional implementation mode, multiple data and data types in the power system data can be mapped to generate the key value data table, so that the power system data can be integrated and combed again according to the data characteristics of the power system, the efficiency of subsequent data acquisition or processing is improved, and more intelligent power system data management is realized.
As an optional implementation, the mapping module 202 determines a specific manner of the plurality of target data values and the corresponding data types in the target power system data, including:
determining a plurality of target data sets in the target power system data;
a plurality of target data values and corresponding data types in each target data set are determined.
For example, the target power system data may be a data table as shown in table 1 below:
ID | region of land | Power station | Device | Description of the apparatus |
1 | Guangzhou province | C site | Device 1 | AAAAA |
2 | Shenzhen (Shenzhen medicine) | B site | Device 2 | BBBBB |
3 | Pearl sea | Site A | Device 3 | CCCCC |
TABLE 1
It can be seen that, a plurality of rows of data are included in the data, which are three rows of data ID1, 2, and 3, and these three rows of data can be determined as three target data sets, and target data values corresponding to four data types, namely, the region, the equipment, the power station, and the equipment description in the three target data sets are determined.
Therefore, by the optional embodiment, a plurality of target data values and corresponding data types in each of a plurality of target data sets in the target power system data can be determined, so as to facilitate subsequent mapping operations.
As an optional implementation manner, the mapping module 202 maps the target power system data to generate a key-value data table according to a plurality of target data values and corresponding data types in the target power system data, including:
determining a data set identification for each target data set in the target power system data as a first key;
generating a first value from a plurality of target data values and corresponding data types of each target data set;
and combining the corresponding first key and the first value of each target data set into a first key-value corresponding data to generate a key-value data table comprising a plurality of first key-value corresponding data in a mapping mode.
It can be seen that, according to the optional embodiment, the corresponding first key and the corresponding first value of each target data set can be combined into one piece of first key-value corresponding data to map and generate the key-value data table including a plurality of pieces of first key-value corresponding data, so that the data of the power system can be integrated and combed again according to the data characteristics of the power system, the efficiency of subsequent data acquisition or processing can be improved, and more intelligent data management of the power system can be realized.
As an alternative embodiment, the specific way for the mapping module 202 to generate a first value from a plurality of target data values and corresponding data types of each target data set includes:
determining any target data value in each target data set as a second value;
determining the data type corresponding to the target data value as a second key;
determining a second key and a second value corresponding to each target data value in each target data set as second key-value corresponding data;
and determining all the second key-value corresponding data corresponding to each target data set as the first value corresponding to each target data set.
For example, the target power system data shown in table 1 may be mapped to the following table 2 by implementing the above embodiment:
TABLE 2
Therefore, subsequently, corresponding data can be found only through the corresponding first key or the second key in the first value, the efficiency of data acquisition and retrieval is improved, and the method is favorable for storing relevant model data of the power system in the relational database, and the data needs to be frequently read and written by each application in the system, so that the model data is converted into a key-value structure and stored in the key-value memory database for all applications of the system to read and write, and the problem of bottleneck caused by frequent operation of the relational database is avoided.
As an alternative embodiment, the determining module 203 determines a specific manner of the target search element, including:
and acquiring a history retrieval record.
Optionally, the history search record includes search keywords of a plurality of history time periods. Alternatively, the historical search records may be search keywords of the current user or all users of the current user group in a plurality of historical time periods. In general, the search keyword is related to or identical to the first key, the second key, the first value or the second value in the above embodiments, and may be all the same or partially the same.
And determining a target retrieval element from the historical retrieval records.
Optionally, the target search element includes one or more search keywords.
Therefore, by the alternative embodiment, the target retrieval element can be determined from the history retrieval record, so that the retrieval element which may be proposed can be determined according to the history retrieval record, and the subsequent index generation is facilitated.
As an alternative implementation, the determining module 203 determines a specific manner of the target search element from the history search record, including:
screening out one or more target retrieval keywords with the highest occurrence frequency or the occurrence frequency higher than a preset frequency threshold from the retrieval keywords of a plurality of historical time periods in the historical retrieval records;
and determining the target search keyword as a target search element.
Therefore, through the optional embodiment, one or more target retrieval keywords with the highest occurrence frequency or higher than a preset frequency threshold can be screened from the historical retrieval records as the target retrieval elements, so that the most probable retrieval elements can be determined according to the historical retrieval records, and subsequent index generation is facilitated.
As an optional implementation manner, the specific manner of determining, by the index module 204, corresponding target search data from the key-value data table according to the target search element to obtain an index table including the target search element and the corresponding target search data includes:
and determining a corresponding target index element from the key-value data table according to the target retrieval element.
Optionally, the target index element may comprise one or more first keys and/or second keys and/or first values and/or second values. That is, the target index element may be any element or combination of any plurality of elements in the key-value data table.
And determining target information corresponding to the target index element in the key-value data table.
Optionally, the target information includes key-value data and/or an index address corresponding to the target index element. For example, when the target index element is a key or a value, the target information may be a value or a key in a pair-wise relationship, and for example, when the target index element is a particular value, the target information may be an index address of the value, and the index address may be a target data set in which the target index element is located.
And generating an index table according to the target index elements and the corresponding target information.
For example, when it is determined that the target search element is a power station, an index table shown in the following table may be generated from this element and the key-value data table shown in table 2:
search element | Object information (corresponding data) | Target information (index address) |
Power station | Site A | Table=3 |
Power station | B site | Table=2 |
Power station | C site | Table=1 |
Therefore, the above embodiment can solve the problem in the prior art that specific retrieval is inconvenient when the power model data is stored in the memory database in the key value form, and then, taking table 2 above as an example, all devices with a power station "B station" are queried, and the query statement is as follows:
select Device from Table where Station ═ YY Station;
the query condition needs to traverse KEY of all the Table prefixes in the KEY value form database, and the performance is low.
After obtaining the corresponding index Table through the above embodiment, the query statement may first search the value memory of Key ═ B site ", then find the content of Key ═ Table-2", and finally obtain the result.
Therefore, through the optional implementation mode, the index table can be generated according to the target index elements and the corresponding target information, the data of the power system can be integrated and combed again according to the data characteristics of the power system, the index efficiency during subsequent data retrieval can be improved, and more intelligent data management of the power system can be realized.
EXAMPLE III
Referring to fig. 3, fig. 3 is a schematic structural diagram of another indexing apparatus for power system data according to an embodiment of the present disclosure. As shown in fig. 3, the apparatus may include:
a memory 301 storing executable program code;
a processor 302 coupled to the memory 301;
the processor 302 calls the executable program code stored in the memory 301 to perform part or all of the steps of the method for indexing power system data disclosed in the first embodiment of the present invention.
Example four
The embodiment of the invention discloses a computer storage medium, which stores computer instructions, and when the computer instructions are called, the computer storage medium is used for executing part or all of the steps in the method for indexing the power system data disclosed by the embodiment of the invention.
The above-described embodiments of the apparatus are merely illustrative, and the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above detailed description of the embodiments, those skilled in the art will clearly understand that the embodiments may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. Based on such understanding, the above technical solutions may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, where the storage medium includes a Read-Only Memory (ROM), a Random Access Memory (RAM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc-Read-Only Memory (CD-ROM), or other disk memories, CD-ROMs, or other magnetic disks, A tape memory, or any other medium readable by a computer that can be used to carry or store data.
Finally, it should be noted that: the method and apparatus for indexing power system data disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, and are only used for illustrating the technical solutions of the present invention, not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art; the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (10)
1. A method of indexing power system data, the method comprising:
acquiring target power system data;
mapping the target power system data to generate a key-value data table;
determining a target retrieval element;
and determining corresponding target retrieval data from the key-value data table according to the target retrieval elements to obtain an index table comprising the target retrieval elements and the corresponding target retrieval data.
2. The method for indexing power system data according to claim 1, wherein the mapping the target power system data to generate a key-value data table comprises:
determining a plurality of target data values and corresponding data types in the target power system data;
and mapping the target power system data to generate a key-value data table according to a plurality of target data values in the target power system data and corresponding data types.
3. The method of indexing power system data according to claim 2, wherein the determining a plurality of target data values and corresponding data types in the target power system data comprises:
determining a plurality of target data sets in the target power system data;
a plurality of target data values and corresponding data types in each of the target data sets are determined.
4. The method for indexing power system data according to claim 3, wherein the mapping the target power system data to generate a key-value data table according to a plurality of target data values and corresponding data types in the target power system data comprises:
determining a data set identification for each of the target data sets in the target power system data as a first key;
generating a first value from a plurality of target data values and corresponding data types of each target data set;
and combining the corresponding first key and the corresponding first value of each target data set into a first key-value corresponding data to generate a key-value data table comprising a plurality of first key-value corresponding data in a mapping mode.
5. The method for indexing power system data according to claim 4, wherein the generating a first value from the plurality of target data values and corresponding data types of each of the target data sets comprises:
determining any of the target data values in each of the target data sets to be a second value;
determining the data type corresponding to the target data value as a second key;
determining the second key and the second value corresponding to each target data value in each target data set as a second key-value corresponding data;
and determining all the second key-value corresponding data corresponding to each target data set as the first value corresponding to each target data set.
6. The method for indexing power system data according to claim 5, wherein the determining a target search element comprises:
acquiring a history retrieval record; the historical retrieval record comprises retrieval keywords of a plurality of historical time periods;
determining a target retrieval element from the historical retrieval record; the target search element includes one or more of the search keywords.
7. The apparatus for indexing power system data according to claim 6, wherein the determining a target retrieval element from the historical retrieval records comprises:
screening out one or more target retrieval keywords with the highest occurrence frequency or higher than a preset frequency threshold from the retrieval keywords of a plurality of historical time periods in the historical retrieval records;
and determining the target search keyword as a target search element.
8. The method for indexing power system data according to claim 5, wherein the determining, according to the target search element, corresponding target search data from the key-value data table to obtain an index table including the target search element and the corresponding target search data comprises:
determining a corresponding target index element from the key-value data table according to the target retrieval element; the target index element comprises one or more of the first key and/or the second key and/or the first value and/or the second value;
determining target information corresponding to the target index element in the key-value data table; the target information comprises key-value data and/or an index address corresponding to the target index element;
and generating an index table according to the target index element and the corresponding target information.
9. An apparatus for indexing power system data, the apparatus comprising:
the acquisition module is used for acquiring target power system data;
the mapping module is used for mapping the target power system data to generate a key-value data table;
a determination module for determining a target search element;
and the index module is used for determining corresponding target retrieval data from the key-value data table according to the target retrieval elements so as to obtain an index table comprising the target retrieval elements and the corresponding target retrieval data.
10. An apparatus for indexing power system data, the apparatus comprising:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to perform the method of indexing power system data according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111020093.0A CN113742344A (en) | 2021-09-01 | 2021-09-01 | Method and device for indexing power system data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111020093.0A CN113742344A (en) | 2021-09-01 | 2021-09-01 | Method and device for indexing power system data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113742344A true CN113742344A (en) | 2021-12-03 |
Family
ID=78734635
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111020093.0A Pending CN113742344A (en) | 2021-09-01 | 2021-09-01 | Method and device for indexing power system data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113742344A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117149100A (en) * | 2023-11-01 | 2023-12-01 | 恒生电子股份有限公司 | Data storage method and device |
-
2021
- 2021-09-01 CN CN202111020093.0A patent/CN113742344A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117149100A (en) * | 2023-11-01 | 2023-12-01 | 恒生电子股份有限公司 | Data storage method and device |
CN117149100B (en) * | 2023-11-01 | 2024-04-23 | 恒生电子股份有限公司 | Data storage method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110019218B (en) | Data storage and query method and equipment | |
JP2013504118A (en) | Information retrieval based on query semantic patterns | |
CN109255000B (en) | Dimension management method and device for label data | |
CN110888981B (en) | Title-based document clustering method and device, terminal equipment and medium | |
US20220019739A1 (en) | Item Recall Method and System, Electronic Device and Readable Storage Medium | |
CN112765405B (en) | Method and system for clustering and inquiring spatial data search results | |
CN107577787B (en) | Method and system for storing associated data information | |
CN113407785B (en) | Data processing method and system based on distributed storage system | |
US11762879B2 (en) | Information traceability method and system based on blockchain | |
CN111159184A (en) | Metadata tracing method and device and server | |
CN110083731B (en) | Image retrieval method, device, computer equipment and storage medium | |
CN113742344A (en) | Method and device for indexing power system data | |
CN113849702A (en) | Method and device for determining target data, electronic equipment and storage medium | |
CN113901037A (en) | Data management method, device and storage medium | |
CN110909266B (en) | Deep paging method and device and server | |
CN110874366A (en) | Data processing and query method and device | |
CN111125158B (en) | Data table processing method, device, medium and electronic equipment | |
US20230273924A1 (en) | Trimming blackhole clusters | |
CN111666302A (en) | User ranking query method, device, equipment and storage medium | |
CN109992708B (en) | Method, device, equipment and storage medium for metadata query | |
CN114547257B (en) | Class matching method and device, computer equipment and storage medium | |
CN114461606A (en) | Data storage method and device, computer equipment and storage medium | |
CN111460325B (en) | POI searching method, device and equipment | |
CN113742345A (en) | Mapping method and device of power system data | |
CN110633430A (en) | Event discovery method, device, equipment and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |