Double-period data embedded recording method and system before and after fan master control system failure

CN121785961BActive Publication Date: 2026-06-26FUSHI NEW ENERGY TECH (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUSHI NEW ENERGY TECH (SHANGHAI) CO LTD
Filing Date
2025-12-29
Publication Date
2026-06-26

Smart Images

  • Figure CN121785961B_ABST
    Figure CN121785961B_ABST
Patent Text Reader

Abstract

The application provides a fan master control system fault before and after double period data embedded recording method and system, belongs to the technical field of fault processing, through allocating first memory buffer in memory and dividing it into two front buffer. The first front buffer stores data in a ring rolling coverage mode, and the second front buffer synchronously stores data as its mirror backup. Collect running data and synchronously write into two front buffers. When receiving a fault trigger signal, according to the writing pointer position of the first front buffer, extract a specified number of data from the first memory buffer as the fault before data set while allocating the second memory buffer. The running data after the fault trigger is written into the second memory buffer to form the fault after data set. The fault before and fault after data sets are combined into the target fault data set, and stored in the file system according to the preset naming rule. The problem that the complete high-frequency data capture capability is insufficient before and after the fault, and the storage resources and data integrity are difficult to consider is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of fault handling technology, and in particular relates to a method and system for embedded recording of data in two time periods before and after a fault in a wind turbine main control system. Background Technology

[0002] Fault data recording methods for wind turbine main control systems are of great significance for fault diagnosis, performance optimization, and reliability improvement of wind turbine units. By capturing changes in key system parameters, they provide data support for analyzing the root causes of faults. Accurate data recording helps maintenance personnel quickly locate fault points, effectively shorten downtime, and ensure the economy and safety of wind power generation. Therefore, developing an efficient and reliable fault data recording method has broad application prospects.

[0003] Currently, common methods for recording fault data in wind turbine main control systems include triggered recording and continuous database storage. Triggered recording typically initiates data recording after a fault is detected, saving status information after the fault occurs. Continuous database storage, on the other hand, uses a SCADA system to continuously collect and save operational data to a historical database at a fixed, low sampling frequency. Additionally, methods for continuously storing high-frequency, full-data-volume data in a PLC are also available.

[0004] However, these existing methods all have significant drawbacks. Triggered recording schemes completely lose critical data prior to the fault, making it impossible to trace the cause and initial symptoms of the fault. Continuous database storage schemes are limited by second-level sampling frequencies, making it difficult to capture millisecond-level transient fault characteristics, such as rapid speed fluctuations or voltage drops. PLC full-data storage quickly exhausts storage resources and competes for CPU resources; if a rolling over mechanism is used, critical data may be overwritten before the fault occurs. These drawbacks collectively result in the lack of a complete data chain before and after the fault, severely restricting accurate root cause analysis. Therefore, existing methods for recording fault data in wind turbine main control systems suffer from insufficient ability to capture complete high-frequency data before and after the fault, and a difficulty in balancing storage resources and data integrity. Summary of the Invention

[0005] The purpose of this application is to provide a method, system, electronic device and storage medium for embedded recording of data in two time periods before and after a fault in a wind turbine main control system, so as to solve the problems of insufficient ability to capture complete high-frequency data before and after a fault and difficulty in balancing storage resources and data integrity in the prior art.

[0006] To address the aforementioned technical problems, in a first aspect, this application provides a method for embedded data recording in two time periods before and after a fault in a wind turbine main control system, comprising:

[0007] A first memory buffer is allocated in the memory of the wind turbine main control system. The first memory buffer is divided into a first front buffer and a second front buffer. The first front buffer stores data in a circular rolling over manner, and the second front buffer serves as a mirror backup of the first front buffer to synchronously store the stored data of the first front buffer.

[0008] The operating data of the wind turbine main control system is collected according to the preset sampling period, and the operating data is synchronously written into the first front buffer and the second front buffer in chronological order.

[0009] Upon receiving a fault trigger signal, the system extracts the first target number of data records from the first memory buffer based on the write pointer position of the first front buffer to obtain the pre-fault dataset, and allocates a second memory buffer in the memory of the wind turbine main control system.

[0010] After receiving the fault trigger signal, the collected running data is written into the second memory buffer until the second target number of data records are recorded, thus obtaining the post-fault dataset;

[0011] The dataset before and after the failure is merged to generate the target failure dataset, which is then stored in the file system according to the preset naming rules.

[0012] In one feasible implementation, the first memory buffer comprises 2N consecutive space indices, where N is a positive integer;

[0013] The spatial index range of the first front buffer is 0 to N-1, and the spatial index range of the second front buffer is N to 2N-1.

[0014] In one feasible implementation, the number of first target items is N;

[0015] Based on the write pointer position of the first front buffer, the first target number of data records are extracted from the first memory buffer to obtain the pre-fault dataset, including:

[0016] Determine the target space index corresponding to the write pointer position in the first front buffer;

[0017] Extract the data records from the target spatial index to the spatial index N-1 in the first front buffer as the first pre-fault dataset;

[0018] Extract the data records from spatial index N to spatial index N+K-1 in the second front buffer as the second pre-failure dataset, where K is the difference between N and the total number of data records in the first and second pre-failure datasets;

[0019] Based on the first and second pre-fault datasets, a pre-fault dataset is constructed in spatial index order.

[0020] In one feasible implementation, the second memory buffer includes M consecutive space indices, where M is a positive integer, and the number of second target records is M.

[0021] The operational data collected after receiving the fault trigger signal is written to the second memory buffer until the second target number of data records are filled, resulting in the post-fault dataset, which includes:

[0022] The running data is written sequentially to space indices 0 to M-1 in the second memory buffer until all M space indices have corresponding data records.

[0023] Extract all data records from the second memory buffer as the post-fault dataset.

[0024] In one feasible implementation, the number of first target items is equal to the number of second target items.

[0025] In one feasible implementation, each piece of data in the runtime data includes a millisecond-level timestamp at the time of data acquisition;

[0026] The pre-fault dataset and the post-fault dataset are merged to generate the target fault dataset, which includes:

[0027] The datasets before and after the failure are sorted and merged according to the millisecond-level timestamps of the data records in the datasets before and after the failure to generate the target failure dataset.

[0028] In one feasible implementation, the method is implemented in an embedded system, storing the named target fault dataset into the file system according to a preset naming rule, and executing a separate low-priority task to store the dataset into the file system.

[0029] Secondly, this application provides an embedded data recording system for two time periods before and after a fault in the main control system of a wind turbine, comprising:

[0030] The allocation module is used to allocate a first memory buffer in the memory of the wind turbine main control system, divide the first memory buffer into a first front buffer and a second front buffer, store data in a circular rolling over manner, and store the stored data of the first front buffer synchronously as a mirror backup of the first front buffer.

[0031] The storage module is used to collect the operating data of the wind turbine main control system at a preset sampling period and synchronously write the operating data into the first front buffer and the second front buffer in chronological order.

[0032] Upon receiving a fault trigger signal, the extraction module extracts the first target number of data records from the first memory buffer according to the write pointer position of the first front buffer to obtain the pre-fault dataset, and allocates a second memory buffer in the memory of the wind turbine main control system.

[0033] The storage module is also used to write the running data collected after receiving the fault trigger signal into the second memory buffer until the second target number of data records are filled to obtain the post-fault dataset.

[0034] The merging module is used to merge the pre-fault dataset and the post-fault dataset to generate the target fault dataset, and store it in the file system according to the preset naming rules.

[0035] Thirdly, this application provides an electronic device, comprising:

[0036] Memory, used to store computer programs;

[0037] The processor is used to execute computer programs to implement the steps of the embedded data recording method for two time periods before and after a fault in the wind turbine main control system as described in the first aspect above.

[0038] Fourthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps of the embedded data recording method for the wind turbine main control system before and after a fault as described in the first aspect.

[0039] The embedded data recording method for wind turbine main control system before and after a fault, provided in this application, employs an architecture combining dual front buffers and an independent back buffer. This method first ensures that a continuous and complete segment of high-frequency operating data prior to the fault can be locked and extracted from memory at the moment the fault is triggered, effectively solving the problem of data loss or breakage before the fault in traditional solutions. Subsequently, the system continues to record data after the fault into an independent buffer, and finally merges the data before and after the fault, thus fully covering the critical period of the fault occurrence and capturing transient fault characteristics. The entire process only performs one file storage operation after the fault, greatly reducing the continuous occupation of embedded system storage space and CPU resource contention. It successfully achieves efficient capture of the complete data chain before and after the fault under limited hardware resources, fundamentally solving the technical contradiction between balancing storage resources and data integrity, and significantly improving the accuracy and efficiency of wind turbine fault diagnosis. Attached Figure Description

[0040] To more clearly illustrate the technical solutions of the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 A flowchart illustrating a method for embedded data recording in two time periods before and after a fault in a wind turbine main control system, provided in an embodiment of this application;

[0042] Figure 2 This application provides a schematic diagram of the structural layout of a dual-zone ring cache.

[0043] Figure 3 A schematic diagram of an embedded data recording system for two time periods before and after a fault in a wind turbine main control system, provided in an embodiment of this application;

[0044] Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0045] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] Figure 1 The illustration shows a flowchart of a method for embedded recording of data in two time periods before and after a fault in a wind turbine main control system according to an embodiment of this application.

[0047] The core of this application is to provide a method for embedded recording of data in two time periods before and after a fault in the main control system of a wind turbine. A flowchart of one specific implementation is shown below. Figure 1 As shown, the method includes:

[0048] S110: Allocate a first memory buffer in the memory of the wind turbine main control system, divide the first memory buffer into a first front buffer and a second front buffer, store data in a circular rolling over manner, and store the stored data of the first front buffer synchronously as a mirror backup of the first front buffer.

[0049] The wind turbine main control system is the core unit for real-time monitoring and operation control of wind turbine generator sets, and its operation relies on built-in storage devices. The first memory buffer is a large-capacity contiguous storage area pre-allocated in memory, specifically used to store operational data records prior to a fault. Logically, this buffer is divided into a first front buffer and a second front buffer. The first front buffer uses a circular rolling over mechanism for data management; when the data is full, new data automatically overwrites the oldest historical data, and continuous updates are achieved through a cyclically moving write pointer. The second front buffer serves as a synchronous backup area for the first front buffer; all data written to the first front buffer is immediately copied here. The core value of this dual-zone structure is that it ensures that at any given time, a complete and continuous sequence of data prior to the fault can be retrieved from the contiguous address space of memory.

[0050] In one feasible implementation, the first memory buffer comprises 2N consecutive space indices, where N is a positive integer.

[0051] The spatial index range of the first front buffer is 0 to N-1, and the spatial index range of the second front buffer is N to 2N-1.

[0052] First, a contiguous storage area needs to be allocated in the main control system memory as the first memory buffer. The total capacity of this buffer is designed to be 2N data record units, where N represents a preset positive integer value. For example, in practical applications, N=15000, that is, the total buffer capacity is 30000 records.

[0053] The storage space of the buffer is divided into two logical regions: the first front buffer occupies the continuous space from index 0 to N-1, and the second front buffer occupies the continuous space from index N to 2N-1.

[0054] Figure 2 A schematic diagram of the dual-zone ring buffer structure provided in one embodiment of this application is shown. As shown, newly acquired data is written to both buffers simultaneously. Data is written in real time to the 0-14999 index area of ​​the first buffer 1, and simultaneously to the 15000-29999 index area of ​​the second buffer 2 through a synchronous replication mechanism.

[0055] During operation, the first front buffer employs a circular rolling over data management method. The system maintains a write pointer to indicate the current write position. When the buffer is full, new data will overwrite the old data starting from the beginning of the buffer, forming a circular write mechanism. The second front buffer exists as a real-time mirror backup of the first front buffer. Each data record written to the first front buffer is immediately copied to the corresponding mapped position in the second front buffer. This mapping relationship is achieved through index offsets; that is, the data at index i in the first front buffer has its mirror copy stored at index i+N in the second front buffer.

[0056] With this dual-zone buffer architecture, the system can ensure that N consecutive and complete historical data records can be extracted at any time within limited memory resources, providing the necessary foundation for subsequent fault data analysis.

[0057] S120: Collect the operating data of the wind turbine main control system according to the preset sampling period, and synchronously write the operating data into the first front buffer and the second front buffer in chronological order.

[0058] The preset sampling period defines the time interval for data acquisition, using a high frequency at the millisecond level, such as a fixed period of ten milliseconds. Operational data includes key state parameters of the wind turbine, such as measured values ​​of speed, power, and blade angle. Each data point is marked with time information accurate to milliseconds or microseconds upon generation, forming a complete timestamped record. The synchronous write mechanism requires each new data sample to be simultaneously stored in the corresponding storage units of two buffers; this is the core operation for maintaining dual data backup.

[0059] The process is executed cyclically at fixed time intervals. At the beginning of each cycle, the real-time operating parameters of the wind turbine are first acquired and combined into a data record containing precise timestamps. Then, a double-buffer storage operation is performed: new data is written to the current write pointer position in the first front buffer, and a complete copy of the data is stored in the second front buffer at the corresponding position calculated by adding a fixed offset to the current pointer value.

[0060] After completing a two-zone storage operation, the write pointer advances one position according to the circular buffer management rules. When the pointer reaches the end of the first front buffer, the next movement will automatically return to the beginning of the storage area, realizing the circular use of storage space.

[0061] Through this periodic acquisition and storage cycle, the two buffers always maintain completely consistent, chronologically ordered, latest running data. The entire process ensures the continuity and integrity of data records; the time series of data is maintained through strict timestamp recording, while the consistency of data in both zones is guaranteed by a synchronous write mechanism.

[0062] S130: Upon receiving a fault trigger signal, the system extracts the first target number of data records from the first memory buffer according to the write pointer position of the first front buffer to obtain the pre-fault dataset, and allocates a second memory buffer in the memory of the wind turbine main control system.

[0063] In one feasible implementation, the number of first target items is N.

[0064] In step S130, based on the write pointer position of the first front buffer, the first target number of data records are extracted from the first memory buffer to obtain the pre-fault dataset, including:

[0065] The target space index corresponding to the write pointer position is determined in the first front buffer.

[0066] Extract the data records from the target space index to the space index N-1 in the first front buffer as the first pre-fault dataset.

[0067] Extract the data records from spatial index N to spatial index N+K-1 in the second front buffer as the second pre-fault dataset, where K is the difference between N and the total number of data records in the first and second pre-fault datasets.

[0068] Based on the first and second pre-fault datasets, a pre-fault dataset is constructed in spatial index order.

[0069] The fault trigger signal is an instruction signal that indicates an abnormal operating state of the wind turbine and requires the initiation of the data recording process. The write pointer position indicates the memory address where the next data write operation will occur in the first front buffer. The target space index specifically refers to the exact storage location pointed to by the write pointer at the instant of fault triggering. The pre-fault dataset is a complete set of data extracted from the first memory buffer that formed within a certain period before the fault occurred. The second memory buffer is a newly allocated independent storage area specifically used to store operational data after the fault occurs.

[0070] Upon receiving a fault trigger signal, the current write pointer position is immediately locked; this position value is the target space index. Assuming N is 15000 and the current target space index is 5000, the extraction process proceeds according to the following logic:

[0071] First, all data records from index 5000 to index 14999 in the target space are extracted from the first pre-buffer. This constitutes the first pre-fault dataset, containing 10,000 consecutive data records. Next, data records from index 15000 to index 19999 are extracted from the second pre-buffer. This constitutes the second pre-fault dataset, containing 5,000 consecutive data records. The index range of 15000 to 19999 here corresponds precisely to the data mirror of the covered index range of 0 to 4999 in the first pre-buffer. Combining the first and second pre-fault datasets according to their spatial index order forms the complete pre-fault dataset as shown in Table 1. This dataset contains 15,000 consecutive data records, completely covering the entire preceding operational state from the historical moment to the instant the fault was triggered.

[0072]

[0073] While extracting the data before the failure, a new second memory buffer needs to be allocated in memory. This second buffer is used to store the operational data after the failure, and its capacity can be set to the same size as the dataset before the failure, i.e., 15,000 records, forming an equivalent recording period.

[0074] S140: Write the running data collected after receiving the fault trigger signal into the second memory buffer until the second target number of data records are filled, and obtain the post-fault dataset.

[0075] In one feasible implementation, the second memory buffer includes M consecutive space indices, where M is a positive integer, and the number of second target records is M.

[0076] Step S140 writes the operational data collected after receiving the fault trigger signal into the second memory buffer until the second target number of data records are filled, thus obtaining the post-fault dataset, including:

[0077] The running data is written sequentially to space indices 0 to M-1 in the second memory buffer until all M space indices have corresponding data records.

[0078] Extract all data records from the second memory buffer as the post-fault dataset.

[0079] In one feasible implementation, the number of first target items is equal to the number of second target items.

[0080] The post-fault dataset refers to the complete set of records consisting of newly acquired operational data after the fault trigger signal is generated. The second memory buffer is a storage area specifically allocated to store this post-fault data, containing M consecutive spatial indices. The second target number of records defines the total amount of post-fault data to be recorded, and its value is equal to M, representing the maximum number of records that the buffer can hold. In practice, the second target number of records is usually equal to the first target number of records, N, to ensure that the time span of records before and after the fault is consistent, forming symmetrical dual-time period data.

[0081] After the fault trigger signal is generated, the data acquisition process does not stop, but continues at the original high-frequency cycle. All newly acquired timestamped running data is redirected to be written to the newly allocated second memory buffer. The writing process starts from the beginning of this buffer and fills it sequentially according to the spatial index order, that is, starting from index 0 and gradually advancing to index M-1.

[0082] Each newly arrived data point is placed at the smallest available index position until all M storage units are filled. This sequential write mechanism ensures that the physical storage order of data in the buffer is completely consistent with the chronological order, requiring no additional sorting operations. When all M spatial indices of the second memory buffer are filled with data records, the second target number of records is reached. At this point, the buffer holds the complete post-failure dataset. Subsequently, through a single read operation, all data records from index 0 to index M-1 are extracted from the buffer to form the final post-failure dataset.

[0083] This dataset is completely equivalent in size to the previously extracted pre-fault dataset, together forming a continuous data record covering two complete time periods before and after the fault, providing a complete data foundation for subsequent fault analysis. The entire post-fault recording process is conducted independently, without interfering with parallel data acquisition and other control tasks.

[0084] S150: Merge the pre-fault dataset and the post-fault dataset to generate the target fault dataset, and store it in the file system according to the preset naming rules.

[0085] In one feasible implementation, each piece of data in the runtime data includes a millisecond-level timestamp at the time of data acquisition.

[0086] Step S150 involves merging the pre-fault dataset and the post-fault dataset to generate the target fault dataset, including:

[0087] The datasets before and after the failure are sorted and merged according to the millisecond-level timestamps of the data records in the datasets before and after the failure to generate the target failure dataset.

[0088] The target fault dataset is a complete collection of data integrated from the pre-fault dataset and the post-fault dataset, covering all operational records for two consecutive time periods before and after the fault occurred. The default naming convention defines the naming format for the generated data files, typically including a fixed prefix and a timestamp indicating the fault trigger time. The file system refers to the organizational structure used for long-term storage of data files, enabling the persistent saving of the dataset in memory to non-volatile storage media. Millisecond-level timestamps are precise timestamps attached to each data record at the time of acquisition, with an accuracy down to the millisecond level, providing a unified time reference for all data.

[0089] The data merging process is based on timestamps. First, all records in both the pre-failure and post-failure datasets are fully sorted according to their inherent millisecond-level timestamps, ensuring that all data is arranged strictly in chronological order, forming a complete time series from before to after the failure. This sorting and merging process produces the final target failure dataset, which contains 15,000 records from both before and after the failure, totaling 30,000 consecutive time-series data points.

[0090] The file generation process uses a preset naming rule to construct unique filenames. Filenames are typically composed of a fixed prefix and the specific time of the fault trigger. The naming rule can be: prefix name + underscore + timestamp of the fault trigger time. The timestamp can be YYYY-MM-DD_HH-MM-SS.SSS, accurate to milliseconds. For example, a format like DemoTraceLog_2025-09-02_12-10-11.257.txt, where the time part is accurate to milliseconds, ensures that the filename corresponding to each fault event is unique and identifiable. Example file content: Each record is spaced 10ms apart and includes a timestamp accurate to milliseconds, completely recording 15,000 data entries before and after the fault time, for a total of 30,000 data entries.

[0091] The storage operation writes the target fault dataset to the file system for persistent storage. This process is typically performed as a separate, low-priority task to avoid interfering with real-time data acquisition. After the data is written, the temporary buffer in memory can be released or reset, preparing for the recording of the next fault event. The entire merging and storage process ensures the complete preservation of fault data while minimizing resource consumption on key control functions.

[0092] In one feasible implementation, the method is implemented in an embedded system, storing the named target fault dataset into the file system according to a preset naming rule, and executing a separate low-priority task to store the dataset into the file system.

[0093] Embedded environments specifically refer to computing platforms with relatively limited computing resources, storage space, and power supply, such as the industrial control units used in various wind turbine main control systems. Independent low-priority tasks are execution units separated from the main control logic in the software architecture, with their scheduling priority set below critical control functions. A file system is a software component responsible for managing persistent storage devices, providing data organization, storage, and retrieval capabilities. Message communication mechanisms are a way to exchange information between different tasks, achieving data exchange and synchronization through shared memory areas or semaphores.

[0094] File storage operations achieve resource optimization through task separation and priority management. This design completely decouples file I / O operations from real-time data recording. Once the target fault dataset is ready in memory, storage is not performed immediately. Instead, a storage request is sent to a dedicated file management task via a message communication mechanism. This request includes the dataset's memory address information and the generated filename. The file management task is only activated when there is a storage requirement.

[0095] File management tasks run with low priority, only being scheduled for execution after the system has finished processing high-priority tasks and has remaining computing resources. This mechanism ensures that storage resources are not consumed in non-faulty states, and the file creation process is only triggered when a fault actually occurs. When a file management task is activated, it retrieves the location information of the target fault dataset from the message, creates the data file according to preset rules, and writes the dataset in memory to non-volatile storage media.

[0096] The entire architecture design features low resource consumption. During file writing, the main control task and high-priority tasks continue to execute normally, unaffected by the storage operation. After storage is complete, the task releases the occupied memory buffer resources, making them available for recording subsequent fault events. This method of handling storage operations through independent low-priority tasks offers strong compatibility, making it suitable for various embedded platforms. It can be quickly integrated into existing wind turbine main control systems without hardware upgrades, effectively balancing the use of limited resources in embedded environments. This ensures both the complete preservation of fault data and the real-time performance and reliability of core control functions.

[0097] The embedded data recording method for wind turbine main control system before and after a fault, provided in this application, employs an architecture combining dual front buffers and an independent back buffer. This method first ensures that a continuous and complete segment of high-frequency operating data prior to the fault can be locked and extracted from memory at the moment the fault is triggered, effectively solving the problem of data loss or breakage before the fault in traditional solutions. Subsequently, the system continues to record data after the fault into an independent buffer, and finally merges the data before and after the fault, thus fully covering the critical period of the fault occurrence and capturing transient fault characteristics. The entire process only performs one file storage operation after the fault, greatly reducing the continuous occupation of embedded system storage space and CPU resource contention. It successfully achieves efficient capture of the complete data chain before and after the fault under limited hardware resources, fundamentally solving the technical contradiction between balancing storage resources and data integrity, and significantly improving the accuracy and efficiency of wind turbine fault diagnosis.

[0098] Figure 3 This application provides a schematic diagram of a specific implementation of an embedded data recording system for dual time periods before and after a fault in a wind turbine main control system. (Refer to...) Figure 3 The system may include:

[0099] The allocation module 310 is used to allocate a first memory buffer in the memory of the wind turbine main control system, divide the first memory buffer into a first front buffer and a second front buffer, the first front buffer stores data in a circular rolling over manner, and the second front buffer serves as a mirror backup of the first front buffer to synchronously store the stored data of the first front buffer.

[0100] The storage module 320 is used to collect the operating data of the wind turbine main control system at a preset sampling period and synchronously write the operating data into the first front buffer and the second front buffer in chronological order.

[0101] When the fault trigger signal is received, the extraction module 330 extracts the first target number of data records from the first memory buffer according to the write pointer position of the first front buffer to obtain the pre-fault dataset, and allocates a second memory buffer in the memory of the wind turbine main control system.

[0102] Storage module 320 is also used to write the running data collected after receiving the fault trigger signal into the second memory buffer until the second target number of data records are recorded, so as to obtain the fault dataset;

[0103] The merging module 340 is used to merge the pre-fault dataset and the post-fault dataset to generate the target fault dataset, and store it in the file system according to the preset naming rules.

[0104] In one embodiment, the first memory buffer includes 2N consecutive space indices, where N is a positive integer; the space index range of the first front buffer is 0 to N-1, and the space index range of the second front buffer is N to 2N-1.

[0105] In one embodiment, the first target number is N; the extraction module 330 is specifically used to determine the target space index corresponding to the write pointer position in the first front buffer; extract the data records from the target space index to the space index N-1 in the first front buffer as the first pre-fault dataset; extract the data records from the space index N to the space index N+K-1 in the second front buffer as the second pre-fault dataset, where K is the difference between N and the total number of data records in the first and second pre-fault datasets; and construct the pre-fault dataset according to the space index order based on the first and second pre-fault datasets.

[0106] In one embodiment, the second memory buffer includes M consecutive spatial indices, where M is a positive integer, and the number of second target records is M. The storage module 320 is specifically used to write the running data sequentially into the spatial indices 0 to M-1 of the second memory buffer until all M spatial indices have corresponding data records. All data records in the second memory buffer are extracted as the post-fault dataset.

[0107] In one embodiment, the number of first target items is equal to the number of second target items.

[0108] In one embodiment, each piece of data in the running data includes a millisecond-level timestamp at the time of data acquisition; the merging module 340 is specifically used to sort and merge the pre-fault dataset and the post-fault dataset according to the millisecond-level timestamps of the data records in the pre-fault dataset and the post-fault dataset to generate the target fault dataset.

[0109] In one embodiment, the method is implemented in an embedded system, storing the named target fault dataset into the file system according to a preset naming rule, and executing a separate low-priority task to store the named target fault dataset into the file system.

[0110] The wind turbine main control system embedded data recording system before and after a fault in this application is used to implement the aforementioned wind turbine main control system embedded data recording method before and after a fault in two time periods. Therefore, the specific implementation of the wind turbine main control system embedded data recording system before and after a fault in two time periods can be found in the embodiment section of the wind turbine main control system embedded data recording method before and after a fault in two time periods mentioned above. The specific implementation can be referred to the description of the corresponding embodiment, and will not be repeated here.

[0111] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application is shown.

[0112] The electronic device may include a processor 410 and a memory 420 storing computer program instructions.

[0113] Specifically, the processor 410 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0114] Memory 420 may include mass storage for data or instructions. For example, and not limitingly, memory 420 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 420 may include removable or non-removable (or fixed) media. Where appropriate, memory 420 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 420 is non-volatile solid-state memory.

[0115] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of this disclosure.

[0116] The processor 410 reads and executes computer program instructions stored in the memory 420 to implement any of the above embodiments of the embedded data recording method for the two time periods before and after a fault in the wind turbine main control system.

[0117] In one example, the electronic device may also include a communication interface 430 and a bus 440. Wherein, such as Figure 4 As shown, the processor 410, memory 420, and communication interface 430 are connected through bus 440 and complete communication with each other.

[0118] The communication interface 430 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0119] Bus 440 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 440 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0120] The electronic device can execute the embedded data recording method for two time periods before and after a fault in the wind turbine main control system as described in the embodiments of this application, thereby realizing the embedded data recording method for two time periods before and after a fault in the wind turbine main control system as described in conjunction with the accompanying drawings.

[0121] Furthermore, in conjunction with the embedded data recording method for two time periods before and after a wind turbine main control system failure in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the embedded data recording methods for two time periods before and after a wind turbine main control system failure in the above embodiments.

[0122] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0123] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0124] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0125] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0126] The foregoing has provided a detailed description of the embedded data recording method, system, electronic equipment, and storage medium for a wind turbine main control system before and after a fault, covering both time periods. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of these embodiments are merely illustrative of the method and its core concepts. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A method for embedded recording of data in two time periods before and after a fault in a wind turbine main control system, characterized in that, include: A first memory buffer is allocated in the memory of the wind turbine main control system. The first memory buffer is divided into a first front buffer and a second front buffer. The first front buffer stores data in a circular rolling over manner. The second front buffer serves as a mirror backup of the first front buffer and synchronously stores the stored data of the first front buffer. The operating data of the wind turbine main control system is collected according to a preset sampling period, and the operating data is synchronously written into the first front buffer and the second front buffer in chronological order. Upon receiving a fault trigger signal, the system extracts the first target number of data records from the first memory buffer according to the write pointer position of the first front buffer to obtain the pre-fault dataset, and allocates a second memory buffer in the memory of the wind turbine main control system. The running data collected after receiving the fault trigger signal is written into the second memory buffer until the second target number of data records are recorded, thus obtaining the post-fault dataset; The dataset before the fault and the dataset after the fault are merged to generate a target fault dataset, and stored in the file system according to a preset naming rule; The first memory buffer includes 2N consecutive space indices, where N is a positive integer; The spatial index range of the first front buffer is 0 to N-1, and the spatial index range of the second front buffer is N to 2N-1; The first target number is N; The step of extracting a first target number of data records from the first memory buffer based on the write pointer position of the first front buffer to obtain the pre-fault dataset includes: Determine the target space index corresponding to the write pointer position in the first front buffer; Extract the data records from the target spatial index to the spatial index N-1 in the first front buffer as the first pre-fault dataset; Extract the data records from spatial index N to spatial index N+K-1 in the second front buffer as the second pre-fault dataset, where K is the difference between N and the total number of data records in the first pre-fault dataset and the second pre-fault dataset; The pre-fault dataset is constructed based on the first pre-fault dataset and the second pre-fault dataset, in spatial index order.

2. The method according to claim 1, characterized in that, The second memory buffer includes M consecutive spatial indices, where M is a positive integer, and the number of the second target records is M; The step involves writing the operational data collected after receiving the fault trigger signal into the second memory buffer until the second target number of data records are filled, thus obtaining the post-fault dataset, which includes: The running data is sequentially written to space indices 0 to M-1 of the second memory buffer until all M space indices have corresponding data records. Extract all data records from the second memory buffer as the post-fault dataset.

3. The method according to claim 2, characterized in that, The number of the first target items is equal to the number of the second target items.

4. The method according to claim 1, characterized in that, Each piece of data in the operational data includes a millisecond-level timestamp at the time of data collection; The target fault dataset is generated by merging the pre-fault dataset and the post-fault dataset, including: The datasets before and after the fault are sorted and merged according to the millisecond-level timestamps of the data records in the datasets before and after the fault to generate the target fault dataset.

5. The method according to claim 1, characterized in that, The method is implemented in an embedded system. The target fault dataset is stored in the file system according to a preset naming rule. An independent low-priority task is used to execute the storage of the named dataset into the file system.

6. A dual-time period data embedding recording system for wind turbine main control system before and after a fault, characterized in that, include: The allocation module is used to allocate a first memory buffer in the memory of the wind turbine main control system, and divide the first memory buffer into a first front buffer and a second front buffer. The first front buffer stores data in a circular rolling over manner, and the second front buffer serves as a mirror backup of the first front buffer to synchronously store the stored data of the first front buffer. The first memory buffer includes 2N consecutive spatial indices, where N is a positive integer. The spatial index range of the first front buffer is 0 to N-1, and the spatial index range of the second front buffer is N to 2N-1. The storage module is used to collect the operating data of the wind turbine main control system at a preset sampling period and synchronously write the operating data into the first front buffer and the second front buffer in chronological order. The extraction module, upon receiving a fault trigger signal, extracts a first target number of data records from the first memory buffer based on the write pointer position of the first front buffer to obtain a pre-fault dataset, and allocates a second memory buffer in the memory of the wind turbine main control system; the first target number of records is N; the extraction module is further configured to determine the target spatial index corresponding to the write pointer position in the first front buffer; extract the data records from the target spatial index to the spatial index N-1 in the first front buffer as the first pre-fault dataset; extract the data records from the spatial index N to the spatial index N+K-1 in the second front buffer as the second pre-fault dataset, where K is the difference between N and the total number of data records in the first and second pre-fault datasets; and construct the pre-fault dataset according to the spatial index order based on the first and second pre-fault datasets. The storage module is also used to write the running data collected after receiving the fault trigger signal into the second memory buffer until the second target number of data records are recorded to obtain the post-fault dataset; The merging module is used to merge the pre-fault dataset and the post-fault dataset to generate a target fault dataset, and store it in the file system according to a preset naming rule.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the steps of the embedded data recording method for two time periods before and after a fault in the wind turbine main control system as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, enables the method for embedded recording of data before and after a fault in the wind turbine main control system as described in any one of claims 1 to 5.