Level detection method and apparatus for time series signal, computer device, and medium
By dividing the time series signal into intervals to construct a histogram, the median and standard deviation of the peak data are obtained, solving the problem of low detection efficiency in existing technologies and achieving efficient signal level detection.
Patent Information
- Application Number
- PCT/CN2024/086643
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-08
- Publication Date
- 2025-12-04
AI Technical Summary
Existing technologies are complex and inefficient in detecting the level of time-series signals, making it impossible to perform signal level detection efficiently.
By dividing the time series signal into a preset number of intervals, constructing a histogram, obtaining the median and standard deviation of the peak data, and determining the signal level based on the median and standard deviation.
It achieves efficient horizontal detection of time series signals, simplifies the data processing process, and improves detection efficiency.
Smart Images

Figure CN2024086643_04122025_PF_FP_ABST
Abstract
Description
Methods, apparatus, computer equipment, and media for level detection of time series signals Technical Field
[0001] This application relates to the field of signal detection technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for level detection of time series signals. Background Technology
[0002] A time series signal is a signal that is related to time, and its value changes over time. Time series signals can be continuous or discrete. They are commonly used to describe events or behaviors that occur at a specific point in time, such as audio signals, video signals, and sequencing signals.
[0003] There are two main approaches to traditionally detecting the level of time series signals. One is the traditional time series data analysis approach, which involves converting the time series data to time-frequency and then using statistical analysis methods and manual extraction of special sequence features to perform similarity calculations and threshold filtering for detection. The other is a deep learning end-to-end approach, which does not require manual feature extraction. It directly trains a deep learning model based on the original data and then uses this deep learning model to detect the signal level.
[0004] Although both of the above methods can achieve basic time series signal level detection, their implementation process is complex, requires a large amount of data processing, and their detection efficiency is low.
[0005] Summary of the Invention
[0006] According to various embodiments of this application, a method, apparatus, computer device, storage medium, and computer program product for detecting the level of a time series signal are provided.
[0007] A method for level detection of time series signals, the method comprising:
[0008] Acquire time series signals;
[0009] The time series signal is divided into a preset number of intervals, the number of points in each interval is counted, and a histogram is constructed based on the number of points in each interval.
[0010] Obtain peak data from the histogram;
[0011] Obtain the median and standard deviation of the time series data corresponding to each peak in the peak data; and
[0012] The level detection result of the time series signal is determined based on the median and the standard deviation.
[0013] In some embodiments, acquiring the time series signal includes:
[0014] Acquire the initial time series signal; and
[0015] Abnormal data are removed from the initial time series signal to obtain the time series signal.
[0016] In some embodiments, the above-described time series signal level detection method further includes:
[0017] Obtain the amplitude range threshold corresponding to a normal time series signal; and
[0018] Based on the amplitude range threshold, abnormal data in the initial time series signal are removed to obtain the time series signal.
[0019] In some embodiments, obtaining peak data from a histogram includes:
[0020] Smooth the histogram and obtain the peak data in the smoothed histogram.
[0021] In some embodiments, smoothing the histogram includes:
[0022] Based on a sliding window of a preset size, the histogram is smoothed using a moving average method.
[0023] In some embodiments, smoothing the histogram and obtaining peak data in the smoothed histogram includes:
[0024] The histogram is smoothed, and peak data with frequencies greater than a preset frequency threshold are extracted from the smoothed histogram.
[0025] In some embodiments, the above-described time series signal level detection method further includes:
[0026] The peak data is filtered based on a preset threshold number of points to obtain the filtered peak data; and
[0027] Obtain the median and standard deviation of the time series data corresponding to each peak in the filtered peak data.
[0028] In some embodiments, determining the level detection result of the time series signal based on the median and the standard deviation includes:
[0029] Based on the median and the standard deviation, peaks with a standard deviation greater than a preset first constant or a median less than a preset second constant are removed to obtain candidate peaks;
[0030] Compare the median values of the time series data corresponding to the candidate peaks; and
[0031] The median maximum value is used as the signal level of the time series signal.
[0032] In some embodiments, the time-series signal includes a nanopore sequencing sequence signal.
[0033] Secondly, this application also provides a time series signal level detection device. The device includes:
[0034] The signal acquisition module is used to acquire time series signals;
[0035] The histogram construction module is used to divide the time series signal into a preset number of intervals, count the number of points in each interval, and construct a histogram based on the number of points in each interval.
[0036] The data extraction module is used to obtain peak data from the histogram;
[0037] The calculation module is used to obtain the median and standard deviation of the time series data corresponding to each peak in the peak data; and
[0038] The detection module is used to determine the level detection result of the time series signal based on the median and the standard deviation.
[0039] In some embodiments, the signal acquisition module is further configured to acquire an initial time series signal; and remove abnormal data from the initial time series signal to obtain a time series signal.
[0040] In some embodiments, the signal acquisition module is further configured to acquire an amplitude range threshold corresponding to a normal time series signal; and based on the amplitude range threshold, remove abnormal data from the initial time series signal to obtain a time series signal.
[0041] In some embodiments, the data extraction module is further configured to smooth the histogram using a moving average method based on a sliding window of a preset size.
[0042] In some embodiments, the data extraction module is further configured to smooth the histogram and obtain peak data in the smoothed histogram.
[0043] In some embodiments, the data extraction module is further configured to smooth the histogram and extract peak data in the smoothed histogram whose frequency is greater than a preset frequency threshold.
[0044] In some embodiments, the calculation module is further configured to filter the peak data based on a preset point threshold to obtain filtered peak data; and to obtain the median and standard deviation of the time series data corresponding to each peak in the filtered peak data.
[0045] In some embodiments, the detection module is further configured to, based on the median and the standard deviation, remove peaks whose standard deviation is greater than a preset first constant or whose median is less than a preset second constant to obtain candidate peaks; compare the median of the time series data corresponding to the candidate peaks; and use the maximum median as the signal level of the time series signal.
[0046] In some embodiments, the time-series signal includes a nanopore sequencing sequence signal.
[0047] Fourthly, this application provides a computer device including a memory and one or more processors. The memory stores computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the time series signal level detection method described above.
[0048] Fifthly, this application provides one or more computer storage media storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the time series signal level detection method described above.
[0049] Sixthly, this application provides a computer program product that, when executed by one or more processors, causes the one or more processors to perform the steps of the above-described time-series signal level detection method.
[0050] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0051] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application 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 the drawings without creative effort.
[0052] Figure 1 is a schematic diagram of an application scenario of a time series signal level detection method in one embodiment;
[0053] Figure 2 is a flowchart illustrating a time series signal level detection method in one embodiment;
[0054] Figure 3 is a flowchart illustrating a time series signal level detection method in another embodiment;
[0055] Figure 4 is a schematic diagram of signal levels in the sequencing signal;
[0056] Figure 5 is a schematic diagram of the extracted nanopore sequencing sequence data;
[0057] Figure 6 shows the histogram obtained after dividing the nanopore sequencing sequence data into intervals.
[0058] Figure 7 is a schematic diagram after histogram moving average processing;
[0059] Figure 8 is a schematic diagram of peak selection based on preset frequency.
[0060] Figure 9 is a schematic diagram of peak filtering based on a preset number of points;
[0061] Figure 10 is a schematic diagram of peak selection based on median and standard deviation;
[0062] Figure 11 is a structural block diagram of a time series signal level detection device in one embodiment;
[0063] Figure 12 is an internal structure diagram of a computer device in one embodiment. Detailed Implementation
[0064] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.
[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0066] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in some embodiments of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0067] The time-series signal level detection method provided in this application embodiment can be applied to the application environment of nanopore sequencing signal level detection as shown in Figure 1. It includes a single-channel nanopore sequencing device 102 and a detection terminal 104. The single-channel nanopore sequencing device 102 collects nanopore sequencing signals and sends them to the detection terminal 104. The detection terminal 104 acquires the nanopore sequencing signals, divides them into a preset number of intervals, counts the number of points in each interval, and constructs a histogram based on the number of points in each interval. It then smooths the histogram and obtains the peak data in the smoothed histogram. Finally, it obtains the median and standard deviation of the time-series data corresponding to each peak in the peak data, and determines the level detection result of the nanopore sequencing signal based on the median and standard deviation. Furthermore, the detection terminal 104 can push the level detection result to the user, for example, displaying the final level detection result on a screen. Specifically, the detection terminal 104 can be a PC.
[0068] As shown in Figure 2, this application provides a method for detecting the level of a time series signal, which can be applied to the detection terminal in Figure 1. The method includes:
[0069] S100: Acquire time series signals.
[0070] A time series signal is a collection of observation points ordered chronologically, used to reflect the state or degree of change of a thing or phenomenon over time. Here, the time series signal can be acquired by an external device and then sent to the detection terminal. Alternatively, the time series signal can be acquired by an external device first, then buffered, and then sent to the detection terminal when level detection of the time series signal is required.
[0071] S200: Divide the time series signal into a preset number of intervals, count the number of points in each interval, and construct a histogram based on the number of points in each interval.
[0072] The preset quantity is a pre-defined number, typically a large one. Its specific value can be set according to the required detection accuracy. For higher accuracy, a larger preset quantity can be chosen; for a more moderate level of accuracy, a normal value can be selected. Common preset quantities are 800, 1000, 1200, etc. When dividing the time series signal into preset intervals based on the current values obtained at each time point, equal intervals can be used. After division, the number of points falling within each interval is counted, and a histogram is constructed based on the number of points in each interval. Specifically, once the number of points in each interval is available, a histogram can be built. Various plotting tools or libraries can be used to create histograms, such as Python's matplotlib library or R's ggplot2 package. The histogram provides a visual representation of the distribution of the time series signal across different intervals.
[0073] S300: Obtain peak data from the histogram.
[0074] The peak data is extracted from the histogram. Furthermore, since a histogram is a rectangular graph, it can be smoothed for accurate subsequent data processing. After smoothing, the entire graph presents a smooth waveform, from which the specific peak data can be extracted. It can be understood that the peaks here refer to the intervals corresponding to a relatively large number of points in the time series signal. Specifically, smoothing the histogram helps eliminate spikes and dips caused by data fluctuations or random noise, thus more clearly revealing the main distribution trend of the data. Smoothing can be achieved through various methods, including but not limited to moving averages, Gaussian filtering, or kernel density estimation.
[0075] S400: Obtain the median and standard deviation of the time series data corresponding to each peak in the peak data.
[0076] In S300, multiple peaks may be obtained. For each peak, the median and standard deviation of the corresponding time series data are calculated. Specifically, for each peak, the median and standard deviation of the corresponding time series data are calculated. If there are multiple peaks, the median and standard deviation of each peak are calculated separately. The calculated median and standard deviation are then aggregated and organized to determine the level detection result of the time series signal in the next step.
[0077] S500: Determines the level detection result of a time series signal based on the median and standard deviation.
[0078] The median and standard deviation corresponding to each peak obtained from S400 are used to further determine the level detection result of the entire time series signal. Specifically, the target peaks that finally meet the median and standard deviation requirements can be screened based on the median and standard deviation corresponding to each peak, and then the level detection result of the time series signal can be determined based on the median corresponding to the target peaks.
[0079] The aforementioned method for level detection of time series signals involves: acquiring a time series signal; dividing the time series signal into a predetermined number of intervals, counting the number of points in each interval, and constructing a histogram based on the number of points in each interval; acquiring the peak data in the histogram; acquiring the median and standard deviation of the time series data corresponding to each peak; and determining the level detection result of the time series signal based on the median and standard deviation. Throughout this process, only simple data processing of the time series signal is required, without the need for complex calculations, enabling efficient level detection of time series signals.
[0080] As shown in Figure 3, in some embodiments, S100 includes:
[0081] S120: Acquire the initial time series signal; and
[0082] S140: Remove outlier data from the initial time series signal to obtain the time series signal.
[0083] When acquiring time-series signals, outlier data can be removed from the initial signal to ensure a valid signal. Specifically, outlier data can be incomplete or erroneous. Furthermore, outlier data can be removed from the initial signal based on the amplitude range corresponding to a normal time-series signal. Taking nanopore sequencing data as an example, the normal range for nanopore sequencing current values is generally 0 to 350. Values exceeding this range are considered abnormal. Therefore, points with current values less than 0 or greater than 350 can be removed from the nanopore sequencing data to obtain the final valid signal.
[0084] In some embodiments, smoothing a histogram includes:
[0085] Based on a sliding window of preset size, the histogram is smoothed using the moving average method.
[0086] In this embodiment, smoothing is performed using a sliding window based on a preset size. The size of the sliding window can be set according to actual needs, such as 8, 10, or 12. The sliding window size corresponds to the time period in the moving average method. For the data within a single time period, its average value is calculated, and this average value is used as the predicted value for that time period. Specifically, the simple moving average takes the average of the data within a certain time period as the predicted value for that time period, and the formula is:
[0087] Among them, SMA t X represents the simple moving average at time point t. t The data represents time point t, and n is the length of the time period, i.e., the sliding window size.
[0088] In some embodiments, smoothing the histogram and obtaining peak data in the smoothed histogram includes: smoothing the histogram and extracting peak data in the smoothed histogram whose frequency is greater than a preset frequency threshold.
[0089] The preset frequency threshold is a pre-defined threshold that can be set according to actual needs. Specifically, it represents the size of the peaks. If larger peaks need to be selected, the preset frequency threshold can be set to a larger value; if a larger number of smaller peaks need to be selected, the preset frequency threshold can be set to a smaller value. Specifically, the preset frequency threshold can be 1, 2, 3, etc. Generally, data with larger peaks accurately reflect the level detection results of the time series signal. Therefore, to further reduce the amount of subsequent data processing, the preset frequency threshold is used here.
[0090] In some embodiments, the above-described time series signal level detection method further includes: filtering peak data based on a preset point threshold to obtain filtered peak data; and obtaining the median and standard deviation of the time series data corresponding to each peak in the filtered peak data.
[0091] In this embodiment, the peak data is further filtered based on a preset point threshold. Specifically, the preset point threshold is a pre-set value that can be set according to actual needs, such as 100, 200, 300, etc. The number of points corresponding to each peak data is counted, and peak data with a point count exceeding the preset point threshold are filtered out. Then, the median and standard deviation of the time series data corresponding to each peak in the filtered peak data are obtained.
[0092] As shown in Figure 3, in some embodiments, S500 includes:
[0093] S520: Based on the median and standard deviation, remove peaks with a standard deviation greater than a preset first constant or a median less than a preset second constant to obtain candidate peaks.
[0094] S540: Compare the median size of the time series data corresponding to the candidate peaks; and
[0095] S560: The median maximum value is used as the signal level of the time series signal.
[0096] Based on the median and standard deviation corresponding to each peak, the peaks are further filtered to determine the final candidate peaks. Specifically, this filtering is based on a first preset constant and a second preset constant, which are constants set based on empirical values and used for further filtering of the peaks. Specifically, the first preset constant can be 4, 5, 6, etc.; the second preset constant can be 50, 100, 150, etc. For the candidate peaks obtained after this second filtering, the median of the time series data corresponding to different candidate peaks is compared, and the maximum median is selected as the signal level of the final time series signal.
[0097] To illustrate the technical solution and effectiveness of the time series signal level detection method of this application in detail, the following description will use nanopore sequencing signal level detection as an application example.
[0098] Nanopore sequencing signals refer to the changes in perforation current recorded as DNA molecules pass through nanopores. These changes are mainly caused by the different currents at different bases within the nanopore. The specific identification steps are as follows:
[0099] Step 1: Sequencing Data Acquisition: Acquire nanopore sequencing data including signal levels and save them to a hard drive file. Signal level refers to the median of data with a value above 100 before a significant drop in sequencing signal. See Figure 4 for details.
[0100] Step 2: Extract nanopore sequencing data, as shown in Figure 5.
[0101] Step 3: Remove points less than 0 or greater than 350. Divide the data into 1000 intervals from 0 to the maximum value, as shown in Figure 5. The x-coordinate is the point number. In Figure 5, the x-coordinate is from 0 to 10000, representing 10000 points. The y-coordinate is the current value of the signal. Count the number of points in each interval to obtain the histogram of the data. The histogram is shown in Figure 6.
[0102] Step 4: Calculate the moving average of the data obtained in Step 3. The sliding window size corresponding to the moving average is 10, resulting in the waveform shown in Figure 7.
[0103] Step 5: Take only the data with a vertical axis value greater than 2 (frequency) from the data obtained in Step 4, and obtain 4 peaks as shown in Figure 8.
[0104] Step 6: From the four peak data obtained in Step 5, only the peaks with a number of points greater than 200 are selected, as shown in Figure 9.
[0105] Step 7: For the peak data obtained in Step 6, calculate the median and standard deviation of the sequencing data corresponding to each peak, as shown in Figure 10.
[0106] Step 8: After removing peaks from Step 7 with a standard deviation greater than 5 or a median less than 100, the maximum median value is selected as the signal level. Specifically, as shown in Figure 10, after removing the first peak, the median of the fourth peak, 196, is taken as the final signal level. Specifically, in Figures 4, 5, and 10, the x and y coordinates have the same meaning: the x-coordinate is the point number, and the y-coordinate is the current value. In Figures 6 through 9, the x and y coordinates have the same meaning: the x-coordinate is the current value, and the y-coordinate is the frequency.
[0107] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0108] Based on the same inventive concept, this application also provides a time series signal level detection device for implementing the time series signal level detection method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more time series signal level detection device embodiments provided below can be found in the limitations of the time series signal level detection method described above, and will not be repeated here.
[0109] In one embodiment, as shown in FIG11, a time series signal level detection device is provided, comprising:
[0110] Signal acquisition module 100 is used to acquire time series signals;
[0111] The histogram construction module 200 is used to divide the time series signal into a preset number of intervals, count the number of points in each interval, and construct a histogram based on the number of points in each interval.
[0112] Data extraction module 300 is used to obtain peak data in histogram;
[0113] The calculation module 400 is used to obtain the median and standard deviation of the time series data corresponding to each peak in the peak data; and.
[0114] The detection module 500 is used to determine the level detection result of a time series signal based on the median and standard deviation.
[0115] In some embodiments, the signal acquisition module 100 is further configured to acquire an initial time series signal and remove abnormal data from the initial time series signal to obtain a time series signal.
[0116] In some embodiments, the signal acquisition module 100 is further configured to acquire an amplitude range threshold corresponding to a normal time series signal; and based on the amplitude range threshold, remove abnormal data from the initial time series signal to obtain a time series signal.
[0117] In some embodiments, the data extraction module 300 is further used for
[0118] In some embodiments, the data extraction module 300 is further used to smooth the histogram using a moving average method based on a sliding window of a preset size.
[0119] In some embodiments, the data extraction module 300 is further configured to smooth the histogram and extract peak data in the smoothed histogram whose frequency is greater than a preset frequency threshold.
[0120] In some embodiments, the calculation module 400 is further configured to filter the peak data based on a preset point threshold to obtain the filtered peak data; and to obtain the median and standard deviation of the time series data corresponding to each peak in the filtered peak data.
[0121] In some embodiments, the detection module 500 is further configured to, based on the median and standard deviation, remove peaks whose standard deviation is greater than a preset first constant or whose median is less than a preset second constant to obtain candidate peaks; compare the median of the time series data corresponding to the candidate peaks; and use the maximum median as the signal level of the time series signal.
[0122] In some embodiments, the time-series signal includes a nanopore sequencing sequence signal.
[0123] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in Figure 12. The computer device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with external terminals. Wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a time-series signal level detection method. The display screen of the computer device may be a liquid crystal display (LCD) or an e-ink display. The input device of the computer device may be a touch layer covering the display screen, or buttons, a trackball, or a touchpad located on the casing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0124] Those skilled in the art will understand that the structure shown in Figure 12 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0125] In some embodiments, a computer device is provided, including a memory and one or more processors, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors cause the one or more processors to perform the steps of the time series signal level detection method described above.
[0126] In some embodiments, this application provides one or more computer storage media storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the time series signal level detection method described above.
[0127] In some embodiments, this application provides a computer program product that, when executed by one or more processors, causes the one or more processors to perform the steps of the time series signal level detection method described above.
[0128] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0129] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0130] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make appropriate modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for level detection of a time series signal, the method comprising: Acquire time series signals; The time series signal is divided into a preset number of intervals, the number of points in each interval is counted, and a histogram is constructed based on the number of points in each interval. Obtain the peak data from the histogram; Obtain the median and standard deviation of the time series data corresponding to each peak in the peak data; and The level detection result of the time series signal is determined based on the median and the standard deviation.
2. The method according to claim 1, wherein acquiring the time series signal comprises: Obtain the initial time series signal; and Abnormal data are removed from the initial time series signal to obtain the time series signal.
3. The method according to claim 2, further comprising: Obtain the amplitude range threshold corresponding to a normal time series signal; and Based on the amplitude range threshold, abnormal data in the initial time series signal are removed to obtain the time series signal.
4. The method according to claim 1, wherein obtaining the peak data in the histogram comprises: The histogram is smoothed to obtain the peak data in the smoothed histogram.
5. The method according to claim 4, wherein smoothing the histogram comprises: Based on a sliding window of a preset size, the histogram is smoothed using a moving average method.
6. The method according to claim 4, wherein smoothing the histogram and obtaining peak data in the smoothed histogram comprises: The histogram is smoothed, and peak data with frequencies greater than a preset frequency threshold are extracted from the smoothed histogram.
7. The method according to claim 6, further comprising: The peak data is filtered based on a preset point threshold to obtain filtered peak data; and Obtain the median and standard deviation of the time series data corresponding to each peak in the filtered peak data.
8. The method according to claim 1, wherein determining the level detection result of the time series signal based on the median and the standard deviation comprises: Based on the median and the standard deviation, peaks with a standard deviation greater than a preset first constant or a median less than a preset second constant are removed to obtain candidate peaks; Compare the median values of the time series data corresponding to the candidate peaks; and The median maximum value is used as the signal level of the time series signal.
9. The method according to claim 1, wherein the time series signal comprises a nanopore sequencing sequence signal.
10. A time series signal level detection device, the device comprising: The signal acquisition module is used to acquire time series signals; The histogram construction module is used to divide the time series signal into a preset number of intervals, count the number of points in each interval, and construct a histogram based on the number of points in each interval. The data extraction module is used to obtain the peak data in the histogram; The calculation module is used to obtain the median and standard deviation of the time series data corresponding to each peak in the peak data; and The detection module is used to determine the level detection result of the time series signal based on the median and the standard deviation.
11. The apparatus according to claim 10, wherein the signal acquisition module is further configured to acquire an initial time series signal; and remove abnormal data from the initial time series signal to obtain a time series signal.
12. The apparatus according to claim 11, wherein the signal acquisition module is further configured to acquire an amplitude range threshold corresponding to a normal time series signal; and based on the amplitude range threshold, remove abnormal data from the initial time series signal to obtain a time series signal.
13. The apparatus according to claim 10, wherein the data extraction module is further configured to smooth the histogram and obtain peak data in the smoothed histogram.
14. The apparatus according to claim 10, wherein the data extraction module is further configured to smooth the histogram using a moving average method based on a sliding window of a preset size.
15. The apparatus according to claim 10, wherein the data extraction module is further configured to smooth the histogram and extract peak data in the smoothed histogram whose frequency is greater than a preset frequency threshold.
16. The apparatus according to claim 15, wherein the calculation module is further configured to filter the peak data based on a preset point threshold to obtain filtered peak data; and to obtain the median and standard deviation of the time series data corresponding to each peak in the filtered peak data.
17. The apparatus according to claim 10, wherein the detection module is further configured to, based on the median and the standard deviation, remove peaks whose standard deviation is greater than a preset first constant or whose median is less than a preset second constant to obtain candidate peaks; compare the median of the time series data corresponding to the candidate peaks; and use the maximum median as the signal level of the time series signal.
18. The apparatus of claim 10, wherein the time-series signal comprises a nanopore sequencing sequence signal.
19. A computer device comprising a memory and one or more processors, the memory storing computer-readable instructions which, when executed by the one or more processors, cause the one or more processors to perform the steps of the method according to any one of claims 1 to 9.
20. One or more computer storage media storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the method according to any one of claims 1 to 9.