Data processing method and device, equipment and storage medium
By dividing time windows in the power and industrial Internet of Things (IoT) to dynamically update the status values of measuring points and uniformly synchronize data calculation, the problem of calculation deviation caused by asynchronous arrival of data from multiple measuring points is solved, thereby improving the accuracy of data processing results and the reliability of status monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CSGES OPERATION MANAGEMENT BRANCH CO
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-21
AI Technical Summary
In the fields of power and industrial IoT, inconsistent arrival times of data from multiple measurement points lead to inaccurate data processing results, affecting the reliability of condition monitoring.
By dividing the time into consecutive time windows, the latest status values of each measuring point are dynamically updated within the window, and the synchronized data of all measuring points are retrieved at the end of the window for rule calculation to ensure data synchronization.
It improves the accuracy of data processing results and the reliability of status monitoring, avoids misjudgments caused by asynchronous data arrival, and enhances the accuracy of fault warning and status assessment.
Smart Images

Figure CN121901281A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more particularly to data processing methods, apparatus, devices, and storage media. Background Technology
[0002] In fields such as power and the Industrial Internet of Things (IIoT), which involve the monitoring of a large number of devices, massive amounts of sensor data are continuously generated. Real-time analysis and monitoring of this data to achieve fault early warning and condition assessment are crucial to ensuring the safe and stable operation of the system.
[0003] In existing technologies, predefined logical rules are typically dynamically associated and calculated with continuously arriving real-time data streams. In this case, the stream processing task responds to the arrival of real-time data by immediately associating the rules applicable to the current data item and triggering the corresponding processing logic to output the result.
[0004] However, when the calculation of a rule involves multiple measuring points, the arrival time of the data at each measuring point may differ. In this case, if the data arriving at different times are used for calculation, the data processing results may be inaccurate, affecting the reliability of the status monitoring. Summary of the Invention
[0005] This application provides a data processing method, apparatus, device, and storage medium to improve the accuracy of data processing results, thereby improving the reliability of status monitoring.
[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions: Firstly, a data processing method is provided, the method comprising: The first device acquires data items from multiple measurement points associated with the target rule identifier in chronological order. The target rule identifier is associated with multiple measurement points, and each data item includes the target rule identifier associated with the data item, the measurement point identifier, the corresponding data content, and the timestamp. The first device divides the time window into multiple consecutive windows based on a preset window duration; For each data item, the first device determines the time window to which the data item belongs based on the timestamp, and updates the current status value of the corresponding measuring point within the time window to the data content corresponding to the data item. The first device responds to the end event of the target time window, obtains the current status value of each measurement point associated with the target rule identifier within the target time window, and uses the current status value of each measurement point as the target value of the measurement point. The first device acquires the processing strategy corresponding to the target rule identifier, and processes the target values corresponding to multiple measurement points according to the processing strategy to determine the operating status judgment result of at least one measurement point; wherein, the processing strategy defines the processing rules between the target values corresponding to multiple measurement points.
[0007] In this embodiment, firstly, the measurement point data items associated with the target rule are obtained sequentially, providing a structured multi-measurement point input basis for subsequent calculations. Next, continuous time windows are divided based on a preset window duration, providing a unified time aggregation framework for the data. Then, the window to which the data item belongs is determined based on its timestamp, and the current state value of the corresponding measurement point is updated to the latest data, ensuring that each measurement point always retains the latest state within the window. At the end of the target time window, the latest state values of all associated measurement points are uniformly obtained as the target value, achieving synchronization of multi-measurement point data at the calculation time. Finally, the synchronized target value is calculated based on the processing strategy corresponding to the rule to obtain the running status judgment result, thereby avoiding misjudgments caused by asynchronous data arrival and improving the reliability of the monitoring results.
[0008] In one possible implementation of the first aspect, the first device determines the time window to which the data item belongs based on the timestamp, and updates the current status value of the corresponding measuring point within the time window to the data content corresponding to the data item, including: The first device maps the timestamp to the corresponding time window and determines the time window to which the data item belongs; The first device uses a combination of target rule identifier, measurement point identifier, and time window as the key to write data content into the position corresponding to the key in the state memory; wherein, the state memory is a distributed state memory based on key-value pairs; when data content already exists at the position, the newly written data content overwrites the original data content; after writing or overwriting, the current state value corresponding to the key is the data content of the corresponding measurement point within the time window; In response to the end event of the target time window, the first device obtains the current status value of each measurement point associated with the target rule identifier within the target time window, including: In response to the end event of the target time window, the first device reads the current state value corresponding to each measurement point from the state memory according to the target rule identifier, the measurement point identifier, and the target time window.
[0009] Based on the aforementioned technical content, this embodiment combines "target rule identifier, measurement point identifier, and time window" as a key, writes the data content into a key-value pair state storage, and overwrites the old value when new data arrives. This achieves accurate maintenance and rapid access to the latest data of each measurement point within each time window. On the one hand, it ensures that each measurement point retains only the latest state value within each window, avoiding interference from historical old data in the calculation; on the other hand, the distributed state storage supports high-concurrency read and write, meeting the performance requirements of real-time stream processing scenarios. At the end of the window, the latest state value of each measurement point is directly read according to the key, without the need for traversal or filtering, improving data acquisition efficiency and calculation real-time performance, and laying a data foundation for accurate state determination.
[0010] In one possible implementation of the first aspect, multiple measuring points are of the same type. The first device processes the target values corresponding to multiple measuring points according to the processing strategy, and determines the operating status judgment result of at least one measuring point, including: The first device determines the average value of multiple target values, and for at least one of the multiple measuring points, determines the difference between the target value corresponding to the measuring point and the average value; If the difference is greater than the preset threshold, the first device determines that the state corresponding to the measuring point is an out-of-limit state; if the difference is less than or equal to the preset threshold, the first device determines that the corresponding state is a normal state. After the first device determines the operating status of at least one measuring point, the method further includes: If the running status determination result is an out-of-limit status, the first device will publish the out-of-limit status determination result to the message queue, and the out-of-limit status determination result will be used to trigger an alarm.
[0011] Here, for monitoring scenarios with similar measuring points, this embodiment calculates the average of multiple target values and compares the difference between each measuring point's target value and the average value to see if it exceeds the threshold, thereby achieving anomaly detection based on group data trends: the average value reflects the overall operating level of similar measuring points, and the deviation of a single measuring point from the average value can intuitively characterize the degree to which it deviates from the normal range, which is suitable for monitoring scenarios with group comparability such as temperature and vibration; when the difference exceeds the threshold, it is determined to be an out-of-limit state, which facilitates the rapid location of abnormal measuring points; the out-of-limit result is published to the message queue to trigger an alarm, which can realize the immediate notification and response to abnormal states, and improve the early warning capability and handling efficiency.
[0012] In one possible implementation of the first aspect, the multiple measuring points are multiple temperature monitoring points of structural components in the same power equipment; the target value represents the latest temperature monitoring data of the corresponding measuring point within the target time window; wherein, the structural components include one or more of stator core, stator coil, and guide bearing shell; The first device determines the average of multiple target values, and for at least one of the multiple measuring points, determines the difference between the target value corresponding to the measuring point and the average value, including: The first device determines the average value of the latest temperature data of multiple temperature monitoring points of structural components in the same power equipment within a target time window; For at least one of multiple temperature monitoring points, calculate the difference between the latest temperature monitoring data and the average value for that temperature monitoring point.
[0013] In this embodiment, multiple measuring points are specifically refined into multiple temperature monitoring points for structural components (such as stator core, stator coil, and guide bearing bearing) in the same power equipment. This makes the solution highly targeted and practical in power equipment temperature monitoring scenarios: the data from similar temperature monitoring points are highly comparable, and the average value can effectively characterize the overall temperature rise level of the component; by calculating the difference between the latest temperature of each monitoring point and the average value, abnormal phenomena such as local overheating or uneven heat dissipation can be quickly identified, which can improve the operational safety and fault prediction capabilities of power equipment.
[0014] In one possible implementation of the first aspect, the method further includes: Before the first device acquires data items from multiple measurement points associated with the target rule identifier in chronological order, the first device acquires a set of data items from the message queue; wherein, the set of data items contains multiple data items associated with different rule identifiers. The first device distributes data items associated with different rule identifiers to multiple parallel processing units; among them, data items corresponding to the same rule identifier are distributed to the same processing unit, and data items corresponding to different rule identifiers are distributed to different processing units. The first device acquires data items from multiple measurement points associated with the target rule identifier in chronological order, including: The first processing unit of the first device receives data items corresponding to multiple measurement points that are associated with the target rule identifier.
[0015] Based on the above technical content, this embodiment receives a set of mixed rule data items through a message queue and distributes them to different processing units according to the rule identifier, realizing parallel processing of multiple rules and resource isolation: data items with the same rule identifier are routed to the same processing unit, ensuring that all measurement point data related to the rule are processed in sequence within the unit, avoiding data interference between rules; data items with different rule identifiers are distributed to different units, supporting high-concurrency rule calculation and improving the overall throughput and real-time performance of the system; it not only ensures the temporal consistency of single rule data processing, but also realizes the reasonable allocation and load balancing of computing resources.
[0016] In one possible implementation of the first aspect, the processing strategy includes processing logical expressions; target rules are combined in series with other rules; After the first device determines the operating status of at least one measuring point, the method further includes: The first device uses the combination of the target rule identifier and the measurement point identifier as the key to write the operation status judgment result of the measurement point into the status memory; When the first device processes data according to the processing logic expression corresponding to other rule identifiers, the first device reads the running status judgment result of the measurement point from the state memory using the combination of the target rule identifier and the measurement point identifier as the key, and uses the running status judgment result of the measurement point as the input data of the processing logic expression corresponding to other rule identifiers to determine the running status judgment result corresponding to other rule identifiers.
[0017] In this embodiment, the execution status determination result of the target rule is written into the state memory, and other rules are allowed to read the result as input during processing, thus realizing the chain combination of rules. Through rule chaining, multi-layered and complex monitoring logic can be constructed, and monitoring events can be flexibly constructed, enhancing the intelligence and adaptability of state monitoring.
[0018] In one possible implementation of the first aspect, the first device belongs to a time-series data processing system, which also includes a second device. The method also includes: When the second device detects a change in the processing rules in the rule configuration information, it acquires at least one changed processing rule. Each changed processing rule includes a rule identifier, a processing strategy, multiple associated measurement point identifiers, and a processing start time. Each rule identifier is associated with multiple measurement point identifiers, and the processing rule is used to determine the operating status of the measurement points. The rule configuration information is generated based on the user's input on the visual configuration interface. The second device obtains the corresponding time-series data stream from the time-series data source based on the measurement point identifier associated with each rule identifier and the processing start time point; wherein, the time-series data stream is a sequence of data items arranged in chronological order starting from the processing start time point, and each data item includes the corresponding measurement point identifier, data content and timestamp. The second device associates each data item in the time-series data stream with the corresponding rule identifier to obtain data items associated with multiple different rule identifiers; The second device sends data items associated with multiple different rule identifiers to a message queue for the first device to retrieve and process from the message queue.
[0019] Here, the second device monitors rule configuration changes, pulls the corresponding time-series data stream according to the rules, associates it with the rule identifier, and pushes it to the message queue. Data synchronization is triggered immediately when the rules change, realizing dynamic rule activation and historical data backtracking calculation. Furthermore, only the data of the measurement points associated with the rules are pulled, avoiding full data transmission and saving bandwidth and storage resources. In addition, the pre-association of data items with rule identifiers can reduce the parsing burden of the first device and improve the data processing efficiency of the stream processing pipeline.
[0020] Secondly, a data processing apparatus is provided, the apparatus comprising: The acquisition module is used to acquire data items of multiple measurement points associated with the target rule identifier in chronological order. The target rule identifier is associated with multiple measurement points, and each data item includes the target rule identifier associated with the data item, the measurement point identifier, the corresponding data content, and the timestamp. The first processing module is used to divide multiple consecutive time windows based on a preset window duration; The storage module is used to determine the time window to which each data item belongs based on the timestamp, and update the current status value of the corresponding measuring point within the time window to the data content corresponding to the data item. The second processing module is used to respond to the end event of the target time window and obtain the current status value corresponding to multiple measurement points associated with the target rule identifier within the target time window as the target value. The third processing module is used to obtain the processing strategy corresponding to the target rule identifier, and process the target values corresponding to multiple measurement points according to the processing strategy to determine the running status judgment result of at least one measurement point; wherein, the processing strategy defines the processing rules between the target values corresponding to multiple measurement points.
[0021] Thirdly, an electronic device is provided, the method comprising: a memory and at least one processor. The memory is communicatively connected to the processor. The memory is used to store computer program code, the computer program code including computer instructions. When the processor executes the computer instructions, it causes the electronic device to perform the method of the first aspect and any possible implementation thereof.
[0022] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer instructions. When these computer instructions are executed by a processor, they are used to implement the method as described in the first aspect and any possible implementation thereof.
[0023] Fifthly, embodiments of this application provide a computer program product that, when running on a computer / executed by the computer's processor, implements the method described in the first aspect and any possible design thereof. The computer may be an electronic device as described in the third aspect and any possible implementation thereof.
[0024] Understandably, the beneficial effects achieved by the data processing apparatus of the second aspect, the electronic device of the third aspect, the computer-readable storage medium of the fourth aspect, and the computer program product of the fifth aspect provided above can be referred to as the beneficial effects of the first aspect and any possible implementation thereof, which will not be repeated here. Attached Figure Description
[0025] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application; Figure 2 This is a flowchart illustrating another data processing method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the content of a data item provided in an embodiment of this application; Figure 4 This is a schematic diagram of data partitioning provided in an embodiment of this application; Figure 5 This is a schematic diagram of a data processing flow based on Flink provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "a plurality of" means two or more.
[0027] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0028] In the technical solutions provided in this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved are all information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision and disclosure of the above information and data all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0029] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0030] In the field of data processing, to meet the real-time analysis needs of massive time-series data, a streaming computing framework based on Apache Flink is typically used, combined with lightweight scripting languages such as AviatorScript to implement dynamic rule and formula calculations. However, efficiently and flexibly integrating these two technologies to address the complex computing needs of industrial scenarios such as power generation still presents challenges at the architectural design and implementation levels. As a high-performance, batch-stream integrated big data computing framework, Apache Flink dominates in real-time processing of massive time-series data due to its low latency, high throughput, and precise one-time semantics. Its multi-level API and SQL support further lower the development threshold for distributed streaming applications; AviatorScript, on the other hand, is a lightweight scripting language running on the JVM, characterized by its concise syntax, excellent performance, and extremely low learning curve, typically allowing for quick mastery within minutes. It is well-suited for embedding in scenarios involving light logical operations such as rule judgment, rule engines, and dynamic formula calculations.
[0031] In power and other industry systems, time-series data is massive in scale, and analysis requirements are complex and diverse. These tasks typically require acquiring data from multiple measurement points at a current or historical point in time, substituting this data into predefined processing rules, and ultimately outputting a boolean result (such as true / false) or a specific numerical value. With the widespread application of Flink technology, how to efficiently implement dynamic rule computation within the Flink streaming processing system has become a core problem that developers must solve. Related technologies usually store processing rule definitions in a relational database, importing them as an external table in the Flink task and performing computation by joining them with the real-time data stream. However, this approach requires further optimization and improvement.
[0032] Due to a combination of issues related to data acquisition architecture, hardware characteristics, and network communication, time-series data of similar analog quantities are not collected simultaneously, meaning there are differences in data timestamps. When the calculation of a rule involves multiple measurement points, the arrival times of the data at each measurement point may differ. In this case, if data arriving at different times is used for calculation, it may lead to inaccurate data processing results and affect the reliability of status monitoring.
[0033] To improve the accuracy of data processing results and thus the reliability of status monitoring, the embodiments of this application divide the data into continuous time windows, dynamically update the latest status values of each measuring point within the window, and uniformly retrieve the synchronous data of all measuring points at the end of the window to perform rule calculations. This solves the calculation deviation problem caused by the asynchronous arrival of data from multiple measuring points and improves the accuracy of status monitoring.
[0034] This application provides a data processing method that can be applied to electronic devices. The electronic device can be a single server or a server cluster consisting of multiple servers, or a cloud computing platform or edge computing device with data processing capabilities, or a chip or a device with computing capabilities. This application does not limit the specific form of the electronic device.
[0035] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 1 As shown, the method in this embodiment can be applied to a first device and may include: S101. Obtain data items of multiple measurement points associated with the target rule identifier in chronological order; the target rule identifier is associated with multiple measurement points, and each data item includes the target rule identifier, measurement point identifier, corresponding data content, and timestamp associated with the data item.
[0036] The target rule identifier is a string or code used to uniquely identify a specific business monitoring or analysis rule, such as "rule_001". Each rule identifier is pre-configured with multiple physical or logical measurement points that it needs to be associated with for monitoring. Measurement points are units that generate monitoring data, such as a temperature sensor or a vibration acquisition point.
[0037] For example, this embodiment can obtain data items by interfacing with message middleware, polling data interfaces, or directly reading from a streaming data source. During the acquisition process, this embodiment filters data items based on the "target rule identifier" field carried in the data items, selecting all data items that match the current processing target.
[0038] S102. Divide the time window into multiple consecutive windows based on the preset window duration.
[0039] The preset window duration is a fixed time interval set for periodic status assessments, such as 1 minute, 5 minutes, or 1 hour.
[0040] In one feasible implementation, the time window in this embodiment has a fixed window length, and adjacent windows do not overlap and are continuous, such as a series of windows such as (10:00:00, 10:01:00), (10:01:00, 10:02:00), etc.
[0041] For example, in this embodiment, the time window is divided according to the system time of the device.
[0042] S103. For each data item, determine the time window to which the data item belongs based on the timestamp, and update the current status value of the corresponding measuring point within the time window to the data content corresponding to the data item.
[0043] For example, in this embodiment, the quotient (rounded down) of the timestamp of a data item divided by the preset window duration is used to determine the sequence number or identifier of the window to which it belongs.
[0044] For example, for a window with a duration of 60 seconds, the timestamp 10:00:35 will be mapped to the window (10:00:00, 10:01:00).
[0045] In this embodiment, a state variable is maintained in memory or a distributed state backend for each combination <target rule identifier, measurement point identifier, time window> to store the "current state value". When a data item is obtained, this embodiment locates the corresponding state variable based on its rule identifier, measurement point identifier, and calculated time window, and overwrites the old value of this variable with the "data content" of the data item. Multiple data items may be stored for the same measurement point within the same time window, but only the last data item received will be retained as the final state value of that measurement point within that window. This ensures that the data content used in subsequent calculations is the latest state value of the measurement point within the window period.
[0046] S104. In response to the end event of the target time window, obtain the current state value of each measurement point associated with the target rule identifier within the target time window, and use the current state value of each measurement point as the target value of the measurement point.
[0047] The end event of the target time window can refer to the device time reaching the predetermined time.
[0048] This embodiment can traverse the list of all measurement point identifiers pre-associated with the target rule based on the target rule identifier and the target time window, and read the "current state value" corresponding to each measurement point from the state memory according to the combination key <target rule identifier, measurement point identifier, target time window>. The read data content is the "target value" of each measurement point under the target time window.
[0049] This embodiment collects the final state values of all associated measurement points within the same past time period at the end of the window. This aligns data that originally arrived at different physical times to the same calculation time, eliminating potential deviations caused by inconsistencies in data arrival times.
[0050] S105. Obtain the processing strategy corresponding to the target rule identifier, and process the target values corresponding to multiple measurement points according to the processing strategy to determine the running status judgment result of at least one measurement point; wherein, the processing strategy defines the processing rules between the target values corresponding to multiple measurement points.
[0051] The processing strategy is a predefined computational logic used to analyze data from multiple measurement points and derive results. It can be a formula in a configuration file, an expression written in a scripting language (such as Aviator or Groovy), or an executable code module. It defines processing rules between multiple target values, such as: calculating the average or maximum value of all target values; determining whether a target value exceeds a static or dynamic threshold; or comparing the differences between different target values to see if they are within acceptable limits.
[0052] For example, this embodiment obtains the processing strategy corresponding to the target rule identifier. Subsequently, the target value of each measuring point is used as an input parameter and substituted into the processing strategy to perform calculation. The result generated after execution is the "operation status determination result", such as "normal", "abnormal", "measuring point A exceeds limit alarm", etc., and the operation status determination result is associated with the specific measuring point identifier.
[0053] Based on the obtained time-synchronized data, this embodiment executes the specific analysis logic defined by the business side to generate accurate and reliable equipment status monitoring conclusions, thereby supporting fault early warning and health assessment.
[0054] In summary, this embodiment divides continuous time windows based on a preset window duration, providing a unified time aggregation framework for the data. It determines the window to which a data item belongs based on its timestamp and updates the current state value of the corresponding measuring point to the latest data, ensuring that each measuring point always retains the latest state within the window. At the end of the target time window, it uniformly acquires the latest state values of all associated measuring points as the target value, achieving synchronization of multi-measuring point data at the calculation time. Finally, based on the processing strategy corresponding to the rules, it calculates the synchronized target value to obtain the running status judgment result, thereby avoiding misjudgments caused by asynchronous data arrival and improving the reliability of the monitoring results.
[0055] Figure 2 This is a flowchart illustrating another data processing method provided in an embodiment of this application. For example... Figure 2 As shown, the method in the embodiments of this application may include: S201. When the second device detects a change in the processing rule in the rule configuration information, it acquires at least one of the changed processing rules.
[0056] Each changed processing rule includes a rule identifier, processing strategy, multiple associated measurement point identifiers, and processing start time. Each rule identifier is associated with multiple measurement point identifiers, and the processing rule is used to determine the operating status of the measurement points. The rule configuration information is generated based on the user's input on the visual configuration interface.
[0057] For example, in this embodiment, users can dynamically create or modify data analysis rules through the visual and personalized configuration interface provided by the expert rule management module. For instance, users can configure a rule for "comparing a single analog quantity with the average value of similar analog quantities to determine an alarm" for monitoring objects such as the stator core, stator coil, or guide bearing temperature in power equipment. During configuration, users need to specify the rule identifier (e.g., "r_12"), the identifiers of multiple associated temperature measurement points, the calculation logic (e.g., an expression written based on Aviator Script), the verification threshold, and the data start time point for rule calculation. The rule configuration information is persistently stored.
[0058] The second device (such as a data synchronization module) monitors the rule configuration information for changes through periodic polling (e.g., every 1 second). Once a change is detected, this embodiment retrieves all information about the changed processing rule from storage, including the rule identifier, processing strategy (Aviator expression), list of associated measurement point identifiers, and processing start time, in preparation for subsequent data synchronization.
[0059] This embodiment enables dynamic configuration of rules and automatic monitoring synchronization of the second device through a visual interface, allowing the addition, deletion, and modification of business logic rules to be detected in real time without restarting the service or redeploying the computing task. This achieves online hot updates of business rules and provides a prerequisite for the immediate effect of rules and the retrospective calculation of historical data.
[0060] S202. The second device obtains the corresponding time series data stream from the time series data source according to the measurement point identifier associated with each rule identifier and the processing start time point.
[0061] The time-series data stream is a sequence of data items arranged in chronological order starting from the processing start time. Each data item includes the corresponding measurement point identifier, data content, and timestamp.
[0062] For example, for each changed processing rule obtained, this embodiment initiates a data retrieval request to the time series data service module based on the list of measurement point identifiers associated with its rule identifier and the processing start time point specified by the user (e.g., the start time of "since the beginning of the year" or "the most recent month").
[0063] The time series data service module stores historical and real-time time series data for all measurement points.
[0064] This embodiment only retrieves all data from these designated measuring points after the start time of processing, and sorts them in ascending order by timestamp to form a sequence of data items arranged chronologically. Each data item includes at least a measuring point identifier, data content (such as temperature value), and a timestamp accurate to the second or millisecond.
[0065] By using this on-demand retrieval mechanism, this embodiment avoids injecting all measurement point data into the processing pipeline, significantly saving network bandwidth and data storage resources.
[0066] This embodiment implements a mechanism for precise data synchronization by associating measurement points according to rules. It only pulls the historical and real-time data necessary for rule calculation, avoiding the waste of resources caused by full data transmission. At the same time, it ensures that a complete and time-accurate data foundation is provided for rule calculation, and data backtracking calculation can be realized from any historical point in time.
[0067] S203. The second device associates each data item in the time-series data stream with the corresponding rule identifier to obtain data items associated with multiple different rule identifiers, and sends the data items associated with multiple different rule identifiers to the message queue for the first device to retrieve and process from the message queue.
[0068] For example, after obtaining the original time-series data stream from the time-series data source, this embodiment processes each data item in the data stream.
[0069] Taking rule "r_12" as an example, for each data item of each measurement point associated with it, this embodiment associates and binds the measurement point identifier, data content, and timestamp information of the data item with the rule identifier "r_12" to generate a new data item. This new data item includes: target rule identifier, measurement point identifier, data content, and timestamp.
[0070] In one example, Figure 3 This is a schematic diagram of the content of a data item provided in an embodiment of this application. In this embodiment, the processing strategy corresponding to the target rule identifier can also be associated with this data item. This data item includes a rule identifier, a measurement point identifier, data content, a timestamp, and a processing strategy. Subsequently, when processing the target value, the first device can directly perform data processing based on the processing strategy in the data item.
[0071] This embodiment can send all data items from different rules that have been associated and bound to a single designated Kafka message queue topic. This creates a collection of data items in the message queue, each associated with a different rule, waiting to be retrieved and processed by the downstream real-time computing module (i.e., the first device).
[0072] In this embodiment, the association and binding of data items with rule logic are completed in advance before the data enters the stream processing pipeline, forming a self-contained computing unit. This reduces the computational burden of real-time parsing and association of rules on the first device during stream processing, improves the efficiency of data flowing into the computing nodes, and allows the stream processing pipeline to focus more on state management and rule computation itself.
[0073] In one feasible implementation, after S203, this embodiment can continue to execute as follows: Figure 1 Steps S101 to S105, or steps S204 to S208 below, wherein steps S204 to S208 below are refinements of steps S101 to S105. That is, the target rule identifier in steps S204 to S208 below can be a rule identifier that has changed.
[0074] In another feasible implementation, the data processing methods described in S204 to S208 below can also be applied to rules that have not changed, that is, the target rule identifier can be an unchanged rule identifier. The data processing methods described in S204 to S208 below can be executed independently.
[0075] S204. The first device acquires data items from multiple measurement points associated with the target rule identifier in chronological order.
[0076] Both the first and second devices belong to the time-series data processing system.
[0077] The target rule identifier is associated with multiple measurement points. Each data item includes the target rule identifier, measurement point identifier, corresponding data content, and timestamp associated with the data item. In one feasible implementation, prior to S204, the first device obtains a set of data items from the message queue; wherein the set of data items contains multiple data items associated with different rules. The first device distributes data items associated with different rule identifiers to multiple parallel processing units; among them, data items corresponding to the same rule identifier are distributed to the same processing unit, and data items corresponding to different rule identifiers are distributed to different processing units.
[0078] The above S204 may include: the first processing unit of the first device receiving data items corresponding to multiple measurement points associated with the target rule identifier.
[0079] For example, in this embodiment, the first device (real-time computing module, such as Flink streaming processing system) continuously pulls a set of data items sent by the second device from the Kafka topic.
[0080] Since the collection contains data items belonging to different rules, this embodiment first utilizes Flink's KeyBy operator to repartition all incoming data using the "target rule identifier" in the data item as the partition key. After the KeyBy operation, data items with the same rule identifier are routed to the same parallel processing subtask (e.g., processing unit), while data items with different rule identifiers are distributed to different processing units.
[0081] In one example, Figure 4 This is a data partitioning diagram provided in an embodiment of this application, such as... Figure 4 As shown, the first device uses the KeyBy node to divide the mixed data stream into independent data sub-streams (such as rule 1 data and rule 2 data) through the partitioner based on the rule identifier in the data item. Each sub-stream is distributed to different Map processing nodes (such as S1 and S2). After each node independently executes its internal operation and calculation logic (including time window mapping, state update and rule calculation), it outputs the corresponding rule calculation results.
[0082] For example, all data items identified as "r_12" will enter the same processing unit (i.e., the first processing unit). Within this processing unit, data items are processed strictly according to the order of their timestamps. Therefore, for the target rule identified as "r_12", the first processing unit will receive data items reported by multiple measurement points (such as temperature monitoring points A, B, C, and D) associated with this rule in chronological order.
[0083] This embodiment achieves parallel processing and resource isolation of multiple rules through a streaming data partitioning strategy based on rule identifiers. All data of the same rule is processed in a single processing unit to ensure time-series processing, avoiding mutual interference between data of different rules; parallel processing of data of different rules makes full use of distributed computing resources, improves the overall throughput and real-time performance of the system, and effectively supports high-density rule computation.
[0084] S205. For each data item, the first device maps the timestamp to the corresponding time window and determines the time window to which the data item belongs.
[0085] The time window is pre-divided by the first device based on a preset window duration.
[0086] For example, this embodiment pre-sets a fixed window duration, such as 1 minute, to divide the continuous time axis into a series of continuous, non-overlapping fixed time windows (such as (10:00:00, 10:01:00), (10:01:00, 10:02:00), etc.).
[0087] When the first processing unit of the first device receives a data item, this embodiment extracts the timestamp from the data item and maps it to a corresponding time window by calculation (e.g., dividing the timestamp in milliseconds by the window duration in milliseconds and rounding down). For example, a data item with a timestamp of 10:00:35 will be mapped to a time window (10:00:00, 10:01:00), and this window will be determined as the time window to which the data item belongs. This step lays the foundation for subsequent aggregation and state management of data according to time windows.
[0088] This embodiment provides a unified time aggregation framework for asynchronously arriving streaming data through time window mapping. By discretizing the continuous time stream into a calculation cycle, data that originally arrived at different physical times and belonged to different measurement points under the same rules can be classified into a unified logical time segment, creating conditions for subsequent "intra-window state synchronization" calculations.
[0089] S206. The first device uses the combination of target rule identifier, measurement point identifier and time window as the key to write the data content into the position corresponding to the key in the state memory.
[0090] The state memory is a distributed state memory based on key-value pairs. When data already exists at a location, the newly written data overwrites the original data. After writing or overwriting, the current state value corresponding to the key is the data content of the corresponding measurement point within the time window.
[0091] For example, after determining the time window to which the data item belongs, this embodiment constructs a composite key consisting of three parts: {target rule identifier}.{measurement point identifier}.{time window}.
[0092] For example, for rule "r_12", measurement point "temp_A", and time window "(10:00:00, 10:01:00)", the key is "r_12.temp_A.(10:00:00, 10:01:00)". This embodiment uses a key-value pair state storage (such as Map State) provided by Flink, using this composite key as the key, and storing or updating the data content of the current data item (such as the temperature value "85.3") as the value.
[0093] Since the data stream flows in sequentially by time, multiple data points may be generated for the same measurement point within the same time window due to different acquisition cycles. This embodiment employs an "overwrite" strategy: if a value already exists under a key, the newly arrived data content overwrites the old value. Through this mechanism, for each combination of rule-measurement-time window, the state memory always retains only the latest (i.e., most recent) data content that arrived at that measurement point within that window.
[0094] This embodiment utilizes composite keys and an overwrite write strategy to maintain a latest state snapshot for each measurement point within each time window in a distributed state memory. This ensures that when performing rule calculations, the data used for each measurement point is its final and latest state within the calculation cycle, effectively solving the problem of intermediate state interference that may be caused by the same measurement point reporting data multiple times within a window, and providing a clean and synchronous data source for accurate calculations.
[0095] S207. In response to the end event of the target time window, the first device reads the current state value corresponding to each measurement point from the state memory according to the target rule identifier, the measurement point identifier and the target time window.
[0096] For example, this embodiment employs a timer or window trigger mechanism based on processing time. When the system time reaches the end boundary of a certain time window (for example, the current time reaches 10:01:00, marking the end of the window (10:00:00, 10:01:00)), the "end event" of the target time window is triggered.
[0097] In this embodiment, the target window end event is typically triggered by a timing mechanism. For example, the timing duration is set to 1 minute. When the system processes data with a timestamp belonging to the 6th minute, it triggers an "end event" for the 5th minute time window ((10:05:00, 10:06:00)). In response to this event, this embodiment retrieves all entries from the state memory whose keys contain the (10:05:00, 10:06:00) time window and belong to the target rule identifier. The values read at this time are the data that each measuring point is finally updated within the 5th minute window (e.g., the value of measuring point a at the 59th second, and the value of measuring point d at the 58th second). Thus, although these original data did not arrive in the same physical second, they are aligned to the unified logical calculation time of "5th minute" as the "target value" for each measuring point under this window.
[0098] In this embodiment, values are read in batches from the state memory S based on these keys. These read values are the last updated data content of each measurement point within the just-ended time window (10:00:00, 10:01:00), i.e., their "current state value". These values will be used as the "target value" for each measurement point in this window for subsequent rule calculations.
[0099] This embodiment triggers a unified state reading operation at the end of the time window, achieving mandatory synchronization of data from multiple measurement points at the calculation time. Regardless of when the data from each measurement point arrives within the window, the final calculation uses their latest state values at the end of the same time window. This fundamentally avoids the deviations that may occur when directly substituting asynchronous, non-synchronous data into the formula for calculation, greatly improving the accuracy and reliability of the state determination results.
[0100] S208. The first device processes the target values corresponding to multiple measuring points according to the processing strategy, and determines the operating status judgment result of at least one measuring point.
[0101] In one example, multiple measuring points are of the same type; S208 includes the following steps: The first device determines the average value of multiple target values, and for at least one of the multiple measuring points, determines the difference between the target value corresponding to the measuring point and the average value; If the difference is greater than the preset threshold, the first device determines that the state corresponding to the measuring point is an out-of-limit state; if the difference is less than or equal to the preset threshold, the first device determines that the corresponding state is a normal state.
[0102] The above data processing method also includes: if the operation status determination result is an out-of-limit status, the first device publishes the out-of-limit status determination result to the message queue, and the out-of-limit status determination result is used to trigger an alarm.
[0103] In one example, multiple measuring points can be multiple temperature monitoring points of structural components in the same power equipment; the target value represents the latest temperature monitoring data of the corresponding measuring point within the target time window; wherein, the structural components include one or more of the following: stator core, stator coil, and guide bearing bearing; S208 may include: The first device determines the average value of the latest temperature data of multiple temperature monitoring points of structural components in the same power equipment within a target time window; for at least one of the multiple temperature monitoring points, it calculates the difference between the latest temperature monitoring data of the temperature monitoring point and the average value.
[0104] For example, this embodiment obtains the processing strategy corresponding to the target rule identifier "r_12", which has been defined in the Aviator expression.
[0105] Taking power equipment temperature monitoring as an example, rule "r_12" is associated with four temperature monitoring points (temp_A, temp_B, temp_C, temp_D) on the same generator stator core. At the end of the window (10:00:00, 10:01:00), the target values read from the state memory are 85.3°C, 86.1°C, 84.9°C, and 87.8°C, respectively.
[0106] This embodiment first calculates the average of the four target values: (85.3 + 86.1 + 84.9 + 87.8) / 4 = 86.025°C. Next, for each measuring point, the absolute difference between its target value and the average value is calculated. For example, the difference for temp_D is |87.8 - 86.025| = 1.775°C.
[0107] In this embodiment, the difference is compared with a preset threshold (e.g., 1.5°C). Since 1.775°C > 1.5°C, this embodiment determines that the operating state of measuring point temp_D is "out of limit state", and the other measuring points are determined to be "normal state".
[0108] For a measurement point determined to be in an out-of-limit state, this embodiment generates an out-of-limit state determination result containing information such as rule identifier, measurement point identifier, out-of-limit value, and time window, and publishes it as a new message to another designated Kafka alarm topic. Downstream alarm modules can subscribe to this topic to obtain alarm information in real time and trigger alarm actions such as SMS, email, or interface pop-ups.
[0109] This embodiment uses the average value of data from a group of similar measuring points as a reference benchmark. Anomalies are identified by comparing the deviation between individual data and the group's data, making it suitable for monitoring scenarios where the group is comparable, such as temperature and vibration monitoring. This method can effectively detect anomalies caused by localized overheating, uneven heat dissipation, etc., improving the sensitivity and accuracy of fault warnings. Simultaneously, by publishing alarms through a message queue, it achieves immediate notification of abnormal states and decouples the system from the actual situation, improving the response efficiency of the entire monitoring and early warning system.
[0110] In one example, Figure 5 This is a schematic diagram of a data processing flow based on Flink provided in an embodiment of this application, such as... Figure 5 As shown, the Kafka source node reads data from the Kafka topic; then the KeyBy node partitions the data according to the rule identifier in the data item, and routes data with the same rule to the same parallel processing unit; after the data enters the Map node, the Map node has a built-in state storage (mp_states) to perform time window mapping, state updates and Aviator expression calculations to complete the real-time determination of the running state; finally, the processing results are output to the downstream storage or message system through the sinking node, thereby realizing efficient, parallel and stateful processing of multi-rule time-series data.
[0111] In one feasible implementation, the processing strategy includes processing logical expressions; target rules are combined in series with other rules; after the first device determines the operating status judgment result of at least one measurement point, the above data processing method may further include: The first device uses the combination of the target rule identifier and the measurement point identifier as the key to write the operation status judgment result of the measurement point into the status memory.
[0112] When the first device processes data according to the processing logic expression corresponding to other rule identifiers, the first device reads the running status judgment result of the measurement point from the state memory using the combination of the target rule identifier and the measurement point identifier as the key, and uses the running status judgment result of the measurement point as the input data of the processing logic expression corresponding to other rule identifiers to determine the running status judgment result corresponding to other rule identifiers.
[0113] In one example, in this embodiment, the processing strategy can be a processing logic expression written based on Aviator Script. A processing logic expression involving multiple measurement points can be represented as: f(r, g1(p1, t1), g2(p2, t2), ..., gi(pi, ti)). Where r is the rule identifier, pi is the measurement point identifier, ti is time, and gi represents the method for obtaining the index value of measurement point pi at time ti, i.e., the specific calculation logic.
[0114] In real-time stream processing scenarios, to calculate the latest state of each measurement point at the same logical moment (such as the end of a time window), the time parameters t1, ..., ti can be omitted in the expression, meaning that the latest data of each measurement point up to the calculation time is obtained; and for the same type of logic (such as obtaining the latest state value), each gi function is the same. Therefore, in this embodiment, the expression can be simplified to: f(r, g(p1), g(p2), ..., g(pi)), where p1, ..., pi are the different measurement points associated with this rule.
[0115] Here, the specific Aviator expression implementation of function g is: `states.getMapState(S, '{r}.{p}')`. Here, `states.getMapState` is a built-in or user-defined function in Aviator, which retrieves the corresponding value from a specified key-value state memory (denoted as S, such as the `mp_states` memory) based on a given key. The key is constructed as "rp" (i.e., a combination of rule identifier and measure point identifier). This means that the processing logic expression accesses the state memory S, using the rule identifier.measure point identifier as the key, to dynamically obtain the latest state value of the measure point specific to this rule as the calculation input.
[0116] For example, in a rule outside the current scenario (used to detect generator operating conditions and switch states), its Aviator expression might be: `states.getMapState(mp_states, 'r_12.us_123') == 5 && states.getMapState(mp_states, 'r_12.ss_121') == 1`. This expression retrieves the values with keys `r_12.us_123` and `r_12.ss_121` from the state memory `mp_states` for logical judgment, demonstrating the expression's ability to combine complex conditions using the state memory.
[0117] For example, this embodiment supports cascading calculation of rules.
[0118] For example, after completing the calculation of rule "r_12" and determining that the state of measurement point temp_D is "out of limit" (corresponding to the Boolean value true), this embodiment uses "r_12.temp_D" as the key and writes this Boolean value "true" as the new state value into the state memory S. If there is another rule "r_34", its logic is to determine "if the temperature of any point on the stator core exceeds the limit and the generator is in generating mode, then a high-level warning is triggered". The Aviator expression of rule "r_34" may include reading keys such as "r_12.temp_D". When the first device processes rule "r_34", it will use "r_12.temp_D" as the key to read the value "true" from the state memory S, and substitute it as one of the input parameters into the expression of "r_34" for calculation, thereby obtaining the final composite event judgment result.
[0119] This embodiment achieves data sharing and logical chaining among rules by storing the rule calculation results as new temporal states in shared memory. This allows simple atomic rules to be combined into complex composite rules or multi-layered decision logic, greatly enhancing the flexibility and intelligence of the state monitoring system and facilitating the construction of complex business event models.
[0120] In summary, this embodiment addresses core issues in industrial scenarios such as power generation, including asynchronous arrival of data from multiple measurement points, dynamic rule updates and historical backtracking, and low computational resource efficiency, by constructing a complete and collaborative data processing system. First, by using a second device to monitor and respond to changes in the visualized configuration rules, on-demand and precise synchronization of rules and associated measurement point time-series data is achieved. This supports data retrieval and rule recalculation from any historical time point, breaking the backtracking limitations caused by the strong binding between rules and real-time data streams. Second, in the streaming computing pipeline of the first device, a data partitioning strategy based on rule identifiers enables parallel processing and resource isolation of multiple rules, ensuring the temporal consistency of single-rule data processing. Through time window division and composite key state management, the latest state value of each measurement point is dynamically maintained within each window and read uniformly at the end of the window, ensuring strict synchronization of multi-measurement point data at the time of calculation. Furthermore, an anomaly detection strategy based on the group average value is adopted for similar measurement points (such as temperature monitoring points), effectively identifying local anomalies and quickly triggering alarms through message queues. In addition, by storing the rule judgment results as new states in shared memory, flexible concatenation between rules and the construction of complex events are supported. Ultimately, this embodiment forms a complete technical solution from dynamic rule configuration, accurate data synchronization, windowed state alignment, parallel and efficient computing to intelligent alarm and rule linkage, which significantly improves the accuracy, real-time performance, flexibility and system resource utilization efficiency of state monitoring.
[0121] Figure 6This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Figure 6 As shown, the data processing device includes an acquisition module 601, a first processing module 602, a storage module 603, a second processing module 604, and a third processing module 605.
[0122] The acquisition module 601 is used to acquire data items of multiple measurement points associated with the target rule identifier in chronological order; the target rule identifier is associated with multiple measurement points, and each data item includes the target rule identifier associated with the data item, the measurement point identifier, and the corresponding data content and timestamp; The first processing module 602 is used to divide multiple consecutive time windows based on a preset window duration; The storage module 603 is used to determine the time window to which the data item belongs based on the timestamp for each data item, and update the current status value of the corresponding measuring point within the time window to the data content corresponding to the data item. The second processing module 604 is used to respond to the end event of the target time window and obtain the current status value corresponding to the multiple measurement points associated with the target rule identifier within the target time window as the target value. The third processing module 605 is used to obtain the processing strategy corresponding to the target rule identifier, and process the target values corresponding to multiple measurement points according to the processing strategy to determine the running status judgment result of at least one measurement point; wherein, the processing strategy defines the processing rules between the target values corresponding to multiple measurement points.
[0123] In other embodiments, the storage module 603 is specifically used to: map timestamps to corresponding time windows and determine the time window to which the data item belongs; Using the combination of target rule identifier, measurement point identifier, and time window as the key, the data content is written to the position corresponding to the key in the state memory; wherein, the state memory is a distributed state memory based on key-value pairs; when the position already contains data content, the newly written data content overwrites the original data content; after writing or overwriting, the current state value corresponding to the key is the data content of the corresponding measurement point within the time window.
[0124] In other embodiments, the second processing module 604 is specifically used to: in response to the end event of the target time window, read the current state value corresponding to each measurement point from the state memory according to the target rule identifier, the measurement point identifier and the target time window.
[0125] In other embodiments, multiple measuring points are of the same type; the third processing module 605 is specifically used for: Determine the average of multiple target values, and for at least one of the multiple measuring points, determine the difference between the target value and the average value corresponding to the measuring point.
[0126] If the difference is greater than the preset threshold, the state corresponding to the measuring point is determined to be an out-of-limit state; if the difference is less than or equal to the preset threshold, the corresponding state is determined to be a normal state.
[0127] The aforementioned data processing device further includes a first sending module, which is used to publish the over-limit status determination result to a message queue if the operation status determination result is an over-limit status, and the over-limit status determination result is used to trigger an alarm.
[0128] In other embodiments, multiple measuring points are multiple temperature monitoring points of structural components in the same power equipment; the target value represents the latest temperature monitoring data of the corresponding measuring point within a target time window; wherein, the structural components include one or more of stator core, stator coil, and guide bearing bearing; the third processing module 605 is further specifically used for: Determine the average of multiple target values, and for at least one of the multiple measuring points, determine the difference between the target value corresponding to that measuring point and the average value, including: Determine the average value of the latest temperature data from multiple temperature monitoring points of structural components in the same power equipment within a target time window.
[0129] For at least one of multiple temperature monitoring points, calculate the difference between the latest temperature monitoring data and the average value for that temperature monitoring point.
[0130] In other embodiments, the data processing apparatus further includes a fourth processing module for: Before retrieving data items from multiple test points associated with the target rule identifier in chronological order, a data item set is retrieved from the message queue; the data item set contains multiple data items associated with different rule identifiers.
[0131] Data items associated with different rule identifiers are distributed to multiple parallel processing units; data items with the same rule identifier are distributed to the same processing unit, while data items with different rule identifiers are distributed to different processing units.
[0132] Data items from multiple measurement points associated with the target rule identifier are retrieved in chronological order, including: Receive data items corresponding to multiple measurement points that are associated with the target rule identifier.
[0133] In other embodiments, the processing strategy includes a processing logic expression; the target rule is concatenated with other rules; after the third processing module 605, the data processing device further includes a second sending module, used for: Using the combination of the target rule identifier and the measurement point identifier as the key, the operation status determination result of the measurement point is written into the status memory.
[0134] When processing data according to the processing logic expression corresponding to other rule identifiers, the combination of the target rule identifier and the measurement point identifier is used as the key to read the running status judgment result of the measurement point from the state memory, and the running status judgment result of the measurement point is used as the input data of the processing logic expression corresponding to other rule identifiers to determine the running status judgment result corresponding to other rule identifiers.
[0135] In other embodiments, the data processing apparatus further includes a fifth processing module for: When a change in the processing rule in the rule configuration information is detected, at least one changed processing rule is obtained; wherein, each changed processing rule includes a rule identifier, a processing strategy, multiple associated measurement point identifiers, and a processing start time point; each rule identifier is associated with multiple measurement point identifiers, and the processing rule is used to determine the operating status of the measurement points; the rule configuration information is generated based on the user's input on the visual configuration interface.
[0136] Based on the measurement point identifier associated with each rule identifier and the processing start time, the corresponding time series data stream is obtained from the time series data source; wherein, the time series data stream is a sequence of data items arranged in chronological order starting from the processing start time, and each data item includes the corresponding measurement point identifier, data content and timestamp.
[0137] Each data item in the time-series data stream is associated with its corresponding rule identifier, resulting in data items associated with multiple different rule identifiers.
[0138] Data items associated with multiple different rule identifiers are sent to a message queue for the first device to retrieve and process.
[0139] The data processing apparatus provided in this application embodiment can execute the methods shown in the above method embodiments. Its implementation principle and beneficial effects can be referred to the relevant descriptions in the method embodiments, and will not be repeated here.
[0140] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 7 As shown, the electronic device includes a memory 701 and at least one processor 702.
[0141] The memory 701 is used to store computer program code, which includes computer instructions. These computer instructions run in the aforementioned electronic device to implement the method shown in the above-described method embodiments. For example, the memory may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, portable hard drive, read-only memory, disk, or optical disc, etc.
[0142] Processor 702 can be a general-purpose processor, including a Central Processing Unit (CPU), a network processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Processor 702 can also be other general-purpose processors. The general-purpose processor can be a microprocessor or any conventional processor.
[0143] The memory 701 and processor 702 are communicatively connected. For example, the memory 701 can connect to the processor 702 via a system bus and communicate with it. The system bus can be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, an industry standard architecture (ISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the figure, but this does not mean that there is only one bus or one type of bus.
[0144] Optionally, the memory 701 can be either standalone or integrated with the processor 702. When the memory 701 is set up independently, it is connected to the processor 702 via a system bus.
[0145] This application also provides a chip for executing instructions, which is used to execute the data processing method described in the above embodiments.
[0146] This application also provides a computer-readable storage medium storing computer instructions. When these computer instructions are executed by a processor, they are used to implement the technical solution of the data processing method described in the above embodiments. Specifically, when the computer instructions are executed by a processor, the electronic device can perform the technical solution of the data processing method described in the above embodiments.
[0147] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the technical solution of the data processing method in the above embodiments.
[0148] The aforementioned computer-readable storage media can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The computer-readable storage media can be any available medium accessible to a general-purpose or special-purpose computer.
[0149] An exemplary computer-readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the computer-readable storage medium can also be a component of the processor. The processor and the computer-readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the computer-readable storage medium can exist as discrete components in an electronic control unit or main control device; this application does not limit this.
[0150] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0151] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0152] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0153] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0154] It should be understood that the steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
[0155] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A data processing method, characterized in that, The method includes: The first device acquires data items of multiple measurement points associated with the target rule identifier in chronological order; the target rule identifier is associated with multiple measurement points, and each data item includes the target rule identifier, the measurement point identifier, the corresponding data content, and the timestamp associated with the data item. The first device divides the time window into multiple consecutive windows based on a preset window duration; For each data item, the first device determines the time window to which the data item belongs based on the timestamp, and updates the current status value of the corresponding measuring point within the time window to the data content corresponding to the data item. In response to the end event of the target time window, the first device obtains the current state value of each measurement point associated with the target rule identifier within the target time window, and uses the current state value of each measurement point as the target value corresponding to the measurement point. The first device acquires the processing strategy corresponding to the target rule identifier, and processes the target values corresponding to the plurality of measurement points according to the processing strategy to determine the operating status judgment result of at least one measurement point; wherein, the processing strategy defines the processing rules between the target values corresponding to the plurality of measurement points.
2. The data processing method according to claim 1, characterized in that, The first device determines the time window to which the data item belongs based on the timestamp, and updates the current status value of the corresponding measuring point within the time window to the data content corresponding to the data item, including: The first device maps the timestamp to the corresponding time window and determines the time window to which the data item belongs; The first device uses the combination of the target rule identifier, the measurement point identifier, and the time window as a key to write the data content into the position corresponding to the key in the state memory; wherein, the state memory is a distributed state memory based on key-value pairs; when the position already contains data content, the newly written data content overwrites the original data content; after writing or overwriting, the current state value corresponding to the key is the data content of the corresponding measurement point within the time window; In response to the end event of the target time window, the first device acquires the current state value corresponding to each measurement point associated with the target rule identifier within the target time window, including: In response to the end event of the target time window, the first device reads the current state value corresponding to each measurement point from the state memory according to the target rule identifier, the measurement point identifier and the target time window.
3. The data processing method according to claim 1, characterized in that, The multiple measuring points are of the same type; The first device processes the target values corresponding to the plurality of measuring points according to the processing strategy, and determines the operating status judgment result of at least one measuring point, including: The first device determines the average value of the plurality of target values, and for at least one of the plurality of measuring points, determines the difference between the target value corresponding to the measuring point and the average value; If the difference is greater than a preset threshold, the first device determines that the state corresponding to the measuring point is an out-of-limit state; if the difference is less than or equal to the preset threshold, the first device determines that the corresponding state is a normal state. After the first device determines the operating status judgment result of at least one measuring point, the method further includes: If the operation status determination result is an out-of-limit status, the first device publishes the out-of-limit status determination result to the message queue, and the out-of-limit status determination result is used to trigger an alarm.
4. The data processing method according to claim 3, characterized in that, The multiple measuring points are multiple temperature monitoring points of structural components in the same power equipment; the target value represents the latest temperature monitoring data of the corresponding measuring point within the target time window; wherein, the structural components include one or more of stator core, stator coil, and guide bearing bearing; The first device determines the average value of the plurality of target values, and for at least one of the plurality of measuring points, determines the difference between the target value corresponding to the measuring point and the average value, including: The first device determines the average value of the latest temperature data of multiple temperature monitoring points of structural components in the same power equipment within the target time window; For at least one of the plurality of temperature monitoring points, calculate the difference between the latest temperature monitoring data of that temperature monitoring point and the average value.
5. The data processing method according to any one of claims 1-4, characterized in that, The method further includes: Before the first device acquires data items of multiple measurement points associated with the target rule identifier in chronological order, the first device acquires a set of data items from the message queue; wherein, the set of data items contains multiple data items associated with different rule identifiers. The first device distributes data items associated with different rule identifiers to multiple parallel processing units; wherein data items corresponding to the same rule identifier are distributed to the same processing unit, and data items corresponding to different rule identifiers are distributed to different processing units. The first device acquires data items from multiple measurement points associated with the target rule identifier in chronological order, including: The first processing unit of the first device receives data items corresponding to multiple measurement points associated with the target rule identifier.
6. The data processing method according to any one of claims 1-4, characterized in that, The processing strategy includes processing logical expressions; The target rule is combined with other rules in series; After the first device determines the operating status judgment result of at least one measuring point, the method further includes: The first device uses the combination of the target rule identifier and the measurement point identifier as the key to write the running status determination result of the measurement point into the status memory; When the first device processes data according to the processing logic expression corresponding to other rule identifiers, the first device reads the running status determination result of the measurement point from the state memory using the combination of the target rule identifier and the measurement point identifier as the key, and uses the running status determination result of the measurement point as the input data of the processing logic expression corresponding to the other rule identifiers to determine the running status determination result corresponding to the other rule identifiers.
7. The data processing method according to claim 5, characterized in that, The first device belongs to a time-series data processing system, and the time-series data processing system further includes a second device; The method further includes: When the second device detects a change in the processing rules in the rule configuration information, it acquires at least one changed processing rule; wherein each changed processing rule includes a rule identifier, a processing strategy, multiple associated measurement point identifiers, and a processing start time point; each rule identifier is associated with multiple measurement point identifiers, and the processing rule is used to determine the operating status of the measurement points; the rule configuration information is generated based on the user's input on the visual configuration interface; The second device obtains the corresponding time-series data stream from the time-series data source based on the measurement point identifier associated with each rule identifier and the processing start time point; wherein, the time-series data stream is a sequence of data items arranged in chronological order starting from the processing start time point, and each data item includes the corresponding measurement point identifier, data content and timestamp; The second device associates each data item in the time-series data stream with a corresponding rule identifier to obtain data items associated with multiple different rule identifiers; The second device sends data items associated with multiple different rule identifiers to the message queue for the first device to retrieve and process from the message queue.
8. A data processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire data items of multiple measurement points associated with a target rule identifier in chronological order; the target rule identifier is associated with multiple measurement points, and each data item includes the target rule identifier, the measurement point identifier, the corresponding data content, and the timestamp associated with the data item; The first processing module is used to divide multiple consecutive time windows based on a preset window duration; The storage module is used to determine the time window to which the data item belongs based on the timestamp for each data item, and update the current status value of the corresponding measuring point within the time window to the data content corresponding to the data item. The second processing module is used to respond to the end event of the target time window and obtain the current state value corresponding to the multiple measurement points associated with the target rule identifier within the target time window as the target value. The third processing module is used to obtain the processing strategy corresponding to the target rule identifier, and process the target values corresponding to the multiple measurement points according to the processing strategy to determine the running status judgment result of at least one measurement point; wherein, the processing strategy defines the processing rules between the target values corresponding to the multiple measurement points.
9. An electronic device, characterized in that, include: The electronic device includes a memory and at least one processor; the memory is communicatively connected to the processor; the memory is used to store computer program code, the computer program code including computer instructions; when the processor executes the computer instructions, the electronic device performs the data processing method performed by a first device or a second device as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, are used to implement the data processing method as described in any one of claims 1-7.