Time sequence data processing method and device, electronic equipment and storage medium
By periodically obtaining industrial timing data and building a processing script containing input parameters and state variables, the existing DSL scripts are solved by inefficient and waste of resources when processing timing data, and achieving more efficient and flexible data processing capabilities.
Patent Information
- Application Number
- CN202510150905.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-30
AI Technical Summary
Existing DSL scripts are inefficient in processing timing data, have severe resource waste, and are difficult to support complex logic and long-running data processing tasks, especially when state persistence is required.
By periodically obtaining industrial timing data, a timing data processing script is constructed based on industrial scenarios. The script includes at least input parameters and status variables, and updates the status variables, including normal values and outliers according to the data identification. When the status variable is an outlier and the duration exceeds the preset, the warning process is performed.
It improves the efficiency of time-series data processing, reduces resource waste, simplifies script design, enhances support for complex logic and long-term running tasks, and achieves more efficient and flexible data processing capabilities.
Smart Images

Figure CN120066682A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly relates to a method, apparatus, electronic device, and storage medium for processing time-series data. Background Art
[0002] In the field of data processing, especially in time-series data analysis, domain-specific languages (DSLs) have been widely used to improve the efficiency and accuracy of data processing. First, current DSL scripts need to rely on external caching or storage systems to track and store state information, which not only increases the complexity of the system but may also lead to performance bottlenecks; in addition, the reliance on external caching also increases the coupling degree of the system, making maintenance and expansion more difficult; second, current DSL scripts are less efficient in processing continuous time-series data streams and must start processing from scratch every time a new data point is received, resulting in repeated calculations and resource waste.
[0003] In addition, current DSL scripts limit the implementation of complex logic and long-running data processing tasks. In these scenarios, the system needs to be able to track and respond to patterns and trends that change over time, while current DSL scripts cannot effectively support such requirements. Therefore, DSL scripts in related technologies show obvious limitations in processing complex time-series data that requires state persistence. Summary of the Invention
[0004] In view of the above-mentioned disadvantages of related technologies, this application provides a method, apparatus, electronic device, and storage medium for processing time-series data to solve the technical problems of low processing efficiency and resource waste in related time-series processing methods.
[0005] This application provides a method for processing time-series data. The method for processing time-series data includes: periodically obtaining industrial time-series data, where the industrial time-series data includes data time-series information, data content information, and data identifiers; constructing a time-series data processing script based on the industrial scenario corresponding to the industrial time-series data, where the time-series data processing script includes at least input parameters and state variables; using the industrial time-series data as the input parameters according to the data identifiers, and the state variables are periodically updated based on the changes in the input parameters, where the state variables include normal values and abnormal values; when the state variable is an abnormal value and the duration exceeds a preset duration, warning processing is performed on the industrial time-series data.
[0006] In an embodiment of the present application, when the state variable is an outlier and the duration exceeds a preset duration, the early warning process for the industrial time-series data includes: when the state variable changes from the normal value to the outlier, recording the data time-series information corresponding to the latest input parameter as the abnormal start time; if the state variable remains an outlier and the difference between the abnormal start time and the current time is greater than the preset duration, performing an early warning process on the industrial time-series data.
[0007] In an embodiment of the present application, using the industrial time-series data as the input parameter according to the data identifier includes: inputting the industrial time-series data into a script execution engine, where the script execution engine is used to run the time-series data processing script; the script execution engine compiles the time-series data processing script to obtain the mapping relationship between the data identifier of the industrial time-series data and the input parameter; the script execution engine distributes the industrial time-series data to the time-series data processing script as the input parameter for processing according to the mapping relationship between the data identifier of the industrial time-series data and the input parameter.
[0008] In an embodiment of the present application, the script execution engine includes a plurality of time-series data processing scripts; the script execution engine compiles the plurality of time-series data processing scripts to obtain a mapping table between the data identifier of the industrial time-series data and the input parameters of the plurality of time-series data processing scripts; the script execution engine distributes the industrial time-series data to each time-series data processing script according to the mapping table.
[0009] In an embodiment of the present application, the periodic update of the state variable based on the change of the input parameter includes: if the state variable is a normal value and the data content information of the input parameter meets the preset normal condition, keeping the state variable as the normal value; if the state variable is a normal value and the data content information of the input parameter does not meet the preset normal condition, updating the state variable to an outlier and using the data time-series information of the input parameter as the abnormal start time; if the state variable is an outlier and the data content information of the input parameter meets the preset normal condition, updating the state variable to a normal value and setting the abnormal start time to empty; if the state variable is an outlier and the data content information of the input parameter does not meet the preset normal condition, keeping the state variable as the outlier.
[0010] In an embodiment of the present application, if the industrial scenario is an equipment high-temperature warning scenario, the time-series data processing method includes: periodically obtaining the industrial time-series data, where the industrial time-series data at least includes equipment temperature data, and the data content information of the equipment temperature data includes an equipment temperature value, and using the equipment temperature data as an input parameter of a temperature time-series data processing script; if the equipment temperature value is lower than a preset temperature threshold, updating the status variable to a normal value; if the equipment temperature value is higher than the preset temperature threshold, updating the status variable to an abnormal value; when the status variable is an abnormal value and the duration exceeds a preset duration, an equipment high-temperature warning is issued.
[0011] In an embodiment of the present application, issuing an equipment high-temperature warning includes: storing the equipment temperature data with the status variable being an abnormal value, and sending a high-temperature warning message.
[0012] An embodiment of the present application further provides a time-series data processing device, where the time-series data processing device includes: an information input module, configured to periodically obtain industrial time-series data, where the industrial time-series data includes data time-series information, data content information, and a data identifier; a script construction module, configured to construct a time-series data processing script based on the industrial scenario corresponding to the industrial time-series data, where the time-series data processing script at least includes an input parameter and a status variable; a parameter input module, configured to use the industrial time-series data as the input parameter according to the data identifier, and the status variable is periodically updated based on the change of the input parameter, and the status variable includes a normal value and an abnormal value; an abnormal warning module, configured to perform warning processing on the industrial time-series data when the status variable is an abnormal value and the duration exceeds a preset duration.
[0013] An embodiment of the present application further provides an electronic device, where the electronic device includes: one or more processors; a storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the time-series data processing method according to any one of the above embodiments.
[0014] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor of a computer, the computer executes the time-series data processing method according to any one of the above embodiments.
[0015] Advantages of the present application: The present application provides a method, apparatus, electronic device, and storage medium for processing time-series data. The method periodically obtains industrial time-series data, constructs a time-series data processing script based on the industrial scenario corresponding to the industrial time-series data. The time-series data processing script includes at least input parameters and state variables. The industrial time-series data is used as input parameters according to the data identifier, and the state variables are periodically updated based on the change of the input parameters. The state variables include normal values and abnormal values. When the state variable is an abnormal value and the duration exceeds a preset duration, early warning processing is performed on the industrial time-series data. Based on the time-series data processing logic of the present application, only the operations of data and the assignment of state variables need to be concerned, without considering the use of other state caching components, so as to provide more efficient and flexible data processing capabilities with a shorter script, thereby improving the processing efficiency and reducing the processing cost.
[0016] It should be understood that the above general description and subsequent detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a schematic diagram of an implementation environment of a method for processing time-series data shown in an exemplary embodiment of the present application;
[0018] Figure 2 is a flowchart of a method for processing time-series data shown in an exemplary embodiment of the present application;
[0019] Figure 3 is a flowchart of a stateful DSL for processing time-series data shown in an exemplary embodiment of the present application;
[0020] Figure 4 is a block diagram of an apparatus for processing time-series data shown in an exemplary embodiment of the present application;
[0021] Figure 5 is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] The following uses specific specific examples to illustrate the implementation manners of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0023] It should be noted that the illustrations provided in the following embodiments only schematically illustrate the basic concept of the present application. Therefore, only the components related to the present application are shown in the drawings, rather than being drawn according to the number, shape, and size of the components in actual implementation. The types, quantities, and proportions of the components in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0024] It should be noted that in the present application, "first", "second", etc. are only used to distinguish similar objects, and are not intended to limit the order or sequence of similar objects. The described variations such as "including" and "having" indicate that the scope covered by the subject of the word is not exclusive except for the examples shown by the word.
[0025] It can be understood that the various numerical numbers, step numbers, etc. recorded in the present application are for the convenience of description and are not used to limit the scope of the present application. The size of the reference numbers in the present application does not mean the order of execution. The execution order of each process should be determined by its function and internal logic.
[0026] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0027] Embodiments of the present application respectively propose a method for processing time series data, a device for processing time series data, an electronic device, a computer-readable storage medium, and a computer program product. The following will describe these embodiments in detail.
[0028] Please refer to Figure 1 , Figure 1 which is a schematic diagram of the implementation environment of a method for processing time series data shown in an exemplary embodiment of the present application.
[0029] As Figure 1 shown, the implementation environment may include a data acquisition device 101 and a computer device 102. The computer device 102 may be at least one of a microcomputer, an embedded computer, a neural network computer, etc. The data acquisition device 101 may be a sensor in an industrial scenario, such as a temperature sensor, a pressure sensor, etc., for real-time acquisition of industrial time series data and sending the industrial time series data to the computer device 102 for time series data processing.
[0030] Please refer to Figure 2 , Figure 2The flowchart of a method for processing time - series data shown in an exemplary embodiment of the present application. This method can be applied to Figure 1 the implementation environment shown. This method can also be applicable to other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment applicable to this method.
[0031] As Figure 2 shown, in an exemplary embodiment, the method for processing time - series data at least includes steps S210 to S240, which are introduced in detail as follows:
[0032] Step S210: Periodically obtain industrial time - series data. The industrial time - series data includes data time - series information, data content information, and data identifiers.
[0033] In an embodiment of the present application, to obtain industrial time - series data, access the industrial time - series data stream through a network interface. These data can come from various sensors, devices, or systems and can be generated in real - time or processed in batches. The industrial time - series data at least includes: time - series data ID (data identifier), data value (data content information), data time (data time - series information). The data value supports multiple types: Null, Bool, Long, Double, String, JSON.
[0034] Exemplarily, transmit the data collected by a temperature sensor through a message queue. A certain piece of data may be {time - series data ID: 0001, data value: Double(1500), data time: ’2024 - 10 - 01 08:00:00’}
[0035] Step S220: Based on the industrial time - series data, construct a time - series data processing script for the industrial scenario. The time - series data processing script at least includes input parameters and state variables.
[0036] In an embodiment of the present application, write and debug an SDSL script as the time - series data processing script. The SDSL script at least includes: input parameters, return statements. The input parameters are the bound industrial time - series data. The input parameters have the same syntax as variables and are directly used in the script in a form similar to variables. The return statement is an expression that does not end with a semicolon. The expression includes a combination of one or more of the following statements: input parameters, state variables, constants, unary operation expressions, binary operation expressions, functions.
[0037] Exemplarily, the SDSL script includes the use of state variables. For example, each time the script runs, if the calculation is based on the previous calculation result, then store the previous calculation result in the state variable.
[0038] Exemplarily, the SDSL script includes an input parameter time acquisition function: It can acquire the current value time and the previous value time of the input parameter, for example, to judge the change rule of the input parameter over time; arithmetic, logical, and conditional branch operations: The time is converted into a numerical value for participation in operations. For example, calculate the time difference when the data changes, and judge the duration for which the data remains a certain value; calculation result control function: In addition to outputting the calculation result value, the timestamp of the calculation result can also be set. For example, when a certain input parameter becomes value v at time t and lasts for 5s, to obtain time t, the time t stored in the state variable needs to be set as the timestamp of the result; system time-related functions: Obtain the current system time. For example, it is necessary to judge the change of data within the current system time period. Verify the correctness of the script according to whether the debugging result is accurate, and analyze the execution result after each data input and the value of the state variable according to the debugging log.
[0039] Step S230, use the industrial time series data as input parameters according to the data identifier, and the state variable is periodically updated based on the change of the input parameter. The state variable includes a normal value and an abnormal value.
[0040] In an embodiment of the present application, using the industrial time series data as input parameters according to the data identifier includes: inputting the industrial time series data into a script execution engine, and the script execution engine is used to run a time series data processing script; the script execution engine compiles the time series data processing script to obtain the mapping relationship between the data identifier of the industrial time series data and the input parameters; the script execution engine distributes the industrial time series data to the time series data processing script as input parameters for processing according to the mapping relationship between the data identifier of the industrial time series data and the input parameters.
[0041] In an embodiment of the present application, the script execution engine includes multiple time series data processing scripts; the script execution engine compiles the multiple time series data processing scripts to obtain a mapping table between the data identifier of the industrial time series data and the input parameters of the multiple time series data processing scripts; the script execution engine distributes the industrial time series data to each time series data processing script according to the mapping table.
[0042] Exemplarily, parse and extract all the input parameters in the script, and construct the mapping from the industrial time series data ID (data identifier) to the SDSL script and the mapping from the industrial time series data ID to the input parameter name in an SDSL script through the industrial time series data bound to each input parameter name to determine the time series data that will trigger script calculation; after compilation, obtain executable binary code.
[0043] Exemplarily, register input parameter mappings and executable code to the SDSL execution engine. The functions of the SDSL execution engine include: managing multiple SDSL script execution units and the mappings of input parameters to different SDSL script execution units. The SDSL execution engine manages multiple SDSL scripts. First, add the mapping from industrial timing data IDs to SDSL scripts to the many-to-many total mapping of the SDSL execution engine for filtering all used industrial timing data. Then, the SDSL execution engine constructs SDSL script execution units according to the executable code of the SDSL scripts and the mapping from industrial timing data in the scripts to input parameter names, and initializes the caches for the latest values and previous values of the input parameters.
[0044] Exemplarily, distribute industrial timing data to SDSL script execution units according to the mappings. The SDSL execution engine distributes each piece of data to one or more SDSL script execution units that use the timing data point through the mapping from timing data IDs to SDSL scripts. The SDSL script execution units then store the data in the latest values of the input parameters according to the mapping from timing data point IDs to input parameter names and trigger the execution of the scripts.
[0045] Exemplarily, the SDSL script execution units process data in a streaming manner and push the results. The SDSL scripts are triggered to execute by each piece of data, that is, process data in a streaming manner. After execution, if the script has a return value, the return value is asynchronously pushed through the network interface and then wait for the next piece of data.
[0046] In an embodiment of the present application, the periodic update of the state variable based on the change of the input parameter includes: if the state variable is a normal value and the data content information of the input parameter meets the preset normal condition, then keep the state variable as the normal value; if the state variable is a normal value and the data content information of the input parameter does not meet the preset normal condition, then update the state variable to an abnormal value and use the data timing information of the input parameter as the abnormal start time; if the state variable is an abnormal value and the data content information of the input parameter meets the preset normal condition, then update the state variable to a normal value and set the abnormal start time to empty; if the state variable is an abnormal value and the data content information of the input parameter does not meet the preset normal condition, then keep the state variable as the abnormal value.
[0047] Step S240, when the state variable is an abnormal value and the duration exceeds the preset duration, perform a warning process on the industrial timing data.
[0048] In an embodiment of the present application, when the state variable is an outlier and the duration exceeds a preset duration, the early warning processing of industrial time series data includes: when the state variable changes from a normal value to an outlier, the data time series information corresponding to the latest input parameter is recorded as the abnormal start time; if the state variable remains an outlier and the difference between the abnormal start time and the current time is greater than the preset duration, the early warning processing of industrial time series data is performed.
[0049] In an embodiment of the present application, if the industrial scenario is an equipment high temperature warning scenario, the time series data processing method includes: periodically obtaining industrial time series data, the industrial time series data at least includes equipment temperature data, the data content information of the equipment temperature data includes the equipment temperature value, and the equipment temperature data is used as the input parameter of the temperature time series data processing script; if the equipment temperature value is lower than the preset temperature threshold, the state variable is updated to a normal value; if the equipment temperature value is higher than the preset temperature threshold, the state variable is updated to an outlier; when the state variable is an outlier and the duration exceeds the preset duration, an equipment high temperature warning is issued.
[0050] Exemplarily, when the temperature of a certain device exceeds 1500 for 3 consecutive seconds, the latest temperature value is output for subsequent generation of a warning signal. The time-series data processing steps are as follows: Define input parameters and status variables: In the script, use the input parameter name temp to represent the temperature value, use the time acquisition function time(temp) to obtain the device acquisition time of the current temperature value, and define a status variable start_time to store the device acquisition time (abnormal value) when the temperature value is greater than 1500 for the first time. The initial value of the status variable is null (normal value); Update the status variable start_time according to the temperature value: Determine whether the temperature value temp is greater than 1500: If temp is greater than 1500: Then determine whether start_time is null (normal value): If start_time is not null: It means that the temperature value before the current device acquisition time is greater than 1500, and start_time has already recorded the time when the temperature is greater than 1500 for the first time. At this time, do not update the value of start_time; If start_time is null: It means that the temperature value before the current device acquisition time is less than or equal to 1500. At this time, the device acquisition time time(temp) is stored in start_time; If temp is less than or equal to 1500: Reset start_time to null (normal value); Determine the duration: Determine whether temp(time) minus start_time is greater than or equal to 3 seconds. If so, the temperature warning condition is reached, and the script returns the current temperature value. If the acquisition frequency of the temperature value is 1 piece / second, then one piece of data triggers the execution of the above SDSL script every second. When executed, temp and time(temp) are the temperature value and device acquisition time of the latest piece of data, and the value of start_time still retains the state after the previous piece of data triggers the execution. In summary, the device temperature too high warning scenario can be completed.
[0051] Exemplarily, the data identification ID of the device temperature data is 0001, and the SDSL script ID is S0001. Analyzing the SDSL script content includes: detecting the script syntax, data type verification; extracting the input parameter temp, and constructing a mapping relationship from the data identification ID to the input parameter name: 0001->temp; constructing a mapping relationship from the device temperature data ID to the SDSL script: 0001->S0001; generating executable code after compiling the script.
[0052] Exemplarily, script S0001 is registered into the execution engine, and the mapping of 0001->S0001 is added to the [Time Series Data ID, SDSL Script Execution Unit] mapping table of the SDSL execution engine for the execution engine to distribute data to the execution unit; registering the script generates an SDSL script execution unit, and the mapping relationship of 0001->temp is registered into the [Data Identification ID, Input Parameter Name] mapping table of the script execution unit for the script execution unit to distribute data to specific input parameters.
[0053] Exemplarily, after the SDSL execution engine receives the previous example data, it first finds the script execution unit(s) that use this data identification ID from the [Data Identification ID, SDSL Script Execution Unit] mapping table, and distributes the time series data to each found script execution unit. When each execution unit receives the data, it then deposits the data into the corresponding input parameter according to the internal [Data Identification ID, Input Parameter Name] mapping table, and then starts to execute the script.
[0054] In one embodiment of the present application, device high-temperature warning includes: storing device temperature data with an abnormal value of the status variable and sending a high-temperature warning message.
[0055] Please refer to Figure 3 , Figure 3 is a flowchart of stateful DSL processing time series data shown in an exemplary embodiment of the present application. According to Figure 3 shown, a stateful domain-specific language (SDSL) is defined, and scripts are written based on this SDSL to describe time series data processing rules and logic; write and debug SDSL scripts; parse and compile SDSL scripts, and register the mapping of industrial time series data parameters to SDSL scripts and the compiled executable code into the SDSL execution engine; receive time series data streams and input them into the SDSL execution engine; the SDSL execution engine distributes data to the SDSL script execution unit according to the mapping relationship between time series data points and SDSL scripts, and parses and processes industrial time series data therein; push the processing results to subsequent processes, such as data storage, alarm triggering, or further data analysis; continue to process subsequent data of the data stream based on the current state of the SDSL script; the present invention overcomes the limitations of stateless DSL in the implementation of complex logic and long-running data processing tasks, and based on this SDSL, more efficient and flexible data processing capabilities can be provided using shorter scripts.
[0056] Please refer to Figure 4 , Figure 4 is a block diagram of a time series data processing device shown in an exemplary embodiment of the present application. This device can be applied to Figure 1The illustrated implementation environment, the device can also be applicable to other exemplary implementation environments and be specifically configured in other devices. This embodiment does not limit the implementation environment applicable to the device.
[0057] As Figure 4 shown, the exemplary timing data processing device includes:
[0058] An information input module 401, configured to periodically obtain industrial timing data, where the industrial timing data includes data timing information, data content information, and data identifiers;
[0059] A script construction module 402, configured to construct a timing data processing script based on the industrial scenario corresponding to the industrial timing data, where the timing data processing script includes at least input parameters and status variables;
[0060] A parameter input module 403, configured to use the industrial timing data as input parameters according to the data identifiers, and the status variables are periodically updated based on the changes of the input parameters. The status variables include normal values and abnormal values;
[0061] An anomaly warning module 404, configured to perform a warning process on the industrial timing data when the status variable is an abnormal value and the duration exceeds a preset duration.
[0062] Figure 5 The figure shows a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application. It should be noted that Figure 5 The shown computer system 500 of the electronic device is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0063] As Figure 5 shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage section 508 into the random access memory (RAM) 503, such as executing the methods described in the above embodiments. In the RAM 503, various programs and data required for system operations are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other through a bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0064] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.
[0065] Specifically, according to an embodiment of the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 509, and / or installed from the removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the system of the present application are executed.
[0066] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0067] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0068] The units involved in the embodiments described in this application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation on the units themselves in some cases.
[0069] Another aspect of this application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer is caused to execute the time-series data processing method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist alone without being assembled into the electronic device.
[0070] Another aspect of this application also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the time-series data processing methods provided in the above various embodiments.
[0071] The above embodiments are only used to exemplarily illustrate the principles and effects of this application, rather than to limit this application. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical idea disclosed in this application should still be covered by the claims of this application.
Claims
1. A time series data processing method, characterized in that: The time series data processing method comprises: Periodically acquiring industrial time series data, wherein the industrial time series data includes data time series information, data content information, and data identification; Building a time series data processing script based on the industrial scenario corresponding to the industrial time series data, wherein the time series data processing script includes at least input parameters and state variables; According to the data identifier, the industrial time series data is used as the input parameter, and the state variable is periodically updated based on the change of the input parameter, and the state variable includes a normal value and an abnormal value; When the state variable is an abnormal value and the duration exceeds a preset duration, early warning processing is performed on the industrial time series data.
2. The time series data processing method according to claim 1, characterized in that: When the state variable is an abnormal value and the duration exceeds a preset duration, the early warning processing of the industrial time series data includes: When the state variable changes from the normal value to the abnormal value, the data timing information corresponding to the latest input parameter is recorded as the abnormal start time; If the state variable continues to be an abnormal value and the difference between the abnormal start time and the current time is greater than a preset duration, early warning processing is performed on the industrial time series data.
3. The time series data processing method according to claim 1, characterized in that: Taking the industrial time series data as the input parameter according to the data identifier includes: Inputting the industrial time series data into a script execution engine, wherein the script execution engine is used to run the time series data processing script; The script execution engine compiles the time series data processing script to obtain a mapping relationship between the data identifier of the industrial time series data and the input parameter; The script execution engine distributes the industrial time series data to the time series data processing script as the input parameter for processing according to the mapping relationship between the data identifier of the industrial time series data and the input parameter.
4. The time series data processing method according to claim 3, characterized in that: The script execution engine includes a plurality of time series data processing scripts; The script execution engine compiles the multiple time series data processing scripts to obtain a mapping table between the data identifier of the industrial time series data and the input parameters of the multiple time series data processing scripts; The script execution engine distributes the industrial time series data to each time series data processing script according to the mapping table.
5. The time series data processing method according to claim 1, characterized in that: The state variable is periodically updated based on the change of the input parameter, including: If the state variable is a normal value, and the data content information of the input parameter meets the preset normal condition, the state variable is maintained at a normal value; If the state variable is a normal value, and the data content information of the input parameter does not meet the preset normal condition, the state variable is updated to an abnormal value, and the data timing information of the input parameter is used as the abnormal start time; If the state variable is an abnormal value, and the data content information of the input parameter meets the preset normal condition, the state variable is updated to a normal value, and the abnormal start time is set to blank; If the state variable is an abnormal value and the data content information of the input parameter does not meet the preset normal condition, the state variable is maintained as the abnormal value.
6. The time series data processing method according to any one of claims 1 to 5, characterized in that: If the industrial scenario is a high temperature warning scenario for equipment, the time series data processing method includes: Periodically acquiring the industrial time series data, wherein the industrial time series data at least includes device temperature data, wherein the data content information of the device temperature data includes a device temperature value, and using the device temperature data as an input parameter of a temperature time series data processing script; If the device temperature value is lower than a preset temperature threshold, updating the state variable to a normal value; If the device temperature value is higher than the preset temperature threshold, updating the state variable to an abnormal value; When the state variable is an abnormal value and the duration exceeds a preset duration, a high temperature warning for the equipment is issued.
7. The time series data processing method according to claim 6, characterized in that: Equipment high temperature warning includes: The device temperature data for which the state variable is an abnormal value is stored, and high temperature warning information is sent.
8. A time series data processing device, characterized in that: The time series data processing device comprises: An information input module, used for periodically acquiring industrial time series data, wherein the industrial time series data includes data time series information, data content information and data identification; A script construction module, used to construct a time series data processing script based on the industrial scenario corresponding to the industrial time series data, wherein the time series data processing script includes at least input parameters and state variables; A parameter input module, used to use the industrial time series data as the input parameter according to the data identifier, and the state variable is periodically updated based on the change of the input parameter, and the state variable includes a normal value and an abnormal value; The abnormal warning module is used to perform early warning processing on the industrial time series data when the state variable is an abnormal value and the duration exceeds a preset duration.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the time series data processing method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the time series data processing method as described in any one of claims 1 to 7.