A time series data analysis method based on Python

By extending the Python language to adapt to timing data, a timing data analysis method is provided, which solves the problems of high requirements for data analysis complexity and programming skills in the prior art, and realizes a user-friendly timing data analysis solution.

CN119292580BActive Publication Date: 2025-04-22商飞软件有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411828541.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-22
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

The existing Python data analysis library is still complicated for non-professionals and requires a certain foundation of programming skills, making it difficult to adapt to data analysts who have not been exposed to computer programming languages.

Method used

Provide a time series data analysis method based on Python. By extending the Python language, it adapts to time series data, supports different time series data frequencies, flexibly selects the input and output data types, and builds a data analysis system, and users can perform data analysis operations through interactive interfaces.

Benefits of technology

It reduces user learning costs and adapts to the data analysis system in industrial application scenarios. Users can freely choose data types to realize flexible analysis and processing of time series data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292580B_ABST
    Figure CN119292580B_ABST
Patent Text Reader

Abstract

The present invention discloses a time series data analysis method based on Python, which belongs to the field of data analysis technology and includes the following steps: S1, expansion based on Python language to adapt to time series data, S2, the language adapts to different time series data frequencies, S3, the language can flexibly select input and output data types, S4, time series data or characteristic values ​​can be referenced to each other, and a set of data analysis system is built. The time series data analysis method based on Python is expanded based on Python language, the user learning cost is low, it can perfectly adapt to the common data analysis system in industrial application scenarios, and the input and output data types can be freely selected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data analysis, and in particular to a time series data analysis method based on Python. Background Art

[0002] Time series data refers to time series data. Time series data is a data column recorded in chronological order with the same unified indicator, which is used to describe the change of the phenomenon over time. This type of data reflects the state or degree of change of a thing, phenomenon, etc. over time. In many fields, the analysis of time series data is an important problem.

[0003] Python was designed by Guido van Rossum of the Netherlands National Research Center for Mathematics and Computer Science in the early 1990s. It provides efficient high-level data structures and simple and effective object-oriented programming. Python syntax and dynamic typing, as well as the nature of an interpreted language, make it a programming language for writing scripts and rapidly developing applications on most platforms. With the continuous update of versions and the addition of new language features, it is gradually being used for the development of independent and large-scale projects.

[0004] Since Python has a low entry barrier and a rich community ecosystem, many non-professionals use it for data analysis in their own fields. For example, quantitative traders usually use Python for quantitative analysis, and in the industrial field, many engineers also use it for time series data analysis generated by equipment. However, the widely used related libraries are still complicated for non-professionals to use, and generally speaking, using Python for data analysis still requires a certain level of programming skills, which is not friendly to other data analysts who have not been exposed to computer programming languages. Summary of the invention

[0005] The invention object provided by the present invention is to provide a Python-based time series data analysis method. Through the present invention, a Python-based time series data analysis method is extended based on the Python language, the user learning cost is low, it can perfectly adapt to the common data analysis system in industrial application scenarios, and can freely select the input and output data types.

[0006] In order to achieve the above effect, the present invention provides the following technical solution: a Python-based time series data analysis method, comprising the following steps:

[0007] S1. Expand based on Python language to adapt it to time series data.

[0008] S2. The language is adapted to different time series data frequencies.

[0009] S3. The language can flexibly select the input and output data types.

[0010] S4. Time series data or feature values ​​can reference each other to build a data analysis system.

[0011] Further, according to the operation steps in S1,

[0012] S101. Establish an interactive interface in a required application so that a user can call this language to perform data analysis operations.

[0013] S102. For time series data, a calculation mode can be selected on the interactive interface, and the calculation modes include a normal mode and a time series mode.

[0014] S103: For the normal mode, the time series data input by the user will be converted into a corresponding two-dimensional array according to its corresponding frequency.

[0015] S104. For the time series mode, the script input by the user will be regarded as a calculation operation executed at each moment, and the system will automatically traverse all calculation points for calculation.

[0016] Further, according to the operation steps in S2,

[0017] S201. When performing time series data operations, the system provides a function for selecting data frequency, and the user can define the frequency of the operation.

[0018] S202. According to the selected frequency, the system will automatically generate operation points according to the length of the time series data.

[0019] S203: If the selected frequency is higher than the frequency of the time series data, the system will perform interpolation processing on the input time series data.

[0020] S204: If the selected frequency is lower than the frequency of the time series data, the system will perform frequency reduction processing on the input time series data.

[0021] Further, according to the operation steps in S203, in the interpolation process, the user can arbitrarily select an interpolation algorithm, and the optional interpolation algorithms include using the most recent effective value, linear smoothing, and MACD smoothing.

[0022] Further, according to the operation steps in S203, the most recent effective value is the effective value of a quantity most recently measured or calculated within a given time window, and the linear smoothing is a data smoothing technique used to reduce random fluctuations or noise in data so as to more clearly display the trend or periodicity of the data.

[0023] Further, according to the operation steps in S203, the MACD smoothing refers to the process of obtaining the difference average value DEA by further smoothing the difference DIFF between the fast moving average EMA1 and the slow moving average EMA2 when using the MACD indicator, and the multiple interpolation algorithms are used to estimate the value of unknown data points through known discrete data points.

[0024] Further, according to the operation steps in S3,

[0025] S301. During use, the user needs to define the input data type as time series data or feature data.

[0026] S302. During use, the user needs to define the output data type as time series data or feature data.

[0027] S303: If the time series mode is selected when the calculation mode is selected in S102, the output data may be time series data or feature data.

[0028] S304: If the normal mode is selected when the calculation mode is selected in S102, the output data can only be feature data.

[0029] Further, according to the operation steps in S4,

[0030] S401. Before entering into the time series data calculation, generate a globally effective handle G.

[0031] S402. During calculation, all reference parameters are introduced into the handle for access.

[0032] S403. The user can store the customized parameters in the handle to function as a global variable.

[0033] S404: If a timing operation is performed, the handle contains corresponding time information.

[0034] S405. The __getitem__() function of the timing parameter in the handle is overloaded so that the corresponding numerical parameter can be obtained according to the corresponding time at each time point.

[0035] Further, according to the operation steps in S1, the method includes but is not limited to time series data analysis work in the industrial and financial fields.

[0036] Further, according to the operation steps in S4, the analysis results of the method are visualized, and the user can intuitively monitor whether the landing load exceeds the threshold related events.

[0037] The present invention provides a Python-based time series data analysis method, which has the following beneficial effects: the Python-based time series data analysis method is expanded based on the Python language, has a low user learning cost, can perfectly adapt to common data analysis systems in industrial application scenarios, and can freely select input and output data types. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a flow chart of a Python-based time series data analysis method of the present invention. DETAILED DESCRIPTION

[0039] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments. Example

[0040] See also Figure 1, a time series data analysis method based on Python, comprising the following steps: S1, based on Python language expansion, make it adapt to time series data, S101, establish an interactive interface in the required application, so that users can call this language to perform data analysis operations, S102, for time series data, you can select the calculation mode on the interactive interface, the calculation mode includes normal mode and time series mode, S103, for normal mode, the time series data input by the user will be converted into a corresponding two-dimensional array according to its corresponding frequency, S104, for time series mode, the script input by the user will be regarded as a calculation operation performed at each moment, and the system will automatically traverse all calculation points for calculation, S2, the language is adapted to different time series data Frequency, S201, when performing time series data operations, the system provides the function of selecting data frequency, and the user can define the frequency of the operation, S202, according to the selected frequency, the system will automatically generate operation points according to the length of the time series data, S203, if the selected frequency is higher than the frequency of the time series data, the system will interpolate the input time series data, S204, if the selected frequency is lower than the frequency of the time series data, the system will reduce the frequency of the input time series data, in the interpolation process, the user can arbitrarily select the interpolation algorithm, the optional interpolation algorithm includes the use of the most recent effective value, linear smoothing, MACD smoothing and other interpolation algorithms, the most recent effective value is the effective value of a quantity recently measured or calculated within a given time window , the linear smoothing is a data smoothing technology used to reduce random fluctuations or noise in the data so as to more clearly display the trend or periodicity of the data. The MACD smoothing refers to the process of further smoothing the difference (DIFF) between the fast moving average (EMA1) and the slow moving average (EMA2) to obtain the difference from the average (DEA) when using the MACD indicator. The multiple interpolation algorithms are used to estimate the values ​​of unknown data points through known discrete data points. S3. The language can flexibly select the data types of input and output. S301. When using, the user needs to define the input data type as time series data or feature data. S302. When using, the user needs to define the output data type. The type is time series data or feature data. S303. If the time series mode is selected when selecting the calculation mode in S102, the output data can be time series data or feature data. S304. If the normal mode is selected when selecting the calculation mode in S102, the output data can only be feature data. S4. Time series data or feature values ​​can reference each other to build a data analysis system. S401. Before entering the time series data calculation, generate a globally effective handle G. S402. During calculation, introduce all reference parameters into the handle for access. S403. Users can store custom parameters in the handle to play the role of global variables. S404. If a time series operation is performed, the handle contains the corresponding time information.S405. The __getitem__() function of the time series parameter in the handle is overloaded so that the corresponding numerical parameter can be obtained according to the corresponding time at each time point. The method includes but is not limited to the time series data analysis work in the industrial and financial fields. The analysis results of the method are visualized, and the user can intuitively monitor whether the landing load exceeds the threshold related events. Example

[0041] See also Figure 1 , a Python-based time series data analysis method, comprising the following steps:

[0042] Step 1: Configure the aircraft air-ground status parameters.

[0043] Step 101: Create a new parameter and name it: _LDG_STATUS.

[0044] Step 102: After analysis, the parameter represents the landing gear touchdown status in the entire time series data, so the parameter calculation mode should be configured as the time series mode, and the output data type should be configured as feature data.

[0045] Step 103: Three parameters are introduced, namely _LDG_N representing whether the front landing gear is touching the ground, _LDG_L representing whether the left landing gear is touching the ground, and _LDG_R representing whether the right landing gear is touching the ground.

[0046] Step 104: Configure the calculation frequency of the parameter to be 8 Hz.

[0047] Step 105: Configure the interpolation algorithm to the nearest valid value.

[0048] Step 2: Write the aircraft air-ground state parameters.

[0049] Step 201: Write the calculation logic of the aircraft air-ground state parameters. The specific calculation logic is:

[0050] if G0_LDG_L[0]==1 and G0_LDG_R[0]==1 G0_LDG_N[0]==1:

[0051] return "GND"

[0052] else :

[0053] return "NOT ON GND"

[0054] The operation logic of this parameter indicates that at the current moment, if each landing gear is in the ground state, the aircraft is on the ground. If any landing gear is not in the ground state, the aircraft is not on the ground. Since this parameter is configured as a time series calculation mode, the system will automatically perform a loop calculation on it to generate time series data. G is a handle, and all introduced or calculated parameters will be stored in the handle.

[0055] Step 202: Save the parameter.

[0056] Step 3: Configure aircraft landing load parameters.

[0057] Step 301: Create a new parameter and name it: _LANDING_LOAD.

[0058] Step 302: After analysis, the parameter represents the landing load at the moment of touchdown, so the data calculation mode should be configured as the timing mode, and the output data type should be configured as feature data.

[0059] Step 303: Import the previously configured _LDG_STATUS parameter and the aircraft's vertical load parameter VRTG.

[0060] Step 304: configure the calculation frequency of the parameter to be 8 Hz.

[0061] Step 305: Configure the interpolation algorithm to the nearest valid value.

[0062] Step 4: Program the aircraft landing load parameters.

[0063] Step 401: Write the calculation logic of the aircraft landing load parameter. The specific calculation logic is:

[0064] if G0_LDG_STATUS[-00125]!=”GND” and if G0_LDG_STATUS[0]==”GND”:

[0065] return G0VRTG[0]

[0066] The meaning of this logic is: if the aircraft landing gear is not fully touched in the previous 00125 seconds, and is fully touched at the current moment, then the landing load data at the current moment is obtained. Since this language overloads the __getitem__() function of the array, the displacement time seconds can be directly input as the relative moment of the current time, and the corresponding data at that moment can be obtained.

[0067] Step 402: Save the parameter.

[0068] Step 5: Configure aircraft landing load status monitoring parameters.

[0069] Step 501: Create a new parameter and name it: _LOAD_WARNING.

[0070] Step 502: After analysis, the parameter represents the classification of the aircraft landing load data, the input data is a single feature data, and the output data is also a single feature data, so the parameter calculation mode should be configured as the normal mode, and the output data type is automatically configured as the feature data.

[0071] Step 503: Import the _LANDING_LOAD parameter written previously.

[0072] Step 6: Program the aircraft landing load status monitoring parameters.

[0073] Step 601: Write the calculation logic of the aircraft air-ground state parameters. The specific calculation logic is:

[0074] if G0 _LANDING_LOAD>=108:

[0075] return "3 LEVEL WARNING"

[0076] elif G0 _LANDING_LOAD>=106:

[0077] return "2 LEVEL WARNING"

[0078] The operation logic of this parameter indicates that: if the landing load is less than 106, no warning information is output; if the landing load is greater than or equal to 106 and less than 108, a level 2 warning information is output; if the landing load is greater than or equal to 108, a level 3 warning information is output.

[0079] Step 602: Save the parameter.

[0080] Finally, based on the calculated data results, visualization is performed, and users can intuitively monitor whether the landing load exceeds the threshold related events.

[0081] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A Python-based time series data analysis method, characterized in that: The following steps are involved: S1. Expand based on Python language to adapt to time series data; S2, the language is adapted to different time series data frequencies; S3. The language can flexibly select the input and output data types; S4. Time series data or feature values ​​can be referenced to each other to build a data analysis system; According to the steps in S1, S101, establishing an interactive interface in a required application so that a user can call the language to perform data analysis operations; S102: For time series data, a calculation mode can be selected on the interactive interface, and the calculation mode includes a normal mode and a time series mode; S103, for the normal mode, the time series data input by the user will be converted into a corresponding two-dimensional array according to its corresponding frequency; S104. For the time series mode, the script input by the user will be regarded as a calculation operation executed at each moment, and the system will automatically traverse all calculation points for calculation.

2. According to the Python-based time series data analysis method of claim 1, it is characterized in that: The method comprises the following steps: according to the operation steps in S2, S201. When performing time series data operations, the system provides a function of selecting data frequency, and the user can define the frequency of the operation; S202, according to the selected frequency, the system will automatically generate operation points according to the length of the time series data; S203, if the selected frequency is higher than the frequency of the time series data, the system will perform interpolation processing on the input time series data; S204: If the selected frequency is lower than the frequency of the time series data, the system will perform frequency reduction processing on the input time series data.

3. The Python-based time series data analysis method according to claim 2, characterized in that: The following steps are involved: According to the operation steps in S203, in the interpolation process, the user can arbitrarily select an interpolation algorithm, and the optional interpolation algorithms include using the most recent effective value, linear smoothing, MACD smoothing and other interpolation algorithms.

4. The Python-based time series data analysis method according to claim 3, characterized in that: The following steps are involved: According to the operation steps in S203, the most recent effective value is the effective value of a quantity most recently measured or calculated within a given time window, and the linear smoothing is a data smoothing technology used to reduce random fluctuations or noise in data so as to more clearly display the trend or periodicity of the data.

5. The Python-based time series data analysis method according to claim 3, characterized in that: The following steps are involved: According to the operation steps in S203, the MACD smoothing refers to the process of obtaining the difference average value DEA by further smoothing the difference DIFF between the fast moving average EMA1 and the slow moving average EMA2 when using the MACD indicator, and the multiple interpolation algorithms are used to estimate the value of unknown data points through known discrete data points.

6. The Python-based time series data analysis method according to claim 1, characterized in that: The following steps are involved: According to the operation steps in S3, S301. During use, the user needs to define the input data type as time series data or feature data; S302. When in use, the user needs to define the output data type as time series data or feature data; S303, if the time series mode is selected when the calculation mode is selected in S102, the output data may be time series data or feature data; S304: If the normal mode is selected when the calculation mode is selected in S102, the output data can only be feature data.

7. The Python-based time series data analysis method according to claim 1, characterized in that: The following steps are involved: According to the operation steps in S4, S401, before entering into the time series data calculation, generate a globally effective handle G; S402, during calculation, all reference parameters are introduced into the handle for access; S403, the user can store the custom parameters in the handle, which functions as a global variable; S404: If a time series operation is performed, the handle contains corresponding time information; S405. The __getitem__() function of the timing parameter in the handle is overloaded so that the corresponding numerical parameter can be obtained according to the corresponding time at each time point.

8. The Python-based time series data analysis method according to claim 1, characterized in that: The following steps are involved: According to the operation steps in S1, the method includes time series data analysis work in the industrial and financial fields.

9. The Python-based time series data analysis method according to claim 1, characterized in that: The following steps are involved: According to the operation steps in S4, the results of the analysis by the method are visualized, and the user can intuitively monitor whether the landing load exceeds the threshold related events.