CN114510477A - Data storage method and data read-write access method based on ANSI C12.19 - Google Patents
Data storage method and data read-write access method based on ANSI C12.19 Download PDFInfo
- Publication number
- CN114510477A CN114510477A CN202111637769.0A CN202111637769A CN114510477A CN 114510477 A CN114510477 A CN 114510477A CN 202111637769 A CN202111637769 A CN 202111637769A CN 114510477 A CN114510477 A CN 114510477A
- Authority
- CN
- China
- Prior art keywords
- data
- index
- stored
- ansi
- read
- 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 51
- 238000013500 data storage Methods 0.000 title claims abstract description 26
- 238000004891 communication Methods 0.000 claims abstract description 6
- 230000006870 function Effects 0.000 claims description 24
- 230000008859 change Effects 0.000 claims description 6
- 230000003068 static effect Effects 0.000 claims description 6
- 238000007726 management method Methods 0.000 description 5
- 238000005034 decoration Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 101100204393 Arabidopsis thaliana SUMO2 gene Proteins 0.000 description 1
- 101100534673 Arabidopsis thaliana SUMO3 gene Proteins 0.000 description 1
- 101100534682 Arabidopsis thaliana SUMO4 gene Proteins 0.000 description 1
- 101150112492 SUM-1 gene Proteins 0.000 description 1
- 101150096255 SUMO1 gene Proteins 0.000 description 1
- 101100116390 Schizosaccharomyces pombe (strain 972 / ATCC 24843) ded1 gene Proteins 0.000 description 1
- 101100311460 Schizosaccharomyces pombe (strain 972 / ATCC 24843) sum2 gene Proteins 0.000 description 1
- 238000013479 data entry Methods 0.000 description 1
- 238000010586 diagram 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/2228—Indexing structures
-
- 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
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a data storage method based on ANSI C12.19, which is characterized by comprising the following steps: the method comprises the steps of obtaining a plurality of tables to be stored defined by ANSI C12.19 communication protocols; indexing information is compiled for data in a table to be stored, wherein the indexing information at least comprises a function pointer; respectively establishing a group of corresponding index tables for each table to be stored, wherein index information corresponding to the table data to be stored is stored in each index table; finally, an index summary table is established to manage all index tables. Also discloses a data read-write access method based on ANSI C12.19. Has the advantages that: the method manages the table data to be stored through the index total table and the index table, improves the access efficiency, can be compatible with all ANSI C12.19 tables, has strong universality, does not depend on protocols for data storage, and is convenient for realizing multi-protocol coexistence.
Description
Technical Field
The invention relates to the field of data storage, in particular to a data storage method and a data read-write access method based on ANSI C12.19.
Background
The standard specifications currently specified internationally for the electric energy metering industry are mainly the IEC62056 standard and the ANSI standard in north america. The electric energy meter of IEC62056 standard adopts DLSM/COSEM system structure, and defines storage and data access in detail. The ANSI C12 defines the data structure of the communication protocol and the application layer of the electric energy meter in detail as in the IEC62056 standard, but there is a large difference from the IEC62056 standard in terms of data and interface.
Data based on ANSI C12.19 are stored, interpreted and transmitted in a table mode, and the number, type and length of the data in the table are different, so that the storage and access are difficult, and particularly, when IEC and ANSI multi-protocol coexistence is considered, the operation is very inconvenient. Therefore, the chinese patent with application number CN201811641278.1 (publication number CN109739858B) discloses a data classification storage method, device and electronic device based on ANSI C12.19, which includes: acquiring a table to be stored; the table to be stored is a functional table defined by ANSI C12.19 communication protocol; the table to be stored comprises a plurality of data to be stored; identifying data types of a plurality of data to be stored in a table to be stored; and storing the plurality of data to be stored in the storage space according to the data type. Although the method can realize the data classification storage of ANSI C12.19, the method does not overcome the problem of extremely inconvenient operation when IEC and ANSI multi-protocols coexist because the data is stored according to the data type by using the table stored by the function, so that the method needs further improvement.
Disclosure of Invention
The first technical problem to be solved by the present invention is to provide a data storage method based on ANSI C12.19, which has strong versatility and is convenient for implementing multi-protocol coexistence, in view of the above prior art.
A second technical problem to be solved by the present invention is to provide a data read-write access method based on ANSI C12.19 for performing data read-write access on a table to be stored, which is stored by using the above data storage method, in view of the above prior art, and the access efficiency of the method is high.
The technical scheme adopted by the invention for solving the first technical problem is as follows: a data storage method based on ANSI C12.19 is characterized in that: the method comprises the following steps:
acquiring a plurality of tables to be stored defined by ANSI C12.19 communication protocol; indexing information is compiled for data in a table to be stored; the index information at least comprises a function pointer;
respectively establishing a group of corresponding index tables for each table to be stored, wherein index information corresponding to the table data to be stored is stored in each index table;
finally, an index summary table is established to manage all index tables.
Preferably, the index information corresponding to the table data to be stored further includes a data type, a length, and an offset address.
Specifically, the index summary table includes the total number of the index tables, the number of index information of each index table, and a relationship between the index table and the table to be stored.
Further, when the information of the table to be stored changes, the corresponding index table and the index summary table are refreshed after the information changes.
Preferably, the information change of the table to be stored is a data content change or a data length change.
Further, the index table and the index summary table are stored in a static memory to support dynamic update.
Preferably, the static memory is an EEPORM or a dataflash.
The technical scheme adopted by the invention for solving the second technical problem is as follows: a data read-write access method based on ANSI C12.19 is characterized in that: the method is used for read-write access to the table to be stored, which is stored by using the data storage method based on ANSI C12.19, and comprises the following steps:
step 2, searching the index summary table to obtain a corresponding index table;
step 3, inquiring corresponding index information through the index table, and acquiring data content;
step 4, calling a function defined in the index table to obtain a data interface;
step 5, judging whether the type of the read-write access to be requested is read operation or write operation, and if the type of the read-write access to be requested is the read operation, turning to step 6; if the operation is write operation, the step 7 is carried out;
step 6, reading data to a cache through a data interface, transmitting the data and finishing;
and 7, writing data into the memory through the data interface, and ending.
As an improvement, the method further comprises the following steps before the data reading in step 6:
judging the legality of the data to be read through the data interface, if the data to be read is legal, reading the data to a cache through the data interface, transmitting the data, and ending; and if the data is illegal, refusing to read the data, and ending.
Further, before the data is written in step 7, the method further includes the following steps:
judging the legality of the data to be written through the data interface, if the data to be written is legal, writing the data into the memory, and ending; and if the data is illegal, refusing to write the data and ending.
Compared with the prior art, the invention has the advantages that: the method manages the table data to be stored through the index total table and the index table, improves the access efficiency, and manages the actual storage data address in a virtualization way, so that the actual storage management of the table data is not limited by the table structure, and the method can be compatible with all ANSI C12.19 tables and has strong universality; in addition, by providing a data function pointer, the physical address of actual data can be defined at will, data storage does not depend on a protocol, and coexistence of multiple protocols is facilitated; meanwhile, the function pointer is used as an interface for accessing the actual data, and can be defined as a physical address of the actual data, a uniform interface function or a special type processing function, so that the operation is flexible.
Drawings
FIG. 1 is a flow chart of an ANSI C12.19 based data storage method in an embodiment of the present invention;
FIG. 2 is a schematic diagram of data storage of a table to be stored according to an embodiment of the present invention;
fig. 3 is a flowchart of a data read-write access method based on ANSI C12.19 in the embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the accompanying examples.
As shown in fig. 1, the data storage method based on ANSI C12.19 in this embodiment includes:
acquiring a plurality of tables to be stored defined by ANSI C12.19 communication protocol; indexing information is compiled for data in a table to be stored; in this embodiment, the index information corresponding to the table data to be stored includes a data type, a length, an offset address and a function pointer, the index information defines the corresponding function pointer, and the read-write validity of each data entry can be determined through the function pointer, and the special type data is obtained;
respectively establishing a group of corresponding index tables for each table to be stored, wherein index information corresponding to the table data to be stored is stored in each index table;
finally, an index summary table is established to manage all the index tables, and in this embodiment, the index summary table includes the total number of the index tables, the number of index information of each index table, and a relationship between the index table and a table to be stored. Therefore, management of a large number of index tables is facilitated by indexing the summary table, and management efficiency is improved.
When the information of the table to be stored changes, for example: when the data content changes, the data length changes or other data information changes, the corresponding index table and the index summary table are refreshed after the information changes. In addition, the index table and the index table are stored in a static memory to support dynamic update, in this embodiment, the static memory is EEPORM or dataflash.
For the convenience of understanding the data storage method of the present invention, it is described by taking as an example the tables to be stored NBR _ RESET, SUM1, SUM2, SUM3, SUM4, DEMANDS1, DEMANDS2, DEMANDS3, DEMANDS4, coincident 1, coincident 2, coincident 3, and coincident 4 as shown in fig. 2, wherein the index information corresponding to table to be stored _ RESET is offset0, len0, type0, and fu 0(, and so on), the index information corresponding to table to be stored SUM 0 is offset0, len0, type0, and fu 0(, and so on), and the rest is analogized, wherein offset0 and offset0 are offset addresses, len0 and 0 are type, type0 and type0 are data, type () and type0 and type () are set as index function pointers, and each function pointer is set up as an index into the function 685 function 0, and each table is set up as an index function index pointer 0, and the table for managing table for the function pointer 0 and the function pointer (s 0).
In order to implement read-write access on a table to be stored, which is stored by using the data storage method based on ANSI C12.19, as shown in fig. 3, the data read-write access method based on ANSI C12.19 in this embodiment includes the following steps:
step 2, searching the index summary table to obtain a corresponding index table;
step 3, inquiring corresponding index information through the index table, and acquiring data content;
step 4, calling a function defined in the index table to obtain a data interface;
step 5, judging whether the type of the read-write access to be requested is read operation or write operation, and if the type of the read-write access to be requested is the read operation, turning to step 6; if the operation is write operation, the step 7 is carried out;
step 6, reading data to a cache through a data interface, transmitting the data and finishing;
and 7, writing data into the memory through the data interface, and ending.
Wherein, the following steps are also included before the data is read in step 6: judging the legality of the data to be read through the data interface, if the data to be read is legal, reading the data to a cache through the data interface, transmitting the data, and ending; and if the data is illegal, refusing to read the data, and ending. The method also comprises the following steps before the data is written in the step 7: judging the legality of the data to be written through the data interface, if the data to be written is legal, writing the data into the memory, and ending; and if the data is illegal, refusing to write the data and ending.
According to the data storage method based on ANSI C12.19, the data addresses which are actually stored are subjected to virtualization management, and the actual storage management of the table data is not limited by the table structure, so that the method can be compatible with all ANSI C12.19 tables, and the universality is high; the actual table data is managed through the index summary table and the index table, so that the access efficiency is improved; in addition, by providing a data function pointer, the physical address of actual data can be defined at will, data storage does not depend on a protocol, and coexistence of multiple protocols is facilitated; meanwhile, the function pointer is used as an interface for accessing the actual data, and can be defined as a physical address of the actual data, a uniform interface function or a special type processing function, so that the operation is flexible.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the technical principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (10)
1. A data storage method based on ANSI C12.19 is characterized in that: the method comprises the following steps:
acquiring a plurality of tables to be stored defined by ANSI C12.19 communication protocol; indexing information is compiled for data in a table to be stored, wherein the indexing information at least comprises a function pointer;
respectively establishing a group of corresponding index tables for each table to be stored, wherein index information corresponding to the table data to be stored is stored in each index table;
finally, an index summary table is established to manage all index tables.
2. The ANSI C12.19-based data storage method of claim 1, wherein: the index information corresponding to the table data to be stored also comprises a data type, a length and an offset address.
3. The ANSI C12.19-based data storage method of claim 2, wherein: the index summary table comprises the total number of the index tables, the index information number of each index table and the corresponding relation between the index tables and the tables to be stored.
4. An ANSI C12.19 based data storage method according to any of claims 1 to 3, wherein: and when the information of the table to be stored is changed, refreshing the corresponding index table and the index summary table after the information is changed.
5. The ANSI C12.19-based data storage method of claim 4, wherein: and the information change of the table to be stored is data content change or data length change.
6. The ANSI C12.19-based data storage method of claim 4, wherein: the index table and index summary table are stored in static memory to support dynamic updates.
7. The ANSI C12.19-based data storage method of claim 6, wherein: the static memory is EEPORM or dataflash.
8. A data read-write access method based on ANSI C12.19 is characterized in that: a table to be stored for read-write access stored using the ANSI C12.19 based data storage method of any of the preceding claims 1 to 7, the data read-write access method comprising the steps of:
step 1, obtaining a form ID to be requested for read-write access;
step 2, searching the index summary table to obtain a corresponding index table;
step 3, inquiring corresponding index information through the index table, and acquiring data content;
step 4, calling a function defined in the index table to obtain a data interface;
step 5, judging whether the type of the read-write access to be requested is read operation or write operation, and if the type of the read-write access to be requested is the read operation, turning to step 6; if the operation is write operation, the step 7 is carried out;
step 6, reading data to a cache through a data interface, transmitting the data and finishing;
and 7, writing data into the memory through the data interface, and ending.
9. The ANSI C12.19-based data read-write access method of claim 8, wherein: the method also comprises the following steps before the data is read in the step 6:
judging the legality of the data to be read through the data interface, if the data to be read is legal, reading the data to a cache through the data interface, transmitting the data, and ending; if not, refusing to read the data, and ending.
10. The ANSI C12.19-based data read-write access method of claim 8, wherein: the method further comprises the following steps before the data is written in the step 7:
judging the legality of the data to be written through the data interface, if the data to be written is legal, writing the data into the memory, and ending; and if the data is illegal, refusing to write the data and ending.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111637769.0A CN114510477A (en) | 2021-12-29 | 2021-12-29 | Data storage method and data read-write access method based on ANSI C12.19 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111637769.0A CN114510477A (en) | 2021-12-29 | 2021-12-29 | Data storage method and data read-write access method based on ANSI C12.19 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114510477A true CN114510477A (en) | 2022-05-17 |
Family
ID=81548538
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111637769.0A Pending CN114510477A (en) | 2021-12-29 | 2021-12-29 | Data storage method and data read-write access method based on ANSI C12.19 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114510477A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104008111A (en) * | 2013-02-27 | 2014-08-27 | 深圳市腾讯计算机系统有限公司 | Data storage management method and device |
CN105260136A (en) * | 2015-09-24 | 2016-01-20 | 北京百度网讯科技有限公司 | Data read-write method and distributed storage system |
CN106796588A (en) * | 2015-06-03 | 2017-05-31 | 华为技术有限公司 | The update method and equipment of concordance list |
-
2021
- 2021-12-29 CN CN202111637769.0A patent/CN114510477A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104008111A (en) * | 2013-02-27 | 2014-08-27 | 深圳市腾讯计算机系统有限公司 | Data storage management method and device |
CN106796588A (en) * | 2015-06-03 | 2017-05-31 | 华为技术有限公司 | The update method and equipment of concordance list |
US20180018361A1 (en) * | 2015-06-03 | 2018-01-18 | Huawei Technologies Co., Ltd. | Index Table Update Method, and Device |
CN105260136A (en) * | 2015-09-24 | 2016-01-20 | 北京百度网讯科技有限公司 | Data read-write method and distributed storage system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110377436B (en) | Data storage access method, equipment and device of persistent memory | |
CN100543750C (en) | A kind of matrix type data caching method and device of using based on WEB | |
CN106095698B (en) | Caching write-in, read method and the device of object-oriented | |
CN101162441B (en) | Access apparatus and method for data | |
CN109445685B (en) | User mode file system processing method | |
CN109240607B (en) | File reading method and device | |
CN109634664B (en) | Method and device for CPU to issue command descriptor to hardware circuit | |
CN110147345A (en) | A kind of key assignments storage system and its working method based on RDMA | |
CN112000589A (en) | Data writing method, data reading device and electronic equipment | |
CN105095113A (en) | Cache management method and system | |
AU2014267783A1 (en) | Storage processing method, device and terminal | |
CN114896215A (en) | Metadata storage method and device | |
WO2021128893A1 (en) | Method and system for identifying garbage data, electronic device, and storage medium | |
CN102402698B (en) | A kind of method and device reducing the erasable number of operations of Subscriber Identity Module file | |
CN114510477A (en) | Data storage method and data read-write access method based on ANSI C12.19 | |
US8316210B2 (en) | Dividing a logical memory space into ranges and sets for address translation | |
CN107632944B (en) | Method and device for reading data | |
CN115687185A (en) | Handheld terminal low-power-consumption data acquisition method based on mmap memory mapping | |
CN111984197B (en) | Computer cache allocation method | |
CN114610237A (en) | Method for realizing running log component of instrument and meter equipment | |
CN109165172B (en) | Cache data processing method and related equipment | |
CN110825658B (en) | Flash memory controller and method | |
US20070005960A1 (en) | Wait free coherent multi-level file system | |
CN115129709A (en) | Data processing method, server and system | |
CN112015672A (en) | Data processing method, device, equipment and storage medium in storage system |
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 |