A modular fault recording data processing method

By using a modular data processing method, the data type and conversion operation of the fault recorder are separated into independent functions. Data information is stored using a structure array, and the conversion function is called through function pointers or global variable flags. This solves the problems of high code duplication rate and strong program coupling in the existing technology and improves execution efficiency.

CN116166730BActive Publication Date: 2026-04-14SHANGHAI CHINT POWER SYST CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-14
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

The existing fault recorder's data management software uses branching statements to continuously determine data types, resulting in high code duplication rate, excessive program coupling, and low execution efficiency.

Method used

A modular fault recording data processing method is adopted. Through data structure optimization, data types and conversion operations are separated into independent functions. Data information is stored using structure arrays or two-dimensional arrays, and the corresponding data conversion functions are called through function pointers or global variable flags.

Benefits of technology

It achieves high cohesion and low coupling, significantly reduces the amount of code, and improves running speed and execution efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116166730B_ABST
    Figure CN116166730B_ABST
Patent Text Reader

Abstract

The technical scheme of the present application provides a modular fault recording data processing method, characterized in that the method comprises the following steps: obtaining fault recording data through a data acquisition module, obtaining and storing the storage address, scaling coefficient and data type of each fault recording data; placing the specific conversion operation process of the fault recording data of different data types into an independent function, establishing different data conversion functions for different data types; obtaining the data type corresponding to the current fault recording data, and calling the corresponding data conversion function based on the data type. The method disclosed in the present application separates the codes of specific operation and selection operation by using a transfer table, optimizes the data structure, integrates the related information of different data based on the structure array, realizes high cohesion and low coupling, significantly reduces the code amount, speeds up the operation, and optimizes the overall code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a software method and system for the data management section of a fault recorder, belonging to the field of power electronics. Background Technology

[0002] When serious faults such as short circuits, overcurrents, and overvoltages occur in equipment such as photovoltaic inverters, energy storage converters, and wind power converters, fault recorders are typically used to record relevant electrical quantities before and after the fault. By analyzing these records, it is determined whether the system has taken the correct protective actions, thereby improving the safety level of the power system.

[0003] Existing fault recorder designs often employ a distributed architecture and multi-CPU parallel operation. The existing fault recorder software design is mainly divided into three parts: data acquisition, data management, and remote data analysis. This invention primarily optimizes the modular design method of the data management section. The main functions of the data management software include data transmission with the data acquisition system, simple processing and analysis of the recorded data, and real-time display and printing functions. Figure 1 As shown, the defects and shortcomings of existing data management software lie in the fact that it uses branch structure statements to continuously judge the data types of different collected data during fault recording, without using aggregate data types to divide the data structure. This leads to the program code constantly judging and repeatedly executing the reading and analysis of related electrical quantities, resulting in excessive code duplication rate, excessive program coupling, and low execution efficiency. Summary of the Invention

[0004] The technical problem to be solved by this invention is that the data management software of existing fault recorders mostly uses branch structure statements to continuously determine the data type of different acquired data.

[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is to provide a modular fault recording data processing method, characterized by comprising the following steps:

[0006] Step 1: After obtaining fault waveform data through the data acquisition module, acquire and store the storage address, scaling factor, and data type of each fault waveform data.

[0007] Step 2: Put the specific conversion process of fault recording data of different data types into independent functions, and establish different data conversion functions for different data types;

[0008] Step 3: Obtain the data type corresponding to the current fault waveform data. Based on the data type, call the corresponding data conversion function. The conversion function reads the fault waveform data to be processed from the corresponding storage address through the storage address corresponding to the current data type. Then, it performs relevant data type conversion on the read fault waveform data and performs corresponding scaling processing based on the corresponding scaling factor. Finally, it returns the complete converted and scaled data.

[0009] Preferably, the storage address, scaling factor, and data type corresponding to each fault recording data are stored as a structure, and all structures are stored in a structure array.

[0010] Preferably, the storage address, scaling factor, and data type corresponding to all fault waveform data are stored in a two-dimensional array. Each row of the two-dimensional array corresponds to the same fault waveform data, and the three columns of data in the same row are the storage address, scaling factor, and data type corresponding to the current fault waveform data, respectively.

[0011] Preferably, the storage address, scaling factor, and data type corresponding to all fault waveform data are stored in a structure. This structure contains a data type array, a storage address array, and a scaling factor array, which are used to store the storage address, scaling factor, and data type, respectively. The storage address, scaling factor, and data type corresponding to the same index in the data type array, storage address array, and scaling factor array belong to the same fault waveform data.

[0012] Preferably, in step 2, a function pointer array is created, and function pointers pointing to different data conversion functions are stored in the function pointer array. The storage location of different function pointers in the function pointer array is related to the corresponding data type.

[0013] Preferably, the different function pointers are stored sequentially in the function pointer array according to the labels corresponding to their respective data types.

[0014] Preferably, in step 3, when calling the corresponding data conversion function based on the data type, the function pointer at the corresponding storage location is obtained from the function pointer array according to the current data type, and the data conversion function is called through the function pointer.

[0015] Preferably, in step 2, different global variable flags are set for different data conversion functions.

[0016] Preferably, in step 3, when calling the corresponding data conversion function based on the data type, a corresponding global variable flag is set for the global variable according to the current data type, and then the call to the corresponding data conversion function is realized based on the global variable flag.

[0017] Preferably, in step 1, the data type is stored in the form of a label.

[0018] The method disclosed in this invention uses a transfer table to separate the code for specific operations and selection operations. Through data structure optimization, it integrates relevant information of different data based on a structure array, achieving high cohesion and low coupling, significantly reducing the amount of code, speeding up the running speed, and optimizing the overall code. Attached Figure Description

[0019] Figure 1 Flowchart for determining existing technology data types;

[0020] Figure 2 This is a flowchart illustrating the data type determination process of this invention.

[0021] Figure 3 This illustration shows one implementation process of the method provided by the present invention;

[0022] Figure 4 An example of a structure in which the present invention is applied is illustrated. Detailed Implementation

[0023] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.

[0024] Combination Figure 2 The modular fault recording data processing method disclosed in this embodiment specifically includes the following steps:

[0025] Step 1: Store each piece of data obtained by the data acquisition module as a structure. Each structure includes the storage address of the current data, the scaling factor, and the data type. The data type of the current data is recorded in the structure as a label, for example, int16 is 0, uint16 is 1, and int8 is 2. All structures are stored sequentially in a structure array.

[0026] The structure array in the above steps can also be replaced by a two-dimensional array. Each row of the two-dimensional array represents a piece of data. The two-dimensional array has three columns. The three columns in the same row represent the three parameters in the current row of data, namely the data type, storage address, and scaling factor. The data type can also be recorded in the two-dimensional array in the form of a label.

[0027] Besides placing structures inside arrays, you can also place arrays inside structures. That is, the structure array mentioned in the above steps can also be replaced by a structure. Within the structure, you can store data type arrays, memory address arrays, and scaling factor arrays respectively. Parameters with the same index in the data type array, memory address array, and scaling factor array represent three parameters of the same data. The data type can also be recorded in the structure in the form of a label.

[0028] Step 2: Put the specific conversion process of data of different data types into independent functions, create different data conversion functions for different data types, initialize the function pointer array based on the function pointers pointing to different data conversion functions, and store the different function pointers in the function pointer array in order according to the labels corresponding to the relevant data types.

[0029] In this step, setting flags using global variables can also be used instead of function pointer arrays. However, the specific data conversion operations for different data types still need to be placed in separate functions, creating different data conversion functions for different data types. Then, by setting different flags for global variables, the corresponding data conversion functions can be called; different flags correspond to different data types.

[0030] Step 3: If a structure array was used in Step 1, then obtain the current structure from the structure array, and then obtain the label recorded in the structure.

[0031] If a two-dimensional array is used in step 1, then the current row of data is obtained from the two-dimensional array, and then the label recorded in the current row of data is obtained.

[0032] If step 1 involves storing data type arrays, storage address arrays, and scaling factor arrays within the structure, then the three parameters corresponding to the same index are obtained, and subsequently the label corresponding to the current index is obtained.

[0033] Step 4: If a function pointer array was used in Step 2, then obtain the corresponding function pointer in the function pointer array based on the label obtained in the previous step, and call the relevant conversion function through the function pointer.

[0034] If a global variable is used in step 2, then the flag of the global variable is set based on the label obtained in the previous step, and the jump to the corresponding conversion function is performed by setting the flag.

[0035] Step 5: The conversion function reads the data to be processed from the corresponding storage address, performs relevant data type conversions on the read data, and performs corresponding scaling processing based on the scaling factor recorded in the structure. Finally, it returns the complete conversion and scaled data.

[0036] like Figure 4 As shown, in one application scenario, the fault recorder acquires data via a DSP and performs data analysis. The data is then transmitted to an MCU for processing and saved to flash memory. The MCU can manage the data acquired by the DSP using the methods described above.

Claims

1. A modular fault recording data processing method, characterized in that, Includes the following steps: Step 1: After obtaining fault waveform data through the data acquisition module, acquire and store the storage address, scaling factor, and data type of each fault waveform data. Step 2: Place the specific conversion process for fault waveform data of different data types into independent functions, establishing different data conversion functions for different data types. Step 3: Obtain the data type corresponding to the current fault waveform data, call the corresponding data conversion function based on the data type. The conversion function reads the fault waveform data to be processed from the corresponding storage address using the storage address corresponding to the current data type, performs relevant data type conversion on the read fault waveform data, and performs corresponding scaling processing based on the corresponding scaling factor before returning the complete converted and scaled data.

2. The modular fault recording data processing method as described in claim 1, characterized in that, The storage address, scaling factor, and data type corresponding to each fault recording data are stored as a structure, and all structures are stored in a structure array.

3. The modular fault recording data processing method as described in claim 1, characterized in that, All fault waveform data are stored in a two-dimensional array, with each row of the array corresponding to the same fault waveform data. The three columns in the same row are the storage address, scaling factor, and data type of the current fault waveform data.

4. The modular fault recording data processing method as described in claim 1, characterized in that, All fault waveform data are stored in a structure containing a data type array, a storage address array, and a scaling factor array. The storage address, scaling factor, and data type corresponding to the same index in the data type array, storage address array, and scaling factor array belong to the same fault waveform data.

5. The modular fault recording data processing method as described in claim 1, characterized in that, In step 2, a function pointer array will be created, which will store function pointers that point to different data conversion functions. The storage location of different function pointers in the function pointer array is related to their corresponding data types.

6. The modular fault recording data processing method as described in claim 5, characterized in that, The different function pointers are stored in the function pointer array in sequence according to the labels corresponding to their respective data types.

7. The modular fault recording data processing method as described in claim 5, characterized in that, In step 3, when calling the corresponding data conversion function based on the data type, the function pointer at the corresponding storage location is obtained from the function pointer array according to the current data type, and the data conversion function is called through the function pointer.

8. The modular fault recording data processing method as described in claim 1, characterized in that, In step 2, different global variable flags are set for different data transformation functions.

9. The modular fault recording data processing method as described in claim 7, characterized in that, In step 3, when calling the corresponding data conversion function based on the data type, the corresponding global variable flag is set for the global variable according to the current data type, and then the call to the corresponding data conversion function is realized based on the global variable flag.

10. The modular fault recording data processing method as described in claim 1, characterized in that, In step 1, the data type is stored in the form of a label.

Citation Information

Patent Citations

  • Fault recording file generation method and device based on simulation software

    CN113609671A

  • Transient homologous comparison function test method for intelligent oscillograph

    CN113866697A