CN117909397A - Method and device for transferring text data of node model - Google Patents

Method and device for transferring text data of node model Download PDF

Info

Publication number
CN117909397A
CN117909397A CN202311847088.6A CN202311847088A CN117909397A CN 117909397 A CN117909397 A CN 117909397A CN 202311847088 A CN202311847088 A CN 202311847088A CN 117909397 A CN117909397 A CN 117909397A
Authority
CN
China
Prior art keywords
data
node model
node
type
dimensional dynamic
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
Application number
CN202311847088.6A
Other languages
Chinese (zh)
Inventor
苗璐
樊玮
易杨
陈德扬
刘宇
林建熙
秦颖婕
王馨尉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Power Grid Co Ltd
Electric Power Dispatch Control Center of Guangdong Power Grid Co Ltd
Original Assignee
Guangdong Power Grid Co Ltd
Electric Power Dispatch Control Center of Guangdong Power Grid Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Power Grid Co Ltd, Electric Power Dispatch Control Center of Guangdong Power Grid Co Ltd filed Critical Guangdong Power Grid Co Ltd
Priority to CN202311847088.6A priority Critical patent/CN117909397A/en
Publication of CN117909397A publication Critical patent/CN117909397A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for transferring text data of a node model, wherein the method comprises the following steps: constructing a specific information position index of each node model according to a preset characteristic rule table; reading text data of each node model, and storing the text data of each node model into a plurality of two-dimensional dynamic sequences according to the type of the node model; constructing a specific information index of a node model, a specific parameter value of the node model and an association relation of a node model type name in each two-dimensional dynamic sequence; in each two-dimensional dynamic sequence, respectively carrying out matching processing on the data values of each data item according to the data type, and outputting a matching processing result in a character string format; and storing the plurality of two-dimensional dynamic sequences into a relational database. By adopting the method and the device, the node model data are converted in an automatic mode, so that the efficiency of searching and extracting the node model data is improved, and the overall management capacity of massive node model data is further improved.

Description

Method and device for transferring text data of node model
Technical Field
The present invention relates to the field of data storage, and in particular, to a method and an apparatus for transferring text data of a node model.
Background
The power flow calculation is an important technology in the field of simulation analysis of the power system, and by calculating electrical parameters such as voltage, current, power and the like of each node in the power system, comprehensively analyzing factors such as electrical connection relation, load demand, generator output and the like among each node in the power system, adopting a mathematical model and a calculation method which meet actual conditions, realizing the analysis of the running state of the power system and providing theoretical support for troubleshooting and optimizing design schemes.
Aiming at the power flow calculation, the current common integrated system covers a plurality of submodules such as model management, simulation calculation, analysis decision and the like, and the function of the power flow calculation can be realized by inputting text data meeting the specific format of the node model data writing paradigm described by the characteristic rule table. However, as the system scale of the modern large power grid is increasingly huge and the complexity is increasingly deepened, the task of manually extracting the model data of the tidal current calculation nodes of the integrated system is increasingly heavy due to the massive nodes of the large power grid and the diversified data attributes of the large power grid, and when a large amount of data is processed, a large amount of time is often consumed for writing text data in a specific format for all the data, so that the represented inefficiency cannot meet the requirement of the modern large power grid on tidal current calculation analysis.
Disclosure of Invention
The embodiment of the invention provides a method and a device for transferring node model text data, which convert the node model data in an automatic mode, improve the efficiency of searching and extracting the node model data, and further improve the overall management capacity of massive node model data.
In order to achieve the above object, a first aspect of an embodiment of the present application provides a method for transferring text data of a node model, including:
constructing a specific information position index of each node model according to a preset characteristic rule table;
Reading text data of each node model, and storing the text data of each node model into a plurality of two-dimensional dynamic sequences according to the type of the node model;
Constructing a specific information index of a node model, a specific parameter value of the node model and an association relation of a node model type name in each two-dimensional dynamic sequence;
in each two-dimensional dynamic sequence, respectively carrying out matching processing on the data values of each data item according to the data type, and outputting a matching processing result in a character string format;
And storing the plurality of two-dimensional dynamic sequences into a relational database.
In a possible implementation manner of the first aspect, the constructing a specific information location index of each node model according to a preset feature rule table specifically includes:
Generating a preset characteristic rule table according to the node data position and the type in the tide calculation text file;
Calling a parser to parse and traverse the feature rule table;
Storing rule information in the characteristic rule table row by row according to a preset row information structure body model;
In a rule information row conforming to a first condition, mapping different digital indexes and the type names of the node models to which the different digital indexes belong to generate indexes of the positions of the node models of different types;
And extracting structural body elements from the rule information rows meeting the second condition to further obtain specific information position indexes of different kinds of node models.
In a possible implementation manner of the first aspect, the extracting the structural element from the rule information row meeting the second condition to obtain a specific information location index of the node model of different types specifically includes:
And extracting the head index of the data value, the tail index of the data value, the output format of the data value and the data attribute name to generate a specific information index, merging the specific information index with the index of the corresponding type node model position to obtain a specific information position index of the corresponding type node model, and repeating the merging for a plurality of times to obtain specific information position indexes of different types of node models.
In a possible implementation manner of the first aspect, the reading text data of each node model and storing the text data of each node model into a plurality of two-dimensional dynamic sequences according to the node model type specifically includes:
Calling a parser to parse text data of each node model, converting a line feed character into a separator, and sequentially converting the text data of each node model into a plurality of one-dimensional dynamic sequences according to the type of the node model; each one-dimensional dynamic sequence corresponds to a node model type;
Replacing carriage returns and tab symbols in the plurality of one-dimensional dynamic sequences;
and storing each one-dimensional dynamic sequence into one dimension of the corresponding two-dimensional dynamic sequence to obtain a plurality of two-dimensional dynamic sequences.
In a possible implementation manner of the first aspect, the replacing carriage returns and tab in the plurality of one-dimensional dynamic sequences specifically includes:
in each one-dimensional dynamic sequence, a carriage return character is replaced by a null character, and a tab is replaced by four space characters.
In a possible implementation manner of the first aspect, in each two-dimensional dynamic sequence, the constructing an association relationship between a specific information index of the node model, a specific parameter value of the node model and a type name of the node model specifically includes:
The index of the node model position is used as a circulation variable, a unique identifier is generated for each node model, and the unique identifier is connected with the node type name;
And storing the specific information position index of the node model into a blank dimension of the corresponding two-dimensional dynamic sequence, and carrying out one-to-one matching on the specific information index in the specific information position index of the node model and the specific parameter value of the node model.
In a possible implementation manner of the first aspect, in each two-dimensional dynamic sequence, the matching processing is performed on the data value of each data item according to the data type, and a matching processing result is output in a character string format, which specifically includes:
reading the data value of each parameter in each two-dimensional dynamic sequence;
And carrying out matching processing on the data values of the parameters of the character string type, the integer type and the floating point number type, and outputting the data values in a character string format.
In a possible implementation manner of the first aspect, the matching processing is performed on the data values of the parameters of the character string type, the integer type and the floating point type, and the data values are output in a character string format, which specifically includes:
for the character string type, outputting a data value after compressing the format;
For the null value type, a character string 'null' is used as an output data value;
converting the data value into a character string form, compressing the data value into an integer type, and outputting the data value;
Converting the floating point number type containing decimal points into character string type data, compressing the data, and outputting data values;
and filling the output width of the floating point number type without decimal points, adding decimal points for standardization, converting the data into a character string type data, compressing the data, and outputting a data value.
In a possible implementation manner of the first aspect, the storing the plurality of two-dimensional dynamic sequences in a relational database specifically includes:
For each two-dimensional dynamic sequence, extracting attribute names of data from the one-dimensional dynamic sequence, separating the attribute names, and taking data rows forming a table type as table columns inserted into a database;
separating the matched data values by using preset symbols to generate a form type character string;
And constructing a one-to-one mapping relation between the data attribute names and the data values in the character strings, writing the mapping relation and the character strings and storing the mapping relation and the character strings into a database.
A second aspect of an embodiment of the present application provides a node model text data transfer device, including:
the index construction module is used for constructing a specific information position index of each node model according to a preset characteristic rule table;
The data reading module reads the text data of each node model and stores the text data of each node model into a plurality of two-dimensional dynamic sequences according to the type of the node model;
the relation construction module is used for constructing the association relation among the specific information index of the node model, the specific parameter value of the node model and the type name of the node model in each two-dimensional dynamic sequence;
The matching output module is used for respectively carrying out matching processing on the data values of each data item according to the data type in each two-dimensional dynamic sequence and outputting a matching processing result in a character string format;
and the transfer module is used for storing the plurality of two-dimensional dynamic sequences into a relational database.
Compared with the prior art, the method and the device for transferring the text data of the node model provided by the embodiment of the invention analyze the characteristic rule table of the integrated system tide calculation node model data and generate the automatic positioning node position and the corresponding specific information position index; and then, reading text data of each node model calculated by tide, storing the text data by using a simpler two-dimensional dynamic sequence, wherein one dimension stores a specific information position index, and one dimension stores the text data, and constructing association relations among the specific information position index, the specific parameter value and the node type name in the two-dimensional sequence. Then, according to the data type difference, respectively carrying out matching processing on specific parameter values of the floating point number type, the integer type and the character string type, and outputting the specific parameter values in a character string format; and finally, the data attribute names and the data values of the associated node models are written into a relational database in a form of a table, so that the process of automatically extracting the data of the integrated system power flow calculation node models and restoring the relational database is completed. The whole process is efficient, the parameter is not required to be manually input, the integrated system can automatically operate the transfer method in the background after acquiring the related data, or transfer is automatically performed in the background through the transfer device, a large amount of data is processed in time to be ready for tide calculation, the efficiency of searching and extracting the node model data is improved, and the overall management capacity of massive node model data is further improved.
Drawings
FIG. 1 is a flow chart of a method for transferring text data of a node model according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a 10-node integrated system power flow calculation node model data test file according to an embodiment of the present invention;
FIG. 3 is a flow chart of a matching process for data values of respective data items according to data types according to an embodiment of the present invention;
FIG. 4 is a schematic diagram showing a manner of storing a plurality of two-dimensional dynamic sequences in a database according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
At present, a method capable of automatically extracting node model data of a tide calculation system and transferring the node model data to a relational database is needed, the node model data is converted in an automatic mode, the efficiency of searching and extracting the node model data is improved, and the overall management capacity of massive node model data is improved.
In order to solve the above problems, referring to fig. 1, an embodiment of the present invention provides a method and an apparatus for transferring text data of a node model, which convert the node model data in an automated manner, so as to improve the efficiency of searching and extracting the node model data, and further improve the overall management capability of massive node model data.
The text data transfer method of the node model comprises the following steps:
s10, constructing a specific information position index of each node model according to a preset characteristic rule table.
S11, reading text data of each node model, and storing the text data of each node model into a plurality of two-dimensional dynamic sequences according to the type of the node model.
S12, constructing the association relation among the specific information index of the node model, the specific parameter value of the node model and the type name of the node model in each two-dimensional dynamic sequence.
S13, in each two-dimensional dynamic sequence, matching processing is carried out on the data values of the data items according to the data types, and the matching processing results are output in a character string format.
S14, storing the two-dimensional dynamic sequences into a relational database.
And S10, analyzing a characteristic rule table describing the text data of the node model and constructing a node specific information position index, S11, reading the text data of the node model and storing the text data by using one blank dimension in the two-dimensional dynamic sequence, S12, namely, merging the specific information position index into the other blank dimension in the two-dimensional dynamic sequence obtained in S11, and simultaneously storing the text data of the node model and the specific information position index in the same two-dimensional sequence, thereby being beneficial to forming a corresponding relation between the specific parameter value of the node and the specific information position index of the node and the node type name by using a simple data structure. Then, the two-dimensional dynamic sequence is optimized through the S13, so that the data can be more readable, and a plurality of two-dimensional dynamic sequences are preferably stored in a relational database in the S14 to obtain a transfer result.
Compared with the prior art, the node model text data transfer method provided by the embodiment of the invention is characterized in that the characteristic rule table of the integrated system tide calculation node model data is analyzed, and the automatic positioning node position and the corresponding specific information position index are generated; and then, reading text data of each node model calculated by tide, storing the text data by using a simpler two-dimensional dynamic sequence, wherein one dimension stores a specific information position index, and one dimension stores the text data, and constructing association relations among the specific information position index, the specific parameter value and the node type name in the two-dimensional sequence. Then, according to the data type difference, respectively carrying out matching processing on specific parameter values of the floating point number type, the integer type and the character string type, and outputting the specific parameter values in a character string format; and finally, the data attribute names and the data values of the associated node models are written into a relational database in a form of a table, so that the process of automatically extracting the data of the integrated system power flow calculation node models and restoring the relational database is completed. The whole process is efficient, the parameter is not required to be manually input, the integrated system can automatically operate the transfer method in the background after acquiring the related data, or transfer is automatically performed in the background through the transfer device, a large amount of data is processed in time to be ready for tide calculation, the efficiency of searching and extracting the node model data is improved, and the overall management capacity of massive node model data is further improved.
Illustratively, S10 specifically includes:
Generating a preset characteristic rule table according to the node data position and the type in the tide calculation text file;
Calling a parser to parse and traverse the feature rule table;
Storing rule information in the characteristic rule table row by row according to a preset row information structure body model;
In a rule information row conforming to a first condition, mapping different digital indexes and the type names of the node models to which the different digital indexes belong to generate indexes of the positions of the node models of different types;
And extracting structural body elements from the rule information rows meeting the second condition to further obtain specific information position indexes of different kinds of node models.
In this embodiment and the following embodiments, for convenience of explanation, a node model text data is provided as shown in fig. 2, where the data file is named input_case, and includes B, BS, BQ, BD, BM different types of node models in the data file, and the node B includes three record numbers (one record number is equal to one node); the node BS contains a record number; the nodes BQ, BD, BM each contain two record numbers.
The characteristic rule table is named WritingRules _dat, each row of information describes the input format and attribute name of each item of data attribute in the node model data, and the specific byte range of the characteristic rule table represents the specific parameter value corresponding to the item of data attribute name.
Illustratively, the extracting the structural element from the rule information row meeting the second condition to obtain specific information position indexes of different kinds of node models specifically includes:
And extracting the head index of the data value, the tail index of the data value, the output format of the data value and the data attribute name to generate a specific information index, merging the specific information index with the index of the corresponding type node model position to obtain a specific information position index of the corresponding type node model, and repeating the merging for a plurality of times to obtain specific information position indexes of different types of node models.
In this embodiment, each row of rule information in the feature rule table to be stored in the dynamic sequence is sequentially judged, rule information meeting the conditions is recorded, the digital index i and the node type name after the feature symbol are mapped, and an index of the node model position of the node B, BS, BQ, BD, BM is generated.
Specific information of the node model can be retrieved from the next row of the node position index i, specifying the structure body in which the rule is written:
field StartIndex: a header index of the data value indicating a start position of the data value corresponding to the data attribute name
Field EndIndex: tail index of data value, representing end position of data value corresponding to data attribute name
Fields Format: output format of data value for normalizing data output format of character string type, floating point number type and integer type
Field Name: and the data attribute name is used for describing the data attribute of the node model and corresponds to the data column name in the transfer result.
And judging whether StartIndex is non-empty and EndIndex is non-infinite information lines in the feature rule table, extracting four elements in the structure body from the screened information elements, and generating specific information indexes B_card_index, BS_card_index, BQ_card_index, BD_card_index and BM_card_index.
Illustratively, S11 specifically includes:
Calling a parser to parse text data of each node model, converting a line feed character into a separator, and sequentially converting the text data of each node model into a plurality of one-dimensional dynamic sequences according to the type of the node model; each one-dimensional dynamic sequence corresponds to a node model type;
Replacing carriage returns and tab symbols in the plurality of one-dimensional dynamic sequences;
and storing each one-dimensional dynamic sequence into one dimension of the corresponding two-dimensional dynamic sequence to obtain a plurality of two-dimensional dynamic sequences.
Illustratively, the replacing carriage returns and tabs in the plurality of one-dimensional dynamic sequences specifically includes:
in each one-dimensional dynamic sequence, a carriage return character is replaced by a null character, and a tab is replaced by four space characters.
In this embodiment, the node model text data is stored in a plurality of two-dimensional dynamic sequences through step S2, and the one-dimensional dynamic storage sequence of the node model text data of the B type, the BS type, the BQ type, the BD type and the BM type is used as one dimension, and the specific information position index of the node is used as the other dimension of the two-dimensional dynamic sequence. Therefore, the corresponding relation between the node specific parameter value and the node specific information position index and the node type name is formed by a simple-structure data structure.
Illustratively, S12 specifically includes:
The index of the node model position is used as a circulation variable, a unique identifier is generated for each node model, and the unique identifier is connected with the node type name;
And storing the specific information position index of the node model into a blank dimension of the corresponding two-dimensional dynamic sequence, and carrying out one-to-one matching on the specific information index in the specific information position index of the node model and the specific parameter value of the node model.
Taking the data of the first node in the model type B as an example, the data values of the data items of the node include: "global_id:10080000001, cardType: B. mod: NULL, ownerName: NULL, busName: the a station Y1、BaseVolt:34.5、ZoneName:00、Pload:-0.007、Qload:-0.043、Pshunt:Null、Qshunt:0、PgenMax:Null、Pgen:Null、Qgen:Null、QgenMin:Null、Vmax:Null、Vmin:Null、Qmode:Null";, in which characters of "global_id", "CardType", etc. as table column names are attribute names of nodes, and data values of "a station Y1", "34.5", etc. are specific parameter values of the nodes.
The following design branch structure: in the step of restoring the node model data in the text form, if the first character of the node type name is 'B', and the second character is null, the B_card_index is regarded as a specific information position index of all_B_card; if the first character of the node type name is "B" and the second character is "S", then the BS_card_index is considered as all_BS_card; is a specific information location index of (a); if the first character of the node type name is 'B', and the second character is 'Q', the BQ_card_index is regarded as a specific information position index of all_BQ_card; if the first character of the node type name is 'B', and the second character is 'M', the BM_card_index is regarded as a specific information position index of all_BM_card; if the first character of the node type name is B and the second character is D, the BD_card_index is regarded as a specific information position index of all_BD_card, and the association relation among the node specific information position index, the node specific parameter value and the node type name is constructed by the method.
In practical application, global_id can be set as unique identifiers of different node components in various node types, a unique identification column is connected after the node type name, various nodes occupy 10 8 storage spaces, and node position index i is used as a circulating variable, so that the uniqueness of the global_id is ensured.
Illustratively, S13 specifically includes:
reading the data value of each parameter in each two-dimensional dynamic sequence;
And carrying out matching processing on the data values of the parameters of the character string type, the integer type and the floating point number type, and outputting the data values in a character string format.
Illustratively, the matching process is performed on the data values of the parameters of the character string type, the integer type and the floating point type, and the data values are output in the character string format, which specifically includes:
for the character string type, outputting a data value after compressing the format;
For the null value type, a character string 'null' is used as an output data value;
converting the data value into a character string form, compressing the data value into an integer type, and outputting the data value;
Converting the floating point number type containing decimal points into character string type data, compressing the data, and outputting data values;
and filling the output width of the floating point number type without decimal points, adding decimal points for standardization, converting the data into a character string type data, compressing the data, and outputting a data value.
Referring to fig. 3, one way of using the present embodiment in a computer is described as follows:
A. Reading the j-th data value of the node model;
B. Judging whether the data value is of a character string type, and if so, outputting the data value in a compact format. The node of giobal _id "10230000002" in the test file is taken as a test case, the sixth data value, namely the data value corresponding to the attribute "ZoneName", is read, the output format requirement of the characteristic rule table on the data is "A2", the data type of the data value is indicated to be a character string type, and the total output width is 2 bytes. The read data value result "01" is a character string type, the length is 2 bytes, and the processed data value is "01" because the length of the data value is equal to the total output width;
C. If not, judging whether the data value is empty, and if so, replacing the data value with a character string 'null'; otherwise, judging whether the data value is simplified by decimal points to replace 0, if the data value is isolated decimal point, replacing output by character '0';
D. In the characteristic rule table, for the data format element describing the non-character string type, using 'F' to represent floating point number, using 'I' to represent integer, traversing the format element of the specific information position index of the node, if the first character of the format element is not 'F', converting the data value into character string form and then outputting. The node with giobal _id of '10230000002' in the test file is taken as a test case, a seventh data value, namely a data value corresponding to an attribute 'BridgeNum', is read, the data format of the node is specified to be 'I2', the type of the data value is indicated to be an integer type, and the total output width is 2 bytes. After the result of reading the data value is 2 and a space is arranged behind the '2', converting the '2' and the space into a character string according to format requirements, and outputting the character '2' as a processed data value by a compact output method;
E. The floating point number format element of the feature rule table is Fm.n, wherein the second character m represents the output width, and the third character n represents the output width of the decimal. If the read data value contains decimal points, the data value is converted into compact character string type data output according to the format requirement. Taking a node with global_id of '10240000002' in a test file as a test case, wherein the node attributes 'BaseVolt' and 'AlphaMin' respectively correspond to data values 270 and 5, the tail ends of the data values are provided with decimal points, the decimal points can be directly converted into compact character string type data '270' and '5' for output, and the data values shown in fig. 4 do not display the decimal points because the relational database automatically identifies and processes the output data into parameter values with practical mathematical significance;
F. If the decimal point is not contained, judging whether the data length is equal to m. For data with the data length equal to m, decimal points are added behind the m-n characters of the data value, the data value is recombined and converted into a character string, and finally the data is compactly output. Taking two nodes of global_id '10240000001' and '10240000002' in the test file as test cases, the lengths of data values 142 and 172 corresponding to two node data attributes 'AlphaNOrGamaN' are 3 bytes, the format requirement is F3.1, and the lengths are consistent with the total output width, so that decimal points are complemented in correct positions. According to the guidance of step S46, the difference between 3 and 1 is 2, the decimal point should be added after the 2 nd element of the data value to reorganize the data value and convert it into character string type, and finally the compact output is character strings of "14.2" and "17.2";
G. If the length of the data value is smaller than m, judging whether the data value is positive or negative. If the data is positive, generating a space occupying sequence by taking 0 as a space occupying symbol before the first element of the floating point number, and filling the space occupying sequence to the maximum output width of the floating point number; otherwise, firstly taking the opposite number of the data value, then processing according to the processing method that the data value is positive, then taking the opposite number, converting the opposite number into the character string type compact output, and carrying out the step F after the output width is full.
Step S4, completing the processing of data types, converting the node model data of text types into character string type arrays with stronger readability through rules formulated by a characteristic rule table, constructing the mapping relation between the data attribute names of the node models and specific parameter values thereof, storing the mapping relation in a relational database in a form of a table, and specifically, the method comprises the following steps of:
s51: extracting attribute names of data by using a one-dimensional dynamic sequence, and forming data rows of form types by using and separating the attribute names as form columns inserted into a database;
S52: and using and separating the matched data values to generate a table type character string, constructing one-to-one mapping between data attribute names and the data values, writing a query statement inserted into a DataBase, connecting the DataBase with the electronic_DataBase, and storing node model data into the DataBase.
Illustratively, S14 specifically includes:
For each two-dimensional dynamic sequence, extracting attribute names of data from the one-dimensional dynamic sequence, separating the attribute names, and taking data rows forming a table type as table columns inserted into a database;
separating the matched data values by using preset symbols to generate a form type character string;
And constructing a one-to-one mapping relation between the data attribute names and the data values in the character strings, writing the mapping relation and the character strings and storing the mapping relation and the character strings into a database.
Extracting attribute names of data by using a one-dimensional dynamic sequence, and forming data rows of form types by using and separating the attribute names as form columns inserted into a database;
In this embodiment, the data values after matching are selected to be used and separated, a character string of a form type is generated, a one-to-one mapping between data attribute names and data values thereof is constructed, a query statement inserted into a DataBase is written, the DataBase is connected with electronic_database, and node model data is stored in the DataBase, and the conversion result of the embodiment is shown in fig. 4.
Compared with the prior art, the node model text data transfer method provided by the embodiment of the invention is characterized in that the characteristic rule table of the integrated system tide calculation node model data is analyzed, and the automatic positioning node position and the corresponding specific information position index are generated; and then, reading text data of each node model calculated by tide, storing the text data by using a simpler two-dimensional dynamic sequence, wherein one dimension stores a specific information position index, and one dimension stores the text data, and constructing association relations among the specific information position index, the specific parameter value and the node type name in the two-dimensional sequence. Then, according to the data type difference, respectively carrying out matching processing on specific parameter values of the floating point number type, the integer type and the character string type, and outputting the specific parameter values in a character string format; and finally, the data attribute names and the data values of the associated node models are written into a relational database in a form of a table, so that the process of automatically extracting the data of the integrated system power flow calculation node models and restoring the relational database is completed. The whole process is efficient, the parameter is not required to be manually input, the integrated system can automatically operate the transfer method in the background after acquiring the related data, or transfer is automatically performed in the background through the transfer device, a large amount of data is processed in time to be ready for tide calculation, the efficiency of searching and extracting the node model data is improved, and the overall management capacity of massive node model data is further improved.
The embodiment of the application provides a node model text type data transfer device which comprises an index construction module, a data reading module, a relation construction module, a matching output module and a transfer module.
The index construction module is used for constructing a specific information position index of each node model according to a preset characteristic rule table;
The data reading module reads the text data of each node model and stores the text data of each node model into a plurality of two-dimensional dynamic sequences according to the type of the node model;
the relation construction module is used for constructing the association relation among the specific information index of the node model, the specific parameter value of the node model and the type name of the node model in each two-dimensional dynamic sequence;
The matching output module is used for respectively carrying out matching processing on the data values of each data item according to the data type in each two-dimensional dynamic sequence and outputting a matching processing result in a character string format;
and the transfer module is used for storing the plurality of two-dimensional dynamic sequences into a relational database.
It should be noted that the dump module stores a plurality of two-dimensional dynamic sequences in the relational database, so that the subsequent query or update of data can be facilitated, and the management of related staff is facilitated.
It will be clear to those skilled in the art that for convenience and brevity of description, reference may be made to the corresponding procedure in the foregoing method embodiments for the specific working procedure of the above-described system, which is not further described herein.
Compared with the prior art, the text data transfer device based on the node model provided by the embodiment of the invention analyzes the characteristic rule table of the integrated system tide calculation node model data and generates an automatic positioning node position and a corresponding specific information position index; and then, reading text data of each node model calculated by tide, storing the text data by using a simpler two-dimensional dynamic sequence, wherein one dimension stores a specific information position index, the other dimension stores the text data, and constructing an association relation among the node specific information position index, the node specific parameter value and the node type name in the two-dimensional sequence. Then, according to the data type difference, respectively carrying out matching processing on specific parameter values of the floating point number type, the integer type and the character string type, and outputting the specific parameter values in a character string format; and finally, the data attribute names and the data values of the associated node models are written into a relational database in a form of a table, so that the process of automatically extracting the data of the integrated system power flow calculation node models and restoring the relational database is completed. The whole process is efficient, the parameter is not required to be manually input, the integrated system can automatically operate the transfer method in the background after acquiring the related data, or transfer is automatically performed in the background through the transfer device, a large amount of data is processed in time to be ready for tide calculation, the efficiency of searching and extracting the node model data is improved, and the overall management capacity of massive node model data is further improved.
An embodiment of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements a node model text data transfer method as described above.
The computer device can be a smart phone, a tablet computer, a desktop computer, a cloud server and other computing devices. The computer device may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that the figures are merely examples of computer devices and are not limiting of computer devices, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input and output devices, network access devices, etc.
The processor may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf programmable gate array (field-programmable GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may in some embodiments be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The memory may in other embodiments also be an external storage device of the computer device, such as a plug-in hard disk provided on the computer device, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), etc. Further, the memory may also include both internal storage units and external storage devices of the computer device. The memory is used to store an operating system, application programs, boot loader (BootLoader), data, and other programs, etc., such as program code for the computer program, etc. The memory may also be used to temporarily store data that has been output or is to be output.
Embodiments of the present application provide a computer program product which, when run on a computer device, causes the computer device to perform the steps of the method embodiments described above.
In several embodiments provided by the present application, it will be understood that each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.

Claims (10)

1. The method for transferring the text data of the node model is characterized by comprising the following steps of:
constructing a specific information position index of each node model according to a preset characteristic rule table;
Reading text data of each node model, and storing the text data of each node model into a plurality of two-dimensional dynamic sequences according to the type of the node model;
Constructing a specific information index of a node model, a specific parameter value of the node model and an association relation of a node model type name in each two-dimensional dynamic sequence;
in each two-dimensional dynamic sequence, respectively carrying out matching processing on the data values of each data item according to the data type, and outputting a matching processing result in a character string format;
And storing the plurality of two-dimensional dynamic sequences into a relational database.
2. The method for text-based data transfer of node models according to claim 1, wherein the constructing a specific information location index of each node model according to a preset feature rule table specifically comprises:
Generating a preset characteristic rule table according to the node data position and the type in the tide calculation text file;
Calling a parser to parse and traverse the feature rule table;
Storing rule information in the characteristic rule table row by row according to a preset row information structure body model;
In a rule information row conforming to a first condition, mapping different digital indexes and the type names of the node models to which the different digital indexes belong to generate indexes of the positions of the node models of different types;
And extracting structural body elements from the rule information rows meeting the second condition to further obtain specific information position indexes of different kinds of node models.
3. The method for transferring text data of node models according to claim 2, wherein the extracting the structural element from the rule information row meeting the second condition to obtain the specific information position index of the node models of different types specifically comprises:
And extracting the head index of the data value, the tail index of the data value, the output format of the data value and the data attribute name to generate a specific information index, merging the specific information index with the index of the corresponding type node model position to obtain a specific information position index of the corresponding type node model, and repeating the merging for a plurality of times to obtain specific information position indexes of different types of node models.
4. The method for transferring text data of node models according to claim 1, wherein the steps of reading the text data of each node model and storing the text data of each node model into a plurality of two-dimensional dynamic sequences according to the type of the node model comprise:
Calling a parser to parse text data of each node model, converting a line feed character into a separator, and sequentially converting the text data of each node model into a plurality of one-dimensional dynamic sequences according to the type of the node model; each one-dimensional dynamic sequence corresponds to a node model type;
Replacing carriage returns and tab symbols in the plurality of one-dimensional dynamic sequences;
and storing each one-dimensional dynamic sequence into one dimension of the corresponding two-dimensional dynamic sequence to obtain a plurality of two-dimensional dynamic sequences.
5. The method for text-based data transfer of node model according to claim 4, wherein said replacing carriage returns and tabs in a plurality of one-dimensional dynamic sequences comprises:
in each one-dimensional dynamic sequence, a carriage return character is replaced by a null character, and a tab is replaced by four space characters.
6. The method for transferring text data of node model according to claim 1, wherein in each two-dimensional dynamic sequence, constructing an association relationship among a specific information index of the node model, a specific parameter value of the node model and a type name of the node model specifically comprises:
The index of the node model position is used as a circulation variable, a unique identifier is generated for each node model, and the unique identifier is connected with the node type name;
And storing the specific information position index of the node model into a blank dimension of the corresponding two-dimensional dynamic sequence, and carrying out one-to-one matching on the specific information index in the specific information position index of the node model and the specific parameter value of the node model.
7. The method for transferring text data of node model as claimed in claim 1, wherein in each two-dimensional dynamic sequence, the matching processing is performed on the data values of each data item according to the data type, and the matching processing result is output in a character string format, specifically comprising:
reading the data value of each parameter in each two-dimensional dynamic sequence;
And carrying out matching processing on the data values of the parameters of the character string type, the integer type and the floating point number type, and outputting the data values in a character string format.
8. The method for text-based data transfer of node model according to claim 7, wherein the matching process is performed on the data values of the parameters of the character string type, the integer type and the floating point type, and the data values are output in the character string format, specifically comprising:
for the character string type, outputting a data value after compressing the format;
for the null value type, the character string 'nul l' is used as an output data value;
converting the data value into a character string form, compressing the data value into an integer type, and outputting the data value;
Converting the floating point number type containing decimal points into character string type data, compressing the data, and outputting data values;
and filling the output width of the floating point number type without decimal points, adding decimal points for standardization, converting the data into a character string type data, compressing the data, and outputting a data value.
9. The method for transferring text data of node model according to claim 1, wherein storing the plurality of two-dimensional dynamic sequences in a relational database specifically comprises:
For each two-dimensional dynamic sequence, extracting attribute names of data from the one-dimensional dynamic sequence, separating the attribute names, and taking data rows forming a table type as table columns inserted into a database;
separating the matched data values by using preset symbols to generate a form type character string;
And constructing a one-to-one mapping relation between the data attribute names and the data values in the character strings, writing the mapping relation and the character strings and storing the mapping relation and the character strings into a database.
10. A node model text data transfer device, comprising:
the index construction module is used for constructing a specific information position index of each node model according to a preset characteristic rule table;
The data reading module reads the text data of each node model and stores the text data of each node model into a plurality of two-dimensional dynamic sequences according to the type of the node model;
the relation construction module is used for constructing the association relation among the specific information index of the node model, the specific parameter value of the node model and the type name of the node model in each two-dimensional dynamic sequence;
The matching output module is used for respectively carrying out matching processing on the data values of each data item according to the data type in each two-dimensional dynamic sequence and outputting a matching processing result in a character string format;
and the transfer module is used for storing the plurality of two-dimensional dynamic sequences into a relational database.
CN202311847088.6A 2023-12-28 2023-12-28 Method and device for transferring text data of node model Pending CN117909397A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311847088.6A CN117909397A (en) 2023-12-28 2023-12-28 Method and device for transferring text data of node model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311847088.6A CN117909397A (en) 2023-12-28 2023-12-28 Method and device for transferring text data of node model

Publications (1)

Publication Number Publication Date
CN117909397A true CN117909397A (en) 2024-04-19

Family

ID=90696777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311847088.6A Pending CN117909397A (en) 2023-12-28 2023-12-28 Method and device for transferring text data of node model

Country Status (1)

Country Link
CN (1) CN117909397A (en)

Similar Documents

Publication Publication Date Title
CA2997061C (en) Method and system for parallelization of ingestion of large data sets
CN111090417B (en) Binary file analysis method, binary file analysis device, binary file analysis equipment and binary file analysis medium
CN104360865A (en) Serialization method, deserialization method and related equipment
US9584156B1 (en) Creating a dynamic Huffman table
US20160210333A1 (en) Method and device for mining data regular expression
CN110851511A (en) Data synchronization method and device
CN108763546A (en) A kind of conversion method of data format, device, storage medium and terminal
CN113312338A (en) Data consistency checking method, device, equipment, medium and program product
CN111858730A (en) Data importing and exporting device, method, equipment and medium of graph database
US20080104108A1 (en) Schemaless xml payload generation
CN113407565B (en) Cross-database data query method, device and equipment
CN112182021B (en) User data query method, device and system
CN109740130B (en) Method and device for generating file
CN117909397A (en) Method and device for transferring text data of node model
CN110389953B (en) Data storage method, storage medium, storage device and server based on compression map
CN111190896B (en) Data processing method, device, storage medium and computer equipment
CN116489251A (en) Universal code stream analysis method, device, computer readable medium and terminal equipment
CN111310076A (en) Geographic position query method, device, medium and electronic equipment
CN116450655A (en) Tree structure data processing method and device, electronic equipment and storage medium
CN110806973A (en) Automatic generation method and device of interface message
CN113779932A (en) Digital formatting method, device, terminal equipment and storage medium
CN111666278A (en) Data storage method, data retrieval method, electronic device and storage medium
CN112115159B (en) SQL sentence generation method and device, electronic equipment and storage medium
CN111368387B (en) Electric power system simulation data textualization method
CN111090743A (en) Thesis recommendation method and device based on word embedding and multi-valued form concept analysis

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