A single file storage method and system for feeder terminal unit

By using the database in the feed terminal unit for single file storage, the problem of not matching the file header and content of the file head during power loss is solved, and simplified single -file storage logic and effective data retrieval and storage are realized.

CN115712624BActive Publication Date: 2025-01-24SHANGHAI HOLYSTAR INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211475754.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-23
Publication Date
2025-01-24
Estimated Expiration
2042-11-23

AI Technical Summary

Technical Problem

When the existing feeder terminal unit loses power, due to the mismatch of the file header record and the file content, it is difficult and abnormal to retrieve the file, and the main site cannot call the record, and the single file storage logic is complicated.

Method used

Use a database for single file storage, pre-configure the database and data tables, each data table stores a single file, configure the limit of the number of written items, and query the writing position of the data table and update the number of written items in the file header. , to achieve cyclic coverage and writing of data.

Benefits of technology

Reduce the logical complexity of the content storage of the single file, ensure that the number of entries is consistent with the actual operating data number, record the effective content length of the operating data, facilitate system search and storage, prevent abnormal power storage, solve the unable to analyze the main station. Question.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115712624B_ABST
    Figure CN115712624B_ABST
Patent Text Reader

Abstract

The present invention provides a single file storage method and system for a feeder terminal unit, which relates to the technical field of feeder terminal units, including: when a single file is generated during the operation of the feeder terminal unit and the data table is an empty table, a file header is written into the data table, and the number of writes in the file header is configured to be zero; when the data table is not an empty table and the number of written data has not reached the limit of the number of writes, the current write position in the data table is queried, the next position of the current write position is marked as the current write position, so as to write an operation data contained in the single file, and the number of writes is increased by one; and when the limit of the number of writes is reached, the current write position in the data table is queried, the next position of the current write position is marked as the current write position, so as to cyclically overwrite and write an operation data contained in the single file, and the number of writes remains unchanged. The beneficial effect is that the logical complexity of the storage of the content of a single file is reduced, the system is convenient for retrieval and storage, and the power-off storage abnormality is prevented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of feeder terminal units, and in particular to a single file storage method and system for a feeder terminal unit. Background Art

[0002] The feeder terminal unit (FTU) uses the Linux operating system and has remote control, remote signaling, and fault detection functions. It communicates with the distribution automation master station to provide the distribution system operation status and various parameters, that is, the information required for monitoring and control, including switch status, power parameters, phase-to-phase faults, ground faults, and parameters at the time of faults. It also executes the commands issued by the distribution master station to adjust and control the distribution equipment, and realizes fault location, fault isolation, and rapid power supply restoration in non-fault areas.

[0003] The feeder terminal unit usually uses the file system that comes with Linux for single file storage, and usually performs read and write operations based on the file offset. The general logic is to write the file header first and then update the file content, or to update the file content first and then update the file header. If a power outage occurs during writing, the number of files recorded in the file header and the file content will not match. When the power is turned on again, there is no record of the write file offset position when the power is off, which leads to retrieval difficulties, file anomalies, and the master station cannot call the record. In order to ensure that the power is not lost during a power outage, the write offset position and the read offset position need to be stored in the file system, but since each single file has a record number limit, the offset must be made after opening the file, and the limit judgment for reading the file needs to consider the file boundary problem, which is more cumbersome for the operation inside the file. Summary of the invention

[0004] In view of the problems existing in the prior art, the present invention provides a single file storage method of a feeder terminal unit, wherein the feeder terminal unit is pre-configured with a database, the database is associated with at least one data table, each data table stores a single file correspondingly, and the data table is configured with a corresponding write number limit;

[0005] Then the single file storage method includes:

[0006] Step S1, when the single file is generated during the operation of the feeder terminal unit, query whether the corresponding data table is an empty table:

[0007] If yes, write the file header of the single file into the data table, and set the number of entries written in the file header to zero, and then go to step S2;

[0008] If not, go to step S2;

[0009] Step S2, the feeder terminal unit determines whether the number of data items written into the data table reaches the limit of the number of data items written:

[0010] If not, query the current write position in the data table, mark the next position of the current write position as the current write position, write one operation data contained in the single file, and increase the number of writes in the file header by one, and then return to step S1;

[0011] If so, query the current write position in the data table, mark the next position of the current write position as the current write position, so as to cyclically overwrite and write an operation data contained in the single file, and the number of writes in the file header remains unchanged, and then return to step S1.

[0012] Preferably, the data table is configured with a data unique identification field and a data write identification field;

[0013] Then in the step S1, when the field value of the data write identification field in the data table queried by the feeder terminal unit does not contain the current write identification value, it indicates that the data table is an empty table, and then a file header unique identification value associated with the data unique identification field is generated, the file header of the single file is written to the write position represented by the file header unique identification value, the data write identification field of the file header is configured as the current write identification value, and the number of write entries in the file header is configured as zero;

[0014] In the step S2, the feeder terminal unit queries the file header unique identification value corresponding to the current write identification value as the current write position.

[0015] Preferably, the data table is configured with a data content field; then step S2 comprises:

[0016] Step S21, the feeder terminal unit determines whether the number of data items written into the data table reaches the limit of the number of data items written:

[0017] If not, go to step S22;

[0018] If yes, go to step S23;

[0019] Step S22, the feeder terminal unit queries and determines whether the data content field at the current writing position is written as a file header:

[0020] If so, a data unique identification value associated with the data unique identification field is generated at the next position of the file header write position, so as to write one operation data of the single file into the data content field of the write position represented by the data unique identification value, and the data write identification field of the file header is configured as the first written identification value, the data write identification field of the operation data is configured as the current write identification value, and the number of written entries in the file header is increased by one, and then the process returns to step S1;

[0021] If not, a new data unique identification value is generated at the next position of the current write position, so as to write one piece of operation data of the single file into the data content field of the write position represented by the data unique identification value, and the data write identification field of the file header is configured as the second written identification value, the data write identification field of the previous piece of operation data is configured as the first written identification value, the data write identification field of the currently written operation data is configured as the current write identification value, and the number of written pieces in the file header is increased by one, and then the process returns to step S1;

[0022] Step S23, the feeder terminal unit queries the next data unique identification value of the data unique identification value associated with the current write position, so as to write one operation data of the single file into the data content field of the write position represented by the queried data unique identification value, configure the data write identification field of the previous operation data as the first written identification value, configure the data write identification field of the currently written operation data as the current write identification value, the number of writes in the file header remains unchanged, and then returns to step S1.

[0023] Preferably, the data table is also configured with a data valid length field;

[0024] Then in the step S2, each time the feeder terminal unit writes the operation data into the data content field, it also includes counting the effective content length of each operation data and writing it into the corresponding data effective length field.

[0025] Preferably, after executing step S2, the method further includes:

[0026] Upon receiving a reporting instruction containing several data unique identification values ​​sent by the distribution master station connected to the feeder terminal unit, the feeder terminal unit retrieves the data table according to the data unique identification value, and reports the field information of the data content field and the data valid length field associated with each retrieved data unique identification value to the distribution master station.

[0027] Preferably, after executing step S2, the method further includes:

[0028] The feeder terminal unit periodically reports the number of entries written in the file header and the data content field and the data valid length field associated with each data unique identification value to the power distribution master station connected to the feeder terminal unit.

[0029] The present invention also provides a single file storage system for a feeder terminal unit, using the above-mentioned single file storage system, the single file storage system comprising:

[0030] A database, configured in the feeder terminal unit, the database is associated with at least one data table, each data table stores a single file, and the data table is configured with a corresponding write number limit;

[0031] A storage control module is connected to the database, and the storage control module includes:

[0032] A first control unit is used for, when the single file is generated during the operation of the feeder terminal unit, when the corresponding data table is queried and found to be an empty table, writing the file header of the single file into the data table, configuring the number of entries written in the file header to zero, and generating a judgment signal when the data table is not an empty table;

[0033] a second control unit connected to the first control unit, for determining, according to the judgment signal, that the number of data items written into the data table has not reached the limit of the number of items written, querying the current write position in the data table, marking the next position of the current write position as the current write position, writing an operation data item contained in the single file, and increasing the number of items written into the file header by one;

[0034] When the number of data items written in the data table reaches the write limit, the current write position in the data table is queried, and the next position of the current write position is marked as the current write position, so as to cyclically overwrite and write an operation data item contained in the single file, and the write number of the file header remains unchanged.

[0035] Preferably, the data table is configured with a data unique identification field and a data write identification field;

[0036] When the first control unit queries the data table and finds that the field value of the data write identification field does not include the current write identification value, it indicates that the data table is an empty table, and then generates a file header unique identification value associated with the data unique identification field, writes the file header of the single file to the write position represented by the file header unique identification value, configures the data write identification field of the file header as the current write identification value, and configures the number of write entries in the file header as zero;

[0037] The second control unit queries the unique identification value corresponding to the current write identification value as the current write position.

[0038] Preferably, the data table is configured with a data content field; then the second control unit includes:

[0039] The first judgment subunit is used to generate a first signal when judging that the number of data items written in the data table has not reached the limit of the number of written items, and to generate a second signal when judging that the number of data items written in the data table has reached the limit of the number of written items:

[0040] a second judgment subunit, connected to the first judgment subunit, for querying and judging according to the first signal that the data content field at the current write position is written into a file header, generating a data unique identification value associated with the data unique identification field at a position next to the file header write position, so as to write an operation data of the single file into the data content field at the write position represented by the data unique identification value, configure the data write identification field of the file header as the first written identification value, configure the data write identification field of the operation data as the current write identification value, and increase the number of write entries in the file header by one,

[0041] And when it is queried and determined that the data content field of the current write position is not written to the file header, a new data unique identification value is generated at the next position of the current write position, so as to write a piece of operation data of the single file into the data content field of the write position represented by the data unique identification value, and the data write identification field of the file header is configured as the second written identification value, the data write identification field of the previous operation data is configured as the first written identification value, the data write identification field of the operation data currently being written is configured as the current write identification value, and the number of writes in the file header is increased by one;

[0042] A storage control subunit, connected to the first judgment subunit, is used to query the next data unique identification value of the data unique identification value associated with the current write position according to the second signal, so as to write an operation data of the single file into the data content field of the write position represented by the queried data unique identification value, configure the data write identification field of the previous operation data as the first written identification value, configure the data write identification field of the operation data currently being written as the current write identification value, and the number of writes in the file header remains unchanged.

[0043] Preferably, the data table is also configured with a data valid length field;

[0044] Each time the second control unit writes the operation data into the data content field, it also includes counting the effective content length of each operation data and writing it into the corresponding data effective length field.

[0045] The above technical solution has the following advantages or beneficial effects:

[0046] 1) Using a database to store a single file eliminates the need for file offsets, thus reducing the logical complexity of storing single file content;

[0047] 2) When the operation data is written, the number of entries written in the file header is synchronously updated to ensure that the number of entries written is consistent with the actual number of operation data. At the same time, the effective content length of the operation data is recorded to facilitate system retrieval and storage, prevent power-off storage anomalies, and effectively solve the problem of the master station being unable to parse the data due to inconsistency between the number of entries written and the actual number of entries, or the total size of the operation data not matching the data content. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic flow chart of a single file storage method of a feeder terminal unit in a preferred embodiment of the present invention;

[0049] Figure 2 Schematic diagram of a sub-process of step S2 in a preferred embodiment of the present invention;

[0050] Figure 3 The structure diagram of a single file storage system of a feeder terminal unit in a preferred embodiment of the present invention is shown. DETAILED DESCRIPTION

[0051] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The present invention is not limited to this embodiment, and other embodiments may also fall within the scope of the present invention as long as they conform to the gist of the present invention.

[0052] In a preferred embodiment of the present invention, based on the above-mentioned problems existing in the prior art, a single file storage method of a feeder terminal unit is provided, wherein a database is pre-configured in the feeder terminal unit, the database is associated with at least one data table, each data table stores a single file correspondingly, and the data table is configured with a corresponding write number limit;

[0053] like Figure 1 As shown, the single file storage method includes:

[0054] Step S1: when a single file is generated during the operation of the feeder terminal unit, query whether the corresponding data table is an empty table:

[0055] If yes, write the file header of the single file into the data table, and set the number of entries written in the file header to zero, and then go to step S2;

[0056] If not, go to step S2;

[0057] Step S2: The feeder terminal unit determines whether the number of data items written into the data table has reached the limit of the number of data items written.

[0058] If not, query the current write position in the data table, mark the next position of the current write position as the current write position, write one operation data contained in the single file, and increase the number of writes in the file header by one, and then return to step S1;

[0059] If so, query the current write position in the data table, mark the next position of the current write position as the current write position, so as to cyclically overwrite and write an operation data contained in a single file, and the number of writes in the file header remains unchanged, and then return to step S1.

[0060] Specifically, in this embodiment, the above-mentioned single file may be a historical data file of a feeder terminal unit, and the single file has the characteristics that once generated, its file name does not change, has a certain data storage capacity limit, and needs to have data cyclic storage capabilities. For example, for a single file storing remote control operation records of a feeder terminal unit, the grid regulations require that it needs to have the requirement of cyclic storage of no less than 1024 pieces of operation data.

[0061] Based on this, for a newly used feeder terminal unit, which has not generated any remote control operation records, the data table corresponding to its single file is an empty table. In a preferred embodiment of the present invention, a data unique identification field and a data write identification field are configured in the data table;

[0062] Then in step S1, when the field value of the data write identification field in the data table queried by the feeder terminal unit does not contain the current write identification value, it indicates that the data table is an empty table, and then a file header unique identification value of the associated data unique identification field is generated, and the file header of the single file is written to the write position represented by the file header unique identification value, and the data write identification field of the file header is configured as the current write identification value, and the number of write entries in the file header is configured as zero;

[0063] In step S2, the feeder terminal unit queries the file header unique identification value corresponding to the current write identification value as the current write position.

[0064] Specifically, in this embodiment, when a single file is generated, the data table can be searched first. If the data table is an empty table, it does not contain the current write identification value, otherwise it should contain the current write identification value to indicate which position in the data table is currently written. If the data table is an empty table, when a remote control operation record is generated in subsequent use, the file header is first written in the data table. The data content contained in the file header may include the file name, file version number, device ID of the feeder terminal unit, the number of remote control operation records (i.e., the number of writes), etc. Since no remote control operation record (i.e., operation data) has been written yet, the initial value of the number of writes should be zero.

[0065] When an operation data is generated later, it is written to the position after the file header. For example, if the file header unique identification value representing the position where the file header is written is 0, the data unique identification value of the first operation data is 1, and the data unique identification value of the second operation data is 2, and the limit of the number of writes is 1024, then the data unique identification value of the 1024th operation data is 1024, and the number of writes increases by one. At this time, the data table is full. If it is generated by operation data again, it is written in a cyclic overwrite writing mode. For example, the data unique identification value of the 1025th operation data returns to 1, overwriting the first operation data in the history. You can also delete the first operation data first, and then write the 1025th operation data. After the data table is full, there are always 1024 operation data written in the data table, and the number of writes remains unchanged.

[0066] In a preferred embodiment of the present invention, a data content field is configured in the data table; Figure 2 As shown, step S2 includes:

[0067] Step S21, the feeder terminal unit determines whether the number of data entries written into the data table reaches the limit of the number of entries written:

[0068] If not, go to step S22;

[0069] If yes, go to step S23;

[0070] Step S22, the feeder terminal unit queries and determines whether the data content field at the current writing position is written as a file header:

[0071] If so, a data unique identification value of the associated data unique identification field is generated at the next position of the file header write position, so as to write a piece of operation data of the single file into the data content field of the write position represented by the data unique identification value, and configure the data write identification field of the file header as the first written identification value, configure the data write identification field of the operation data as the current write identification value, and increase the number of write entries in the file header by one, and then return to step S1;

[0072] If not, a new data unique identification value is generated at the next position of the current write position, so as to write one piece of operation data of the single file into the data content field of the write position represented by the data unique identification value, and the data write identification field of the file header is configured as the second written identification value, the data write identification field of the previous operation data is configured as the first written identification value, the data write identification field of the currently written operation data is configured as the current write identification value, and the number of write entries in the file header is increased by one, and then the process returns to step S1;

[0073] Step S23, the feeder terminal unit queries the next data unique identification value of the data unique identification value associated with the current write position, so as to write one operation data of a single file into the data content field of the write position represented by the queried data unique identification value, configure the data write identification field of the previous operation data as the first written identification value, configure the data write identification field of the currently written operation data as the current write identification value, and the number of writes in the file header remains unchanged, and then returns to step S1.

[0074] Specifically, in this embodiment, the configured data table only contains multiple fields, and the field value of each field is initially blank. Taking the write limit of 1024 as an example, when the data table is not full, each time an operation data is generated and needs to be written, a data unique identification value for the operation record will be generated. After it is full, the data unique identification value remains unchanged, and only the data content is changed.

[0075] Taking the above file header unique identification value as 0, data unique identification value as 1 to n, current write identification value as 2, first written identification value as 0, and second written identification value as 1 as an example, after the file header is written into the blank table, the field values ​​of each field in the data table are as follows:

[0076]

[0077] After writing the first operation data, the field values ​​of each field in the data table are as follows:

[0078]

[0079]

[0080] When writing the second operation data, it is found that the data write identification field of the first operation data is 2, indicating that the last operation data was written to the first operation data, so the corresponding data unique identification value 2 is generated. After the second operation data is written, the field values ​​of each field in the data table are as follows:

[0081]

[0082] After the third operation data is written, the field values ​​of each field in the data table are as follows:

[0083]

[0084] And so on, until the nth operation data is written:

[0085]

[0086]

[0087] At this point, it means that the data table is full. If another operation data is generated, the original first operation data in the position where the data unique identification value is 1 will be deleted, and then a new operation data will be written, and the field values ​​of each field will be updated accordingly. After the writing is completed, the field values ​​of each field in the data table are as follows:

[0088]

[0089] It can be seen that the data write identification field can accurately locate the current write position, which is convenient for system retrieval and can be located in time when power is off, which is convenient for data recovery.

[0090] In a preferred embodiment of the present invention, the data table is further configured with a data effective length field;

[0091] Then in step S2, each time the feeder terminal unit writes operation data into the data content field, it also includes counting the effective content length of each operation data and writing it into the corresponding data effective length field.

[0092] Specifically, in this embodiment, considering that when the feeder terminal unit reports data to the connected distribution master station, it only needs to report the valid data content and the corresponding valid content length. For the convenience of reporting, the valid content length is recorded at the same time when writing to meet the data reporting requirements.

[0093] It can be understood that the configuration of the above fields can be customized according to different single files. For example, if the operation time of the operation data needs to be recorded, the corresponding time recording field can be configured accordingly. For example, for alarm data, if the alarm data reporting situation needs to be recorded, the alarm reporting field can be configured accordingly.

[0094] In a preferred embodiment of the present invention, after executing step S2, the method further includes:

[0095] When receiving a reporting instruction containing several data unique identification values ​​sent by the distribution master station connected to the feeder terminal unit, the feeder terminal unit retrieves the data table according to the data unique identification value, and reports the field information of the data content field and the data valid length field associated with each retrieved data unique identification value to the distribution master station.

[0096] In a preferred embodiment of the present invention, after executing step S2, the method further includes:

[0097] The feeder terminal unit periodically reports the number of entries written in the file header and the field information of the data content field and the data valid length field associated with each data unique identification value to the power distribution master station connected to the feeder terminal unit.

[0098] The present invention also provides a single file storage system for a feeder terminal unit, using the above-mentioned single file storage system, such as Figure 3 As shown, the single file storage system includes:

[0099] Database 1, configured in the feeder terminal unit, database 1 is associated with at least one data table, each data table stores a single file, and the data table is configured with a corresponding write number limit;

[0100] The storage control module 2 is connected to the database 1 and includes:

[0101] The first control unit 21 is used for, when a single file is generated during the operation of the feeder terminal unit, when the corresponding data table is queried to be empty, writing the file header of the single file into the data table, configuring the number of entries written in the file header to zero, and generating a judgment signal when the data table is not empty;

[0102] The second control unit 22 is connected to the first control unit 21 and is used to determine, according to the judgment signal, that the number of data items written into the data table has not reached the limit of the number of items written, query the current writing position in the data table, mark the next position of the current writing position as the current writing position, write an operation data item contained in the single file, and increase the number of items written into the file header by one.

[0103] When the number of data items written into the data table reaches the write limit, the current write position in the data table is queried, and the next position of the current write position is marked as the current write position, so as to cyclically overwrite an operation data item contained in the single file, and the number of write items in the file header remains unchanged.

[0104] In a preferred embodiment of the present invention, a data unique identification field and a data write identification field are configured in the data table;

[0105] When the first control unit 21 queries the data table and finds that the field value of the data write identification field does not contain the current write identification value, it indicates that the data table is an empty table, and then generates a file header unique identification value for the associated data unique identification field, writes the file header of the single file into the write position represented by the file header unique identification value, configures the data write identification field of the file header to the current write identification value, and configures the number of write entries in the file header to zero;

[0106] The second control unit 22 queries the unique identification value corresponding to the current write identification value as the current write position.

[0107] In a preferred embodiment of the present invention, a data content field is configured in the data table; the second control unit 22 includes:

[0108] The first judgment subunit 221 is used to generate a first signal when judging that the number of data items written in the data table has not reached the limit of the number of written items, and to generate a second signal when judging that the number of data items written in the data table has reached the limit of the number of written items:

[0109] The second judgment subunit 222 is connected to the first judgment subunit 221 and is used to query and judge according to the first signal that when the data content field of the current write position is written into the file header, generate a data unique identification value of the associated data unique identification field at the next position of the file header write position, so as to write an operation data of a single file into the data content field of the write position represented by the data unique identification value, configure the data write identification field of the file header as the first written identification value, configure the data write identification field of the operation data as the current write identification value, and increase the number of write entries in the file header by one.

[0110] And when it is queried and determined that the data content field of the current write position is not written to the file header, a new data unique identification value is generated at the next position of the current write position, so as to write a piece of operation data of the single file into the data content field of the write position represented by the data unique identification value, and the data write identification field of the file header is configured as the second written identification value, the data write identification field of the previous operation data is configured as the first written identification value, the data write identification field of the operation data currently being written is configured as the current write identification value, and the number of writes in the file header is increased by one;

[0111] The storage control subunit 223 is connected to the first judgment subunit 221, and is used to query the next data unique identification value of the data unique identification value associated with the current write position according to the second signal, so as to write an operation data of a single file into the data content field of the write position represented by the queried data unique identification value, configure the data write identification field of the previous operation data as the first written identification value, configure the data write identification field of the currently written operation data as the current write identification value, and the number of writes in the file header remains unchanged.

[0112] In a preferred embodiment of the present invention, the data table is further configured with a data effective length field;

[0113] Each time the second control unit 22 writes operation data into the data content field, it also includes counting the effective content length of each operation data and writing it into the corresponding data effective length field.

[0114] The above description is only a preferred embodiment of the present invention, and does not limit the implementation mode and protection scope of the present invention. For those skilled in the art, it should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the contents of this specification and illustrations should be included in the protection scope of the present invention.

Claims

1. A single file storage method for a feeder terminal unit, characterized in that: The feeder terminal unit is pre-configured with a database, the database is associated with at least one data table, each data table stores a single file, and the data table is configured with a corresponding write number limit; Then the single file storage method includes: Step S1, when the single file is generated during the operation of the feeder terminal unit, query whether the corresponding data table is an empty table: If yes, write the file header of the single file into the data table, and set the number of entries written in the file header to zero, and then go to step S2; If not, go to step S2; Step S2, the feeder terminal unit determines whether the number of data items written into the data table reaches the limit of the number of data items written: If not, query the current write position in the data table, mark the next position of the current write position as the current write position, write one operation data contained in the single file, and increase the number of writes in the file header by one, and then return to step S1; If yes, query the current write position in the data table, mark the next position of the current write position as the current write position, so as to cyclically overwrite and write one operation data contained in the single file, and the number of written entries in the file header remains unchanged, and then return to step S1; The data table is configured with a data unique identification field and a data write identification field; Then in the step S1, when the field value of the data write identification field in the data table queried by the feeder terminal unit does not contain the current write identification value, it indicates that the data table is an empty table, and then a file header unique identification value associated with the data unique identification field is generated, the file header of the single file is written to the write position represented by the file header unique identification value, the data write identification field of the file header is configured as the current write identification value, and the number of write entries in the file header is configured as zero; In the step S2, the feeder terminal unit queries the file header unique identification value corresponding to the current write identification value as the current write position.

2. The single file storage method according to claim 1, characterized in that: The data table is configured with a data content field; then step S2 comprises: Step S21, the feeder terminal unit determines whether the number of data items written into the data table reaches the limit of the number of data items written: If not, go to step S22; If yes, go to step S23; Step S22, the feeder terminal unit queries and determines whether the data content field at the current writing position is written as a file header: If so, a data unique identification value associated with the data unique identification field is generated at the next position of the file header write position, so as to write one operation data of the single file into the data content field of the write position represented by the data unique identification value, and the data write identification field of the file header is configured as the first written identification value, the data write identification field of the operation data is configured as the current write identification value, and the number of written entries in the file header is increased by one, and then the process returns to step S1; If not, a new data unique identification value is generated at the next position of the current write position, so as to write one piece of operation data of the single file into the data content field of the write position represented by the data unique identification value, and the data write identification field of the file header is configured as the second written identification value, the data write identification field of the previous piece of operation data is configured as the first written identification value, the data write identification field of the currently written operation data is configured as the current write identification value, and the number of written pieces in the file header is increased by one, and then the process returns to step S1; Step S23, the feeder terminal unit queries the next data unique identification value of the data unique identification value associated with the current write position, so as to write one operation data of the single file into the data content field of the write position represented by the queried data unique identification value, configure the data write identification field of the previous operation data as the first written identification value, configure the data write identification field of the currently written operation data as the current write identification value, the number of writes in the file header remains unchanged, and then returns to step S1.

3. The single file storage method according to claim 2, characterized in that: The data table is also configured with a data effective length field; Then in the step S2, each time the feeder terminal unit writes the operation data into the data content field, it also includes counting the effective content length of each operation data and writing it into the corresponding data effective length field.

4. The single file storage method according to claim 3, characterized in that: After executing step S2, the method further includes: Upon receiving a reporting instruction containing several data unique identification values ​​sent by the distribution master station connected to the feeder terminal unit, the feeder terminal unit retrieves the data table according to the data unique identification value, and reports the field information of the data content field and the data valid length field associated with each retrieved data unique identification value to the distribution master station.

5. The single file storage method according to claim 3, characterized in that: After executing step S2, the method further includes: The feeder terminal unit periodically reports the number of entries written in the file header and the data content field and the data valid length field associated with each data unique identification value to the power distribution master station connected to the feeder terminal unit.

6. A single file storage system for a feeder terminal unit, characterized in that: Applying the single file storage method according to any one of claims 1 to 5, the single file storage system comprises: A database, configured in the feeder terminal unit, the database is associated with at least one data table, each data table stores a single file, and the data table is configured with a corresponding write number limit; A storage control module is connected to the database, and the storage control module includes: A first control unit is used for, when the single file is generated during the operation of the feeder terminal unit, when the corresponding data table is queried and found to be an empty table, writing the file header of the single file into the data table, configuring the number of entries written in the file header to zero, and generating a judgment signal when the data table is not an empty table; a second control unit connected to the first control unit, for determining, according to the judgment signal, that the number of data items written into the data table has not reached the limit of the number of items written, querying the current write position in the data table, marking the next position of the current write position as the current write position, writing an operation data item contained in the single file, and increasing the number of items written into the file header by one; When the number of data items written in the data table reaches the write limit, the current write position in the data table is queried, and the next position of the current write position is marked as the current write position, so as to cyclically overwrite and write an operation data item contained in the single file, and the write number of the file header remains unchanged.

7. The single file storage system according to claim 6, characterized in that: The data table is configured with a data unique identification field and a data write identification field; When the first control unit queries the data table and finds that the field value of the data write identification field does not include the current write identification value, it indicates that the data table is an empty table, and then generates a file header unique identification value associated with the data unique identification field, writes the file header of the single file to the write position represented by the file header unique identification value, configures the data write identification field of the file header as the current write identification value, and configures the number of write entries in the file header as zero; The second control unit queries the file header unique identification value corresponding to the current write identification value as the current write position.

8. The single file storage system according to claim 7, characterized in that: The data table is configured with a data content field; Then the second control unit includes: The first judgment subunit is used to generate a first signal when judging that the number of data items written in the data table has not reached the limit of the number of written items, and to generate a second signal when judging that the number of data items written in the data table has reached the limit of the number of written items: a second judgment subunit, connected to the first judgment subunit, for querying and judging according to the first signal that the data content field at the current write position is written into a file header, generating a data unique identification value associated with the data unique identification field at a position next to the file header write position, so as to write an operation data of the single file into the data content field at the write position represented by the data unique identification value, configure the data write identification field of the file header as the first written identification value, configure the data write identification field of the operation data as the current write identification value, and increase the number of write entries in the file header by one, And when it is queried and determined that the data content field of the current write position is not written to the file header, a new data unique identification value is generated at the next position of the current write position, so as to write a piece of operation data of the single file into the data content field of the write position represented by the data unique identification value, and the data write identification field of the file header is configured as the second written identification value, the data write identification field of the previous operation data is configured as the first written identification value, the data write identification field of the operation data currently being written is configured as the current write identification value, and the number of writes in the file header is increased by one; A storage control subunit, connected to the first judgment subunit, is used to query the next data unique identification value of the data unique identification value associated with the current write position according to the second signal, so as to write an operation data of the single file into the data content field of the write position represented by the queried data unique identification value, configure the data write identification field of the previous operation data as the first written identification value, configure the data write identification field of the operation data currently being written as the current write identification value, and the number of writes in the file header remains unchanged.

9. The single file storage system according to claim 8, characterized in that: The data table is also configured with a data effective length field; Each time the second control unit writes the operation data into the data content field, it also includes counting the effective content length of each operation data and writing it into the corresponding data effective length field.

Citation Information

Patent Citations

  • A reconfigurable feeder termination system

    CN102270881A

  • Method for realizing circulatory storage of records in single file and positioning, reading and shifting of records

    CN103226602A