CN113609124A - Data record storage method and system with expandability - Google Patents

Data record storage method and system with expandability Download PDF

Info

Publication number
CN113609124A
CN113609124A CN202110678641.2A CN202110678641A CN113609124A CN 113609124 A CN113609124 A CN 113609124A CN 202110678641 A CN202110678641 A CN 202110678641A CN 113609124 A CN113609124 A CN 113609124A
Authority
CN
China
Prior art keywords
data
storage
store
array
storing
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.)
Granted
Application number
CN202110678641.2A
Other languages
Chinese (zh)
Other versions
CN113609124B (en
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.)
Tianjin Jinhang Computing Technology Research Institute
Original Assignee
Tianjin Jinhang Computing Technology Research Institute
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 Tianjin Jinhang Computing Technology Research Institute filed Critical Tianjin Jinhang Computing Technology Research Institute
Priority to CN202110678641.2A priority Critical patent/CN113609124B/en
Publication of CN113609124A publication Critical patent/CN113609124A/en
Application granted granted Critical
Publication of CN113609124B publication Critical patent/CN113609124B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management

Abstract

A data record storage method with scalability, comprising: defining a storage table structure; defining constant data; defining a hybrid data information structure; defining a two-dimensional array for storing buffer data; storing the content of the mixed data information structure; periodically storing the data; and traversing according to the array columns, and circularly writing the data into the external storage medium. The data record storage mode with expandability provided by the invention designs a storage table structure, manages all variables needing to store data in the system, and acquires the values of the variables according to the addresses in real time in the software running process. The entire variables are stored periodically in the low priority thread. The processing in this way not only has strong expansibility, but also the user can increase the variables to be recorded at will. And the core control time sequence of the system is not influenced.

Description

Data record storage method and system with expandability
Technical Field
The invention relates to a data record storage method with expandability, and belongs to the field of computer control.
Background
In a computer control system, the method is particularly important for process data recording, and the data recording has important significance for system debugging, fault diagnosis, fault positioning, maintenance time shortening and the like. For example, in a flight system, process recorded data is used for recording motion parameters and states of subsystems in the flight process, and in a scientific research and flight trial stage, the recorded data is often required to participate in system troubleshooting and control law and parameter adjustment work according to the recorded data. The data recording is an important function in a computer control system, the state of the system when the system fails can be traced according to the recorded process data, and the data recording plays a guiding role in system optimization and parameter adjustment. The traditional data recording method is to add storage device operation at the key control position of the control system to record data to the storage device, and the processing method has the disadvantages that the increase of system data output at the place with higher time sequence has influence on the control efficiency, and the operation of the storage device has time uncertainty, and the core control of the system is easily affected with great disastrous effect. A large number of parameters in the control system are often recorded, and if the parameters are recorded dispersedly, the requirement on the maintainability cost of data is high, and the expandability and maintainability of system software are poor.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the method overcomes the defects of the prior art, provides a data record storage method with expandability, integrates and unifies the data record function of the system on the premise of not influencing the core control of the system, and has stronger expandability for the parameter record of the system.
The technical solution of the invention is as follows:
a data record storage method with expandability comprises the following steps:
(1) defining a storage table structure, and carrying out storage management on all global variables needing to be recorded in the software system;
(2) defining a constant array dataRec according to the structure of the storage table in the step (1) and initializing, wherein the length of the constant array is determined by an initialization variable, the array is an information table needing to store data, and data information needing to be stored is filled into the array;
(3) defining a hybrid data information structure STORE _ INFO, which records all information of a data record; the method comprises the steps of obtaining a name, a function code, a storage frequency, a data storage table pointer, a storage table type pointer and the number of stored information;
(4) defining a two-dimensional array BUFFER for storing BUFFER data, and circularly storing the recorded data; the row information of the two-dimensional array is the number of the cache areas, and the column information of the two-dimensional array is the length written into the storage medium;
(5) when the system is started, storing the content of a mixed data information structure STORE _ INFO into the two-dimensional array BUFFER;
(6) after the system is started, periodically storing data in a storage table STORE _ LIST in the running process;
(7) and writing the data of the two-dimensional array BUFFER into the storage device.
Further, the storage table structure STORE _ LIST includes four members:
the sequence number Num of the stored data, and the type is defined as integer;
storing the Name of the data, wherein the type is a signed character type constant;
the byte Size occupied by the stored data is unsigned character type;
and storing a global variable pointer pVar of the data, wherein the type of the global variable pointer pVar is an unsigned character type pointer.
Further, the step (2) defines a constant array dataRec and initializes the constant array dataRec, specifically:
(2.1) an element in the constant array is a storage table structure STORE _ LIST, the constant array dataRec comprises all data needing to be recorded and stored in the system, the array length is set to be null when the array is defined, and the array length is determined by an initialization variable;
(2.2) designing the content of all elements in the array, wherein the content comprises four elements:
the first element represents the sequence number of the variable storage, and the start is from 1;
the second element is the name of the storage variable;
thirdly, defining a signed character type as 1 by a macro definition mode, representing that the number of occupied bytes is 1, defining a signed short integer as 2, representing that the number of occupied bytes is 2, defining a signed integer as 4, and representing that the number of occupied bytes is 4;
the fourth element is an address stored as a global variable.
Further, the step (3) defines a mixed data information structure STORE _ INFO, specifically:
(3.1) the name MixName of the mixed data information structure STORE _ INFO, the type is a signed character type constant;
(3.2) the function code MixFunc of the mixed data information structure STORE _ INFO is unsigned integer;
(3.3) the storage frequency MixRate of the mixed data information structure STORE _ INFO, wherein the defined type is a floating point type, and the unit is Hz;
(3.4) STORE table STORE _ LIST type pointer PList, this element being directly associated with the set constant array dataRec;
(3.5) the number of STORE _ LIST elements in the storage table structure is MixNum.
Further, the storing the hybrid data information structure STORE _ INFO into the two-dimensional array BUFFER specifically includes:
(5.1) storing the mixed data information structure STORE _ INFO, wherein the mixed data information STORE _ INFO is continuously stored for N times, and N is a positive integer;
(5.2) the stored contents include a name MixName of the hybrid data information structure, a function code MixFunc of the hybrid data information structure STORE _ INFO, and a storage frequency MixRate of the hybrid data information structure STORE _ INFO;
(5.3) calculating the length Size of the Name in the storage table STORE _ LIST, and copying the Name into the sending buffer array by using a memory copy function; and circularly assigning the information in the storage table STORE _ LIST to a sending buffer array, wherein the information comprises the space occupied by the name of each table element, the name of the table and the space of data, storing the data in the sending buffer array in a log file storage mode, and entering the next step.
Further, the step (6) periodically STOREs the data in the storage table STORE _ LIST during the operation process, specifically:
(6.1) starting a timer in the initialization process, and periodically saving data in a storage table STORE _ LIST in a timer callback function;
(6.2) the design of the storage message comprises two initial bytes, the total length of the two bytes, a time stamp of four bytes, a storage type of one byte and a function code of two bytes;
(6.3) traversing the storage table STORE _ LIST, and assigning values according to the types of the stored data;
and (6.4) after traversing is finished, calculating and storing the total length of all data, putting the third four bytes of the data frame, calculating and checking all data, filling a termination code, and putting a two-dimensional array BUFFER for storing the BUFFER data.
Further, the step (7) writes the data of the two-dimensional array BUFFER into the storage device, specifically:
(7.1) circularly judging the currently stored byte number LEN _ NOW by using the column of the two-dimensional array BUFFER as a variable, and when the byte number is larger than or equal to the byte number WRITE _ ONCE _ LEN which is allowed to be written ONCE by the storage device, sending the head address of the column of the two-dimensional array and the length WRITE _ ONCE _ LEN of data to be written to a data storage operation thread through a message queue;
(7.2) adding one to the number of the columns of the two-dimensional array, if the number after adding one is BUF _ NUM, the number of the rows is 0, copying unsent data in the previous column with the length of LEN _ NOW-WRITE _ ONCE _ LEN to the forefront of the memory in the column through the memory, and moving the pointer to the position needing to WRITE data.
Further, the present invention also provides a data recording and storing system, including:
a storage table module: defining a storage table structure, and carrying out storage management on all global variables needing to be recorded in the software system;
an initialization module: defining a constant array dataRec according to a storage table structure and initializing, wherein the length of the constant array is determined by an initialization variable, the array is an information table needing to store data, and data information needing to be stored is filled into the array;
the mixed data information structure defining module: defining a hybrid data information structure STORE _ INFO, which records all information of a data record; the method comprises the steps of obtaining a name, a function code, a storage frequency, a data storage table pointer, a storage table type pointer and the number of stored information;
two-dimensional array definition module: defining a two-dimensional array BUFFER for storing BUFFER data, and circularly storing the recorded data; the row information of the two-dimensional array is the number of the cache areas, and the column information of the two-dimensional array is the length written into the storage medium;
a starting module: when the system is started, storing the content of a mixed data information structure STORE _ INFO into the two-dimensional array BUFFER;
a storage module: after the system is started, periodically storing data in a storage table STORE _ LIST in the running process; and writing the data of the two-dimensional array BUFFER into the storage device.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides a data record storage mode with expandability, which designs a storage table structure to manage all variables needing to store data in a system and obtains the values of the variables according to addresses in real time in the software running process. The entire variables are stored periodically in the low priority thread. The processing in this way not only has strong expansibility, but also the user can increase the variables to be recorded at will. And the core control time sequence of the system is not influenced.
Drawings
Fig. 1 illustrates a data record storage method with scalability.
Detailed Description
The following describes embodiments of the present invention in further detail with reference to the accompanying drawings.
The data recording is an important function in a computer control system, the state of the system when the system fails can be traced according to the recorded process data, and the data recording plays a guiding role in system optimization and parameter adjustment. The traditional data recording method is to add storage device operation at the key control position of the control system to record data to the storage device, and the processing method has the disadvantages that the increase of system data output at the place with higher time sequence has influence on the control efficiency, and the operation of the storage device has time uncertainty, and the core control of the system is easily affected with great disastrous effect. A large number of parameters in the control system are often recorded, and if the parameters are recorded dispersedly, the requirement on the maintainability cost of data is high, and the expandability and maintainability of system software are poor. Therefore, the invention provides a novel data recording method, which integrates and unifies the system data recording function and has stronger expansibility for system parameter recording on the premise of not influencing the core control of the system.
As shown in fig. 1, the present invention provides a scalable data record storage method, which includes the following steps:
1. defining a storage table structure, and managing all global variables needing to be recorded in the software system, including a storage data sequence number, a storage data name, the number of bytes occupied by data and a no-type pointer.
2. Constant data is defined according to the structure designed by 1, the length of the array is determined by an initialization variable, and data information required to be stored is filled into the array.
3. Defining a mixed data information structure including a name, a function code, a storage frequency, a data storage table pointer, a storage table type pointer, and the number of stored information.
4. Defining a two-dimensional array for storing buffer data, circularly storing the recorded data, wherein the row information of the array is the number of buffer areas, and the array column information is the length written into the storage medium.
5. And storing the content of the mixed data information structure, including the name, the function code and the storage frequency, including the name and the type of each variable.
6. And periodically storing the data, and storing information of each variable in a two-dimensional buffer area according to a storage table structure according to a message format.
7. And traversing according to the array columns, and circularly writing the data into the external storage medium.
The data record storage mode with expandability provided by the invention designs a storage table structure, manages all variables needing to store data in the system, and acquires the values of the variables according to the addresses in real time in the software running process. The entire variables are stored periodically in the low priority thread. The processing in this way not only has strong expansibility, but also the user can increase the variables to be recorded at will. And the core control time sequence of the system is not influenced.
Example (b):
s1, defining a storage table structure STORE _ LIST, and performing storage management on all global variables needing to be recorded in the software system, wherein the structure comprises four members:
(1) number Num of stored data (type defined as integer)
(2) The Name of the data (type is signed character type constant) is stored.
(3) The number Size of bytes occupied by the stored data (the type is an unsigned character type).
(4) A global variable pointer pVar (type unsigned character type pointer) for the stored data.
S2, setting a constant array dataRec and initializing (dataRec is the name of the array), wherein the array is an information table needing to store data.
(1) The element in the array is a storage table structure STORE _ LIST, the constant array dataRec includes all data to be recorded and stored in the system, the array length is set to be null (no specific value is filled) when defining the array for the expandable type of the system, and the array length is determined by an initialization variable (obtaining the array length uses sizeof (dataRec)).
(2) Designing the content of all elements in the array, wherein the content comprises four elements: the first element represents the sequence number of the variable storage, and the start is from 1; the second element is the name of a storage variable, such as rolling 'ROLL', pitching 'PITCH', course 'YAW' and the like; thirdly, defining a signed character type as 1 by a macro definition mode, representing that the number of occupied bytes is 1, defining a signed short integer as 2, representing that the number of occupied bytes is 2, defining a signed integer as 4, and representing that the number of occupied bytes is 4; fourthly, the fourth element is an address stored as a global variable, different variable addresses have different pointer types, and the element type is defined as a void type and can be converted into any type. The two steps S1 and S2 define a table of information that needs to be stored.
S3: a hybrid data information structure STORE _ INFO is defined, which structure records all the information of the data record:
(1) the name MixName of the hybrid data information structure STORE _ INFO, type signed character type constants,
(2) function code MixFunc of mixed data information structure STORE _ INFO, the type is unsigned integer
(3) The storage frequency MixRate of the hybrid data information structure STORE _ INFO is defined to be of the floating point type in Hz.
(4) STORE table STORE _ LIST type pointer PList, this element being directly associated with the constant array dataRec set by S2
(5) The number MixNum of the STORE _ LIST elements of the table structure.
S4: defining a two-dimensional array BUFFER for storing the BUFFER data, and circularly storing the recorded data. The row information of the array is the number BUF _ NUM of the cache area, the column information of the array is the length ONCE _ WR _ SIZE of the write-ONCE storage medium plus the data overflow protection length EXTRA _ LEN (the data overflow protection length EXTRA _ LEN is used for preventing the system from storing data larger than the length of the write-ONCE storage medium, EXTRA length storage needs to be added, and the length is EXTRA _ LEN).
S5, when the system is started, the mixed data information structure STORE _ INFO is stored in the two-dimensional array BUFFER defined by S4.
(1) The hybrid data information structure STORE _ INFO is stored N times in succession (generally 3 for SD card depending on the characteristic setting of the medium) in consideration of the possibility of a failure of the write operation of the medium.
(2) The stored content comprises the name MixName of the hybrid data information structure, MixFunc, the function code MixFunc of the hybrid data information structure STORE _ INFO, and the storage frequency MixRate of the hybrid data information structure STORE _ INFO.
(3) The length Size of the Name in the storage table STORE _ LIST is calculated and the Name is copied into the send buffer array using the memory copy function. Circularly assigning the information in the storage table STORE _ LIST to the sending buffer array, including the space occupied by the name of each table element, the name of the table, and the space of the data, storing the data in the sending buffer array by saving the log file, and the storing method goes to S7.
And S6, periodically storing the data in the storage table STORE _ LIST in the running process after the system is started.
(1) And starting a timer in the initialization process, periodically storing the data in the storage table STORE _ LIST in a timer callback function, wherein the stored message uses the stored message designed in the next step.
(2) The store message design includes two start bytes (0x 550 xAA), the total length of two bytes. A four byte timestamp, a one byte memory type, and a two byte function code.
(3) The STORE _ LIST is traversed and assigned according to the type of data stored (one byte, two bytes and four bytes of the buffer are occupied by variables of different types according to the definition in S2).
(4) And after traversing, calculating and storing the total length of all data, and putting the third four bytes of the data frame. And calculating and checking all data, filling in ending codes (0x66 and 0x99), and putting in a two-dimensional array BUFFER for storing BUFFER data.
And S7, writing the data of the two-dimensional array BUFFER into the storage device.
(1) And circularly judging the currently stored byte number LEN _ NOW by using the column of the two-dimensional array BUFFER as a variable, and when the byte number is larger than or equal to the byte number WRITE _ ONCE _ LEN allowed to be written ONCE by the storage device, sending the head address of the column of the two-dimensional array and the length WRITE _ ONCE _ LEN of data to be written to a data storage operation thread through a message queue.
(2) And adding one to the column number of the two-dimensional array, if the numerical value after adding one is BUF _ NUM, the value of the row number is 0, copying unsent data in the previous column with the length of LEN _ NOW-WRITE _ ONCE _ LEN to the forefront of the memory in the column through the memory, and moving a pointer to a position needing to WRITE data.
The data record storage method with expandability integrates and unifies the data record functions of the system on the premise of not influencing the core control of the system, and the system parameter records have stronger expandability.
Those matters not described in detail in the present specification are well known in the art.

Claims (10)

1. A data record storage method with expandability is characterized by comprising the following steps:
(1) defining a storage table structure, and carrying out storage management on all global variables needing to be recorded in the software system;
(2) defining a constant array dataRec according to the structure of the storage table in the step (1) and initializing, wherein the length of the constant array is determined by an initialization variable, the array is an information table needing to store data, and data information needing to be stored is filled into the array;
(3) defining a hybrid data information structure STORE _ INFO, which records all information of a data record; the method comprises the steps of obtaining a name, a function code, a storage frequency, a data storage table pointer, a storage table type pointer and the number of stored information;
(4) defining a two-dimensional array BUFFER for storing BUFFER data, and circularly storing the recorded data; the row information of the two-dimensional array is the number of the cache areas, and the column information of the two-dimensional array is the length written into the storage medium;
(5) when the system is started, storing the content of a mixed data information structure STORE _ INFO into the two-dimensional array BUFFER;
(6) after the system is started, periodically storing data in a storage table STORE _ LIST in the running process;
(7) and writing the data of the two-dimensional array BUFFER into the storage device.
2. A scalable data record storage method according to claim 1, wherein: the storage table structure STORE _ LIST includes four members:
the sequence number Num of the stored data, and the type is defined as integer;
storing the Name of the data, wherein the type is a signed character type constant;
the byte Size occupied by the stored data is unsigned character type;
and storing a global variable pointer pVar of the data, wherein the type of the global variable pointer pVar is an unsigned character type pointer.
3. A scalable data record storage method according to claim 2, wherein: the step (2) defines a constant array dataRec and initializes the constant array dataRec, specifically:
(2.1) an element in the constant array is a storage table structure STORE _ LIST, the constant array dataRec comprises all data needing to be recorded and stored in the system, the array length is set to be null when the array is defined, and the array length is determined by an initialization variable;
(2.2) designing the content of all elements in the array, wherein the content comprises four elements:
the first element represents the sequence number of the variable storage, and the start is from 1;
the second element is the name of the storage variable;
thirdly, defining a signed character type as 1 by a macro definition mode, representing that the number of occupied bytes is 1, defining a signed short integer as 2, representing that the number of occupied bytes is 2, defining a signed integer as 4, and representing that the number of occupied bytes is 4;
the fourth element is an address stored as a global variable.
4. A scalable data record storage method according to claim 2, wherein: the step (3) defines a mixed data information structure STORE _ INFO, which specifically includes:
(3.1) the name MixName of the mixed data information structure STORE _ INFO, the type is a signed character type constant;
(3.2) the function code MixFunc of the mixed data information structure STORE _ INFO is unsigned integer;
(3.3) the storage frequency MixRate of the mixed data information structure STORE _ INFO, wherein the defined type is a floating point type, and the unit is Hz;
(3.4) STORE table STORE _ LIST type pointer PList, this element being directly associated with the set constant array dataRec;
(3.5) the number of STORE _ LIST elements in the storage table structure is MixNum.
5. A scalable data record storage method according to claim 4, wherein: the storing the mixed data information structure STORE _ INFO into the two-dimensional array BUFFER specifically includes:
(5.1) storing the mixed data information structure STORE _ INFO, wherein the mixed data information STORE _ INFO is continuously stored for N times, and N is a positive integer;
(5.2) the stored contents include a name MixName of the hybrid data information structure, a function code MixFunc of the hybrid data information structure STORE _ INFO, and a storage frequency MixRate of the hybrid data information structure STORE _ INFO;
(5.3) calculating the length Size of the Name in the storage table STORE _ LIST, and copying the Name into the sending buffer array by using a memory copy function; and circularly assigning the information in the storage table STORE _ LIST to a sending buffer array, wherein the information comprises the space occupied by the name of each table element, the name of the table and the space of data, storing the data in the sending buffer array in a log file storage mode, and entering the next step.
6. A scalable data record storage method according to claim 5, wherein: the step (6) is to periodically STORE the data in the storage table STORE _ LIST during the operation process, and specifically includes:
(6.1) starting a timer in the initialization process, and periodically saving data in a storage table STORE _ LIST in a timer callback function;
(6.2) the design of the storage message comprises two initial bytes, the total length of the two bytes, a time stamp of four bytes, a storage type of one byte and a function code of two bytes;
(6.3) traversing the storage table STORE _ LIST, and assigning values according to the types of the stored data;
and (6.4) after traversing is finished, calculating and storing the total length of all data, putting the third four bytes of the data frame, calculating and checking all data, filling a termination code, and putting a two-dimensional array BUFFER for storing the BUFFER data.
7. A scalable data record storage method according to claim 5, wherein: the step (7) writes the data of the two-dimensional array BUFFER into the storage device, specifically:
(7.1) circularly judging the currently stored byte number LEN _ NOW by using the column of the two-dimensional array BUFFER as a variable, and when the byte number is larger than or equal to the byte number WRITE _ ONCE _ LEN which is allowed to be written ONCE by the storage device, sending the head address of the column of the two-dimensional array and the length WRITE _ ONCE _ LEN of data to be written to a data storage operation thread through a message queue;
(7.2) adding one to the number of the columns of the two-dimensional array, if the number after adding one is BUF _ NUM, the number of the rows is 0, copying unsent data in the previous column with the length of LEN _ NOW-WRITE _ ONCE _ LEN to the forefront of the memory in the column through the memory, and moving the pointer to the position needing to WRITE data.
8. A data record storage system implemented by the scalable data record storage method according to claim 1, comprising:
a storage table module: defining a storage table structure, and carrying out storage management on all global variables needing to be recorded in the software system;
an initialization module: defining a constant array dataRec according to a storage table structure and initializing, wherein the length of the constant array is determined by an initialization variable, the array is an information table needing to store data, and data information needing to be stored is filled into the array;
the mixed data information structure defining module: defining a hybrid data information structure STORE _ INFO, which records all information of a data record; the method comprises the steps of obtaining a name, a function code, a storage frequency, a data storage table pointer, a storage table type pointer and the number of stored information;
two-dimensional array definition module: defining a two-dimensional array BUFFER for storing BUFFER data, and circularly storing the recorded data; the row information of the two-dimensional array is the number of the cache areas, and the column information of the two-dimensional array is the length written into the storage medium;
a starting module: when the system is started, storing the content of a mixed data information structure STORE _ INFO into the two-dimensional array BUFFER;
a storage module: after the system is started, periodically storing data in a storage table STORE _ LIST in the running process; and writing the data of the two-dimensional array BUFFER into the storage device.
9. The data record storage system according to claim 8, wherein:
the storage table structure STORE _ LIST includes four members:
the sequence number Num of the stored data, and the type is defined as integer;
storing the Name of the data, wherein the type is a signed character type constant;
the byte Size occupied by the stored data is unsigned character type;
storing a global variable pointer pVar of the data, wherein the type of the pointer is an unsigned character type pointer;
defining a constant array dataRec and initializing, specifically:
(2.1) an element in the constant array is a storage table structure STORE _ LIST, the constant array dataRec comprises all data needing to be recorded and stored in the system, the array length is set to be null when the array is defined, and the array length is determined by an initialization variable;
(2.2) designing the content of all elements in the array, wherein the content comprises four elements:
the first element represents the sequence number of the variable storage, and the start is from 1;
the second element is the name of the storage variable;
thirdly, defining a signed character type as 1 by a macro definition mode, representing that the number of occupied bytes is 1, defining a signed short integer as 2, representing that the number of occupied bytes is 2, defining a signed integer as 4, and representing that the number of occupied bytes is 4;
the fourth element is an address stored as a global variable;
defining a mixed data information structure STORE _ INFO, specifically:
(3.1) the name MixName of the mixed data information structure STORE _ INFO, the type is a signed character type constant;
(3.2) the function code MixFunc of the mixed data information structure STORE _ INFO is unsigned integer;
(3.3) the storage frequency MixRate of the mixed data information structure STORE _ INFO, wherein the defined type is a floating point type, and the unit is Hz;
(3.4) STORE table STORE _ LIST type pointer PList, this element being directly associated with the set constant array dataRec;
(3.5) the number of STORE _ LIST elements in the storage table structure is MixNum.
10. The data record storage system according to claim 8, wherein: storing a mixed data information structure STORE _ INFO in the two-dimensional array BUFFER, specifically:
(5.1) storing the mixed data information structure STORE _ INFO, wherein the mixed data information STORE _ INFO is continuously stored for N times, and N is a positive integer;
(5.2) the stored contents include a name MixName of the hybrid data information structure, a function code MixFunc of the hybrid data information structure STORE _ INFO, and a storage frequency MixRate of the hybrid data information structure STORE _ INFO;
(5.3) calculating the length Size of the Name in the storage table STORE _ LIST, and copying the Name into the sending buffer array by using a memory copy function; circularly assigning information in a storage table STORE _ LIST to a sending buffer array, wherein the information comprises a space occupied by the name of each table element, the name of the table and a space of data, and storing the data in the sending buffer array in a log file storage mode;
the method for periodically storing the data in the storage table STORE _ LIST in the operation process specifically comprises the following steps:
(6.1) starting a timer in the initialization process, and periodically saving data in a storage table STORE _ LIST in a timer callback function;
(6.2) the design of the storage message comprises two initial bytes, the total length of the two bytes, a time stamp of four bytes, a storage type of one byte and a function code of two bytes;
(6.3) traversing the storage table STORE _ LIST, and assigning values according to the types of the stored data;
(6.4) after traversing is finished, calculating and storing the total length of all data, putting the third four bytes of the data frame, calculating and checking all data, filling a termination code, and putting a two-dimensional array BUFFER for storing BUFFER data;
writing the data of the two-dimensional array BUFFER into the storage device, specifically:
(7.1) circularly judging the currently stored byte number LEN _ NOW by using the column of the two-dimensional array BUFFER as a variable, and when the byte number is larger than or equal to the byte number WRITE _ ONCE _ LEN which is allowed to be written ONCE by the storage device, sending the head address of the column of the two-dimensional array and the length WRITE _ ONCE _ LEN of data to be written to a data storage operation thread through a message queue;
(7.2) adding one to the number of the columns of the two-dimensional array, if the number after adding one is BUF _ NUM, the number of the rows is 0, copying unsent data in the previous column with the length of LEN _ NOW-WRITE _ ONCE _ LEN to the forefront of the memory in the column through the memory, and moving the pointer to the position needing to WRITE data.
CN202110678641.2A 2021-06-18 2021-06-18 Data record storage method and system with expandability Active CN113609124B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110678641.2A CN113609124B (en) 2021-06-18 2021-06-18 Data record storage method and system with expandability

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110678641.2A CN113609124B (en) 2021-06-18 2021-06-18 Data record storage method and system with expandability

Publications (2)

Publication Number Publication Date
CN113609124A true CN113609124A (en) 2021-11-05
CN113609124B CN113609124B (en) 2024-03-26

Family

ID=78336587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110678641.2A Active CN113609124B (en) 2021-06-18 2021-06-18 Data record storage method and system with expandability

Country Status (1)

Country Link
CN (1) CN113609124B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002088924A1 (en) * 2001-04-30 2002-11-07 The Commonwealth Of Australia Data view of a modelling system
CN101395602A (en) * 2005-12-29 2009-03-25 亚马逊科技公司 Method and apparatus for a distributed file storage and indexing service
CA2668306A1 (en) * 2009-06-08 2010-12-08 Stephen R. Germann Method and system for applying metadata to data sets of file objects
CN101976472A (en) * 2010-11-22 2011-02-16 奇瑞汽车股份有限公司 Vehicle-mounted data recorder
CN102771089A (en) * 2009-12-23 2012-11-07 思杰系统有限公司 Systems and methods for mixed mode handling of IPv6 and IPv4 traffic by a virtual server
CN103034499A (en) * 2012-12-13 2013-04-10 中国航空无线电电子研究所 General data format conversion method and system for network data transmission of airborne equipment
CN103229165A (en) * 2010-08-12 2013-07-31 安全第一公司 Systems and methods for secure remote storage
CN103403707A (en) * 2010-12-28 2013-11-20 思杰系统有限公司 Systems and methods for database proxy request switching
CN106209382A (en) * 2010-09-20 2016-12-07 安全第公司 The system and method shared for secure data
CN110764935A (en) * 2019-10-28 2020-02-07 天津津航计算技术研究所 Method for efficiently transferring messages among tasks based on real-time operating system
CN111506581A (en) * 2020-06-17 2020-08-07 北京北龙超级云计算有限责任公司 Data aggregation method and server

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002088924A1 (en) * 2001-04-30 2002-11-07 The Commonwealth Of Australia Data view of a modelling system
CN101395602A (en) * 2005-12-29 2009-03-25 亚马逊科技公司 Method and apparatus for a distributed file storage and indexing service
CA2668306A1 (en) * 2009-06-08 2010-12-08 Stephen R. Germann Method and system for applying metadata to data sets of file objects
CN102771089A (en) * 2009-12-23 2012-11-07 思杰系统有限公司 Systems and methods for mixed mode handling of IPv6 and IPv4 traffic by a virtual server
CN103229165A (en) * 2010-08-12 2013-07-31 安全第一公司 Systems and methods for secure remote storage
CN106209382A (en) * 2010-09-20 2016-12-07 安全第公司 The system and method shared for secure data
CN101976472A (en) * 2010-11-22 2011-02-16 奇瑞汽车股份有限公司 Vehicle-mounted data recorder
CN103403707A (en) * 2010-12-28 2013-11-20 思杰系统有限公司 Systems and methods for database proxy request switching
CN103034499A (en) * 2012-12-13 2013-04-10 中国航空无线电电子研究所 General data format conversion method and system for network data transmission of airborne equipment
CN110764935A (en) * 2019-10-28 2020-02-07 天津津航计算技术研究所 Method for efficiently transferring messages among tasks based on real-time operating system
CN111506581A (en) * 2020-06-17 2020-08-07 北京北龙超级云计算有限责任公司 Data aggregation method and server

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
MEHNUMA TABASSUM OMAR等: "a scalable array storage for efficient maintenance of future data", THE JOURNAL OF SUPERCOMPUTING, pages 6540 - 6565 *
李大鹏等: "云边协同的调控云数据质量优化", 电力系统及其自动化学报, vol. 34, no. 3, pages 11 - 19 *
王江涛;赖文豫;孟小峰;: "闪存数据库:现状、技术与展望", 计算机学报, vol. 36, no. 08, pages 1549 - 1567 *
马文龙;朱妤晴;蒋德钧;熊劲;张立新;孟潇;包云岗;: "Key-Value型NoSQL本地存储系统研究", 计算机学报, vol. 41, no. 08, pages 1722 - 1751 *

Also Published As

Publication number Publication date
CN113609124B (en) 2024-03-26

Similar Documents

Publication Publication Date Title
CN102508784B (en) Data storage method of flash memory card in video monitoring equipment, and system thereof
CN105988718B (en) Non-volatile memory device and control method performed by controller
US10540250B2 (en) Reducing storage requirements for storing memory addresses and values
US8554987B2 (en) Nonvolatile memory system for improving stream data writing
CN102770841A (en) Method and apparatus for generating minimum boot image
CN107391544B (en) Processing method, device and equipment of column type storage data and computer storage medium
CN104714957B (en) A kind of variation and device of table structure
CN106104515A (en) Utilize File system design and the fault recovery method of nonvolatile memory
CN103838780A (en) Data recovery method of database and relevant device
CN112631957A (en) Data acquisition method and device, electronic equipment and storage medium
CN103544076A (en) Data backup method and device
CN102141955B (en) Linux-based kernel log system and realization method thereof
CN104951482B (en) A kind of method and device of the image file of operation Sparse formats
CN114741449A (en) Object storage method and device based on distributed database
CN114138200A (en) Pre-writing log method and system based on rocksDB
CN100492323C (en) Method and apparatus for protecting caching content and caching controller thereof
CN113609124A (en) Data record storage method and system with expandability
CN101937719B (en) Method and apparatus for dealing with write errors when writing information data into flash memory devices
CN105095352B (en) Data processing method and device applied to distributed system
CN108132871B (en) Airborne computer interface fault recording method
CN116561091A (en) Log storage method, device, equipment and readable storage medium
CN115857811A (en) Data processing method and device, solid state disk and readable storage medium
CN114328018A (en) Snapshot creating method, computing device and storage medium
CN103294606A (en) Methods and devices for allocating memories and detecting overflow thereof
DE102021126634A1 (en) Storage device, storage system and method of operation

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
GR01 Patent grant
GR01 Patent grant