Triggered Storage Method for Power Dynamometer Test Data Based on C#

The trigger storage method of power dynamometer test data is realized through C# language, which solves the problems of fixed data storage frequency and difficult data abnormal positioning in the prior art, and realizes the ability to efficient data storage and fast position abnormal moments.

CN114936182BActive Publication Date: 2025-06-24TIANJIN RES INST OF ELECTRIC SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210555582.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2025-06-24
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

The data storage method in the prior art during the power dynamometer test is cycled, resulting in the increase in the number of data when the storage frequency is fixed, and the requirement for storage space is multiplied. The abnormal positioning of later data can only be retrieved through time, making it difficult to quickly locate abnormal moments and obtain high-frequency data.

Method used

The trigger storage method of power dynamometer test data is realized through C# language, setting trigger points and thresholds, receiving and storing data in real time, and using a multi-threading mechanism to monitor the trigger signal and store data in a specified directory.

Benefits of technology

During the power dynamometer test, it realizes high-frequency data storage before triggering the trigger point, and can quickly locate the abnormal moment and store the high-frequency data before abnormal data, improving the efficiency and reliability of data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114936182B_ABST
    Figure CN114936182B_ABST
Patent Text Reader

Abstract

The present invention relates to a trigger-based storage method for test data of an electric dynamometer based on C#, and the specific steps are as follows: Step 1, create a constructor through C#; Step 2, start the program, create a data receiving thread, and passively receive the test data from the electric dynamometer in real time; Step 3, create a data group thread to ensure that the data in the data storage group before triggering always maintains the latest state before triggering; Step 4, create a trigger point monitoring thread; Step 5, create a data storage thread, and monitor in real time whether the trigger signal is true. If it is true, store the data in the data storage group into a file in the specified trigger data storage directory; Step 6, view the data storage directory. The present invention realizes the separate storage of data at different trigger moments during the test process of the electric dynamometer through the C# language, and can quickly view the test data before each trigger threshold during the test process of the electric dynamometer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data storage, and specifically relates to a trigger-based storage method for power dynamometer test data based on C#. Background Art

[0002] At present, the data storage in the power dynamometer test process is carried out by the integrated control software in a periodic cycle manner. For this kind of storage method, when the storage frequency is fixed, the more data is stored, the more the storage space requirement increases in multiples of the frequency. At the same time, the later data anomaly positioning can only be retrieved through time. Therefore, it is very important to be able to quickly locate the data at the abnormal moment and obtain higher sampling frequency data.

[0003] Currently, the storage frequencies are relatively low, generally at 10HZ and 1HZ, and it often causes data omission in capturing sudden abnormal data. Moreover, the data analysis of sudden anomalies requires at least 100HZ data storage to analyze the data anomalies. How to capture abnormal data and store the high-frequency data before the abnormal data requires storing the data in a triggered manner. C# is an object-oriented programming language launched by Microsoft. It is developed based on the C language and the Microsfot.NET platform. While inheriting the powerful functions of C and C++, it removes some of their complex features, enabling programmers to quickly write various application programs based on the Microsoft.NET platform. Therefore, it can make the most of the existing components of the computer and the components in the communication field.

[0004] Therefore, it is the most suitable programming language choice to implement the condition of taking a certain point in the power dynamometer test process as a trigger record through the c# language to store the data record before the event. However, there is no clear method on how to store the data in the power dynamometer test process in a triggered manner based on the c# language, which is also the core content of the present invention. Summary of the Invention

[0005] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a trigger-based storage method for power dynamometer test data based on C# with improved quality, improved efficiency, high reliability, and labor saving.

[0006] The present invention solves its technical problems by adopting the following technical solutions:

[0007] A trigger-based storage method for power dynamometer test data based on C# is characterized in that the specific steps are as follows:

[0008] Step 1, through the constructor created by C#, set the global attributes and their parameters of the trigger point, trigger point threshold setting, data storage group, data block, sampling frequency, and sampling quantity;

[0009] Step 2: Start the program, create a data receiving thread, and passively receive the test data from the dynamometer in real time through a UDP service written in the C# language.

[0010] Step 3: Create a data group thread to ensure that the data in the data storage group before triggering always maintains the latest state before triggering.

[0011] Put the current new data block into the data storage group at the set sampling frequency in real time. When the number of data storage groups is greater than the set value of the sampling quantity, the data storage group adopts the first-in, first-out mode to ensure that the number of data blocks in the data storage group always remains at Latest the number of sampling quantities.

[0012] Step 4: Create a trigger point monitoring thread to monitor whether the current trigger point exceeds the set threshold range.

[0013] Step 5: Create a data storage thread to monitor in real time whether the trigger signal is true. If it is true, store the data in the data storage group into a file in the specified trigger data storage directory.

[0014] Step 6: View the data storage directory to quickly view the time when the trigger point exceeded the trigger threshold in previous times.

[0015] Moreover, the constructor created by C# is used to On initialize the global attributes, assign initial values to the object member variables, and create a memory object in the computer system. The global attributes are defined as follows:

[0016] Attribute Name Data Type Description triggerPoint String Trigger Point Name triggerPointUp Double Trigger Point Upper Threshold triggerPointDown Double Trigger Point Lower Threshold saveList Two-dimensional Array [Double][Double] Data Storage Group data One-dimensional Array [Double] Data Block collPl 32-bit Integer (Before Trigger) Sampling Frequency collCount 32-bit Integer (Before Trigger) Sampling Quantity saveFlag Boolean Trigger Status Signal saveDir String Trigger Data Storage Directory

[0017] Moreover, the sending end of the dynamometer sends data at a frequency of 1000HZ, the server updates the memory data at 1000HZ, and the data receiving thread updates the data into the memory in real time.

[0018] Moreover, the trigger monitoring thread circularly detects whether the trigger point data triggers the threshold at a frequency of 1000HZ. When the trigger threshold is exceeded, the system updates the storage signal to true, otherwise it is false.

[0019] Moreover, the file in the trigger data storage directory is a txt file named with the time when the trigger threshold is reached.

[0020] Moreover, view the operation data of the dynamometer before this moment by double-clicking the txt file.

[0021] Moreover, the data frequency sent by the dynamometer is not less than 1000Hz.

[0022] Moreover, the trigger point monitoring thread, data group thread, data receiving thread, and data storage thread are all created through the Thread thread method in C#.

[0023] The advantages and positive effects of the present invention are as follows:

[0024] 1. The present invention uses the C# language to take a certain point in the test process of the electric dynamometer as the condition for trigger recording, and stores the test data before the trigger into a file in a fixed quantity and sampling interval. This method is applicable to the acquisition and storage of the data before the trigger point in the test process of the electric dynamometer, and realizes the storage of high-frequency data before the trigger point in the test process of the electric dynamometer through the C# language.

[0025] 2. The present invention realizes the separate storage of data at different trigger times in the test process of the electric dynamometer through the C# language, and can quickly view the test data before each trigger threshold in the test process of the electric dynamometer. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a flowchart of the steps of this method. DETAILED DESCRIPTION OF THE INVENTION

[0027] The present invention will be further described in detail below with reference to the drawings and through specific embodiments. The following embodiments are only descriptive and not restrictive, and the protection scope of the present invention cannot be limited thereby.

[0028] A trigger-based storage method for electric dynamometer test data based on C#, which realizes the threshold monitoring of the trigger point and the storage of the data block before the trigger for the test data of the electric dynamometer test process through the C# language. The specific steps are as follows:

[0029] Step 1, through the constructor created in C#, set the global attributes and their parameters of the trigger point, trigger point threshold setting, data storage group, data block, sampling frequency, and sampling quantity;

[0030] The C# constructor is mainly used to initialize the global attributes, that is, to assign initial values to the object member variables and create memory objects in the computer system.

[0031] Definition and description of global attributes:

[0032] Attribute Name Data Type Description triggerPoint String Trigger Point Name triggerPointUp Double Trigger Point Upper Threshold triggerPointDown Double Trigger Point Lower Threshold saveList Two-dimensional Array [Double][Double] Data Storage Group data One-dimensional Array [Double] Data Block collPl 32-bit Integer (Before Trigger) Sampling Frequency collCount 32-bit Integer (Before Trigger) Sampling Quantity saveFlag Boolean Trigger Status Signal saveDir String Trigger Data Storage Directory

[0033] Step 2, start the program and create a "data receiving thread". The "data receiving thread" is a UDP service written based on the C# language, which passively receives the test data from the electric dynamometer in real time;

[0034] Update the data to the memory (resiveDate) in real time. Since the server is a passive receiver, it is required that the sender send at a frequency of 1000HZ, and the server will update the memory data at 1000HZ;

[0035] Step 3, create a "data group thread" to ensure that the data in the data storage group before triggering always maintains the latest state before triggering;

[0036] Put the current new data block into the data storage group in real time at the set "sampling frequency". When the number of data storage groups is greater than the set value of "sampling quantity", the data storage group adopts a first-in-first-out mode to ensure that the number of data blocks in the data storage group always remains at Latest the number of "sampling quantity";

[0037] Step 4, create a "trigger point monitoring thread" to monitor whether the current trigger point exceeds the set threshold range;

[0038] The "trigger monitoring thread" runs at a frequency of 1000HZ , to cyclically detect whether the trigger point data triggers the threshold. When the trigger threshold is exceeded, the system updates the storage signal to true, otherwise it is false;

[0039] Step 5, create a "data storage thread" to monitor in real time whether the trigger signal (saveFlag) is true. If it is true, the data storage group In will store the data into a file under the specified trigger data storage directory (the file is named with the time at the trigger threshold);

[0040] Step 6, view the "data storage directory" to quickly view the time when the trigger point exceeded the trigger threshold in previous times, and view the operation data of the dynamometer before that moment by double-clicking the txt file.

[0041] To ensure the trigger and storage accuracy, the data transmission frequency of the dynamometer should be at least 1000HZ.

[0042] The "trigger point monitoring thread", "data group thread", "data receiving thread" and "data storage thread" are all created through the Thread thread method of C#.

[0043] Although the embodiments and drawings of the present invention are disclosed for illustrative purposes, those skilled in the art can understand that: various substitutions, changes and modifications are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, the scope of the present invention is not limited to the content disclosed in the embodiments and drawings.

Claims

1. A trigger-based storage method for power dynamometer test data based on C#, characterized in that: The specific steps are as follows: Step 1: Through the constructor created by C#, set the global attributes and their parameters of the trigger point, trigger point threshold setting, data storage group, data block, sampling frequency, and sampling quantity; Step 2: Start the program, create a data receiving thread, and passively receive the test data from the dynamometer in real time through the UDP service written in the C# language; The sending end of the dynamometer sends data at a frequency of 1000HZ, the server updates the memory data at 1000HZ, and the data receiving thread updates the data to the memory in real time; Step 3: Create a data group thread to ensure that the data in the data storage group before triggering always maintains the latest state before triggering; Put the current new data block into the data storage group at the set sampling frequency in real time. When the number of the data storage group is greater than the set value of the sampling quantity, the data storage group adopts the first-in-first-out mode to ensure that the number of data blocks in the data storage group always remains the same as the latest sampling quantity; Step 4: Create a trigger point monitoring thread to monitor whether the current trigger point exceeds the set threshold range; the trigger monitoring thread cyclically detects whether the trigger point data triggers the threshold at a frequency of 1000HZ. When the trigger threshold is exceeded, the system updates the storage signal to true, otherwise it is false; Step 5: Create a data storage thread to monitor in real time whether the trigger signal is true. If it is true, store the data in the data storage group into the file under the specified trigger data storage directory; Step 6: View the data storage directory to quickly view the time when the trigger point exceeded the trigger threshold each time.

2. The trigger storage method for power dynamometer test data based on C# according to claim 1, characterized in that: The constructor created by C# is used to initialize the global attributes, assign initial values to the object member variables, and create memory objects in the computer system. The global attributes are defined as follows: 。 3. The trigger storage method for power dynamometer test data based on C# according to claim 1, characterized in that: The file under the trigger data storage directory is a txt file named with the time when the trigger threshold is reached.

4. The trigger storage method for power dynamometer test data based on C# according to claim 3, characterized in that: Double-click the txt file to view the operating data of the dynamometer before the time when the trigger threshold is reached.

5. The trigger storage method for power dynamometer test data based on C# according to claim 1, characterized in that: The data frequency sent by the dynamometer is not less than 1000Hz.

6. The trigger storage method for power dynamometer test data based on C# according to claim 1, characterized in that: The trigger point monitoring thread, data group thread, data receiving thread, and data storage thread are all created through the Thread thread method of C#.

Citation Information

Patent Citations

  • Thread synchronization method and system and medium

    CN112667374A

  • Rule execution verification method and device, electronic equipment and storage medium

    CN112671787A