Data anomaly detection method and device, electronic equipment and storage medium

By receiving configuration information, initializing historical data, creating scheduling tasks, and performing anomaly detection, the problem of low efficiency in data anomaly detection in existing technologies is solved, achieving efficient and flexible data anomaly detection, supporting combinations of multiple machine learning algorithms, and improving system performance.

CN118779790BActive Publication Date: 2026-11-24SHENZHEN LEXIN SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410823793.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2026-11-24
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

Existing data anomaly detection methods are inefficient, unable to detect data anomalies in a timely manner, lack combinations of multiple machine learning algorithms, have limited data for model training, and are prone to underfitting.

Method used

It receives configuration information from the management end, acquires historical data and initializes it, creates scheduling tasks, synchronizes them to the data table to be detected, performs initial anomaly detection based on the configuration information, and performs parallel computation and rule judgment through the RocketMQ message middleware, supporting a combination of multiple machine learning algorithms.

Benefits of technology

It improves the efficiency and accuracy of data anomaly detection, enables timely data anomaly awareness, supports flexible configuration and rapid expansion, and enhances the overall performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779790B_ABST
    Figure CN118779790B_ABST
Patent Text Reader

Abstract

This invention relates to the field of computers and provides a data anomaly detection method. The method includes: receiving configuration information from a management terminal for data anomaly detection of a business system; storing the configuration information in a preset database table; the configuration information including data indicators, anomaly rules, and alarm rules; upon receiving a business system test command from a client, acquiring historical data within a preset time period of the business system and initializing the historical data; creating a scheduling task based on the initialized historical data; executing the scheduling task; synchronizing the initialized historical data to a data table to be tested; performing initial anomaly detection on the data table to be tested based on the configuration information to obtain anomaly detection results; and feeding back the anomaly detection results to the client. This invention, through data preparation and rule configuration, enables flexible data anomaly detection, improving the overall performance of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computers, and more particularly to a method, apparatus, electronic device, and storage medium for detecting data anomalies. Background Technology

[0002] In the current era of big data, all industries have generated massive amounts of data. This data needs to be stored using various big data storage media (Hive, Clickhouse, MySQL, etc.), and then processed and aggregated using scheduling systems to generate new metric data. The data chains generated in this process can be very long, making timely detection of data anomalies a critical issue. For example, how can business operators use data stored in data warehouses to promptly understand the company's operational status? How can IT staff promptly identify system malfunctions? Both require an intelligent and efficient monitoring system to facilitate timely understanding of data conditions and prevent losses. Currently, the industry has tools such as AWS CloudWatch, Meituan's AIOps system, and Ctrip's anomaly attribution system. These are IT system operation and maintenance monitoring tools, but they are not based on data warehouse business metrics for anomaly detection. They also require proactive data reporting, making the anomaly detection process complex for users. Furthermore, they do not offer combinations of multiple machine learning algorithms for data anomaly detection; model training uses data from the last two weeks, and model calculations only utilize data from 10 time windows, which can easily lead to underfitting for business metrics.

[0003] Therefore, based on the above problems, it is necessary to develop a new data anomaly detection method to improve the efficiency of data anomaly detection. Summary of the Invention

[0004] For the reasons mentioned above, it is necessary to provide a data anomaly detection method, apparatus, electronic device, and storage medium to improve the efficiency of data anomaly detection.

[0005] To achieve the above objectives, the present invention provides a data anomaly detection method applied to a server, the method comprising the following steps:

[0006] S1. Receive configuration information for data anomaly detection in the business system sent by the management terminal, and store the configuration information in a preset database table. The configuration information includes data indicators, anomaly rules, and alarm rules.

[0007] S2. After receiving the business system test instruction sent by the client, obtain the historical data of the business system within a preset time period and initialize the historical data, create a scheduling task based on the initialized historical data, execute the scheduling task, and synchronize the initialized historical data to the data table to be tested.

[0008] S3. Based on the configuration information, perform initial anomaly detection on the data table to be detected to obtain anomaly detection results, and feed back the anomaly detection results to the client.

[0009] Optionally, after the anomaly detection result is fed back to the client, the process includes:

[0010] The incremental data of the business system is periodically checked according to the configuration information.

[0011] Optionally, the step of acquiring historical data within a preset time period of the business system and initializing the historical data includes:

[0012] According to the test instructions, the corresponding historical data is filtered from the preset dataset or database table;

[0013] Historical data selected from at least one dataset or database table is integrated and transformed into the data format of the initial data table. The transformed historical data is then imported into the initial data table for data preparation for anomaly detection.

[0014] Optionally, the step of creating a scheduling task based on initialized historical data and executing the scheduling task includes:

[0015] After the historical data is initialized, a full scheduling task is created, and the full scheduling task is executed immediately after recording its unique identifier, so as to import the historical data as full data into the initial data table.

[0016] Create an incremental scheduling task and determine whether there is a data task with a prerequisite dependency relationship corresponding to the incremental scheduling task.

[0017] If not, the incremental scheduling task is executed directly to obtain the corresponding scheduling time period according to the preset cron expression, and the data within the scheduling time period is imported into the initial data table as incremental data.

[0018] If so, the data task is executed. After the data task is completed, the incremental scheduling task is executed to obtain the corresponding scheduling time period according to the preset cron expression, and the data within the scheduling time period is imported into the initial data table as incremental data.

[0019] Optionally, after executing the full scheduling task, the process includes:

[0020] After the full scheduling task is completed, the execution result is imported into a preset notification template, an execution result notification is generated, and the execution result notification is sent to the test terminal.

[0021] After the full scheduling task and the incremental scheduling task are completed, the incremental scheduling task is run at preset time intervals.

[0022] Optionally, after executing the incremental scheduling task, the process includes:

[0023] When the incremental scheduling task is executed successfully, the data table to be detected is obtained through the RocketMQ message middleware based on the configuration information for initial anomaly detection.

[0024] Optionally, the step of obtaining the data table to be detected through the RocketMQ message middleware for initial anomaly detection includes:

[0025] Receive the middleware message of the incremental scheduling task, extract the full data and incremental data, and detect several windows past a preset time point in the full data and incremental data;

[0026] The index values ​​corresponding to the time points are input into the pre-selected model for parallel computation, and the results of the parallel computation are used for rule calculation based on the anomaly algorithm configuration information.

[0027] The result of the rule calculation is stored on the server, and a determination is made as to whether an alarm is needed based on the rule calculation result and alarm rule configuration information.

[0028] The present invention also provides a data anomaly detection device, the data anomaly detection device comprising:

[0029] The receiving module is used to receive configuration information for data anomaly detection in the business system sent by the management terminal, and store the configuration information in a preset database table. The configuration information includes data indicators, anomaly rules and alarm rules.

[0030] The task module is used to obtain historical data of the business system within a preset time period after receiving the business system test instruction sent by the client, initialize the historical data, create a scheduling task based on the initialized historical data, execute the scheduling task, and synchronize the initialized historical data to the data table to be tested.

[0031] The detection module is used to perform initial anomaly detection on the data table to be detected based on the configuration information, obtain anomaly detection results, and feed back the anomaly detection results to the client.

[0032] The present invention also provides an electronic device including a memory and a processor, wherein the memory includes a data anomaly detection program, which, when executed by the processor, implements any step of the data anomaly detection method described above.

[0033] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium including a data anomaly detection program, which, when executed by a processor, implements any step of the data anomaly detection method described above.

[0034] This invention relates to the field of computers and provides a data anomaly detection method. The method includes: receiving configuration information from a management terminal for data anomaly detection of a business system; storing the configuration information in a preset database table, the configuration information including data indicators, anomaly rules, and alarm rules; upon receiving a business system test command from a client, acquiring historical data within a preset time period of the business system and initializing the historical data; creating a scheduling task based on the initialized historical data; executing the scheduling task to synchronize the initialized historical data to a data table to be tested; performing initial anomaly detection on the data table to be tested based on the configuration information to obtain anomaly detection results; and feeding back the anomaly detection results to the client. This invention, through data preparation and rule configuration, enables flexible data anomaly detection, improving the overall performance of the system. Attached Figure Description

[0035] Figure 1 This is a schematic diagram of the internal structure of an electronic device implementing a data anomaly detection method according to an embodiment of the present invention.

[0036] Figure 2 This is a schematic diagram of the functional modules of a data anomaly detection device provided in an embodiment of the present invention;

[0037] Figure 3 This is a flowchart illustrating a data anomaly detection method according to an embodiment of the present invention;

[0038] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0039] The principles and spirit of the present invention will now be described with reference to several specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0040] See Figure 1 The diagram shown is a schematic of an optional hardware architecture for the electronic device proposed in this invention. In this embodiment, the electronic device 10 may include, but is not limited to, a memory 11, a processor 12, and a network interface 13, which are interconnected via a communication bus 14. It should be noted that... Figure 1 The component structure of the electronic device shown is merely an example of one embodiment of the present invention. Those skilled in the art will understand that... Figure 1The component structures shown do not constitute a structural limitation on the electronic device 10. In other embodiments of the present invention, the electronic device 10 may include fewer or more components than shown, or fewer or more specific combinations of components than shown, or the arrangement of the components of the electronic device 10 may be different from that shown, which will not be elaborated here.

[0041] The memory 11 includes at least one type of computer-readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 10, such as the hard disk or RAM of the electronic device 10. In other embodiments, the memory 11 may also be an external storage device of the electronic device 10, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 10. Of course, the memory 11 may include both internal storage units and external storage devices of the electronic device 10. In this embodiment, the memory 11 is typically used to store the operating system and various application software installed on the electronic device 10, such as data anomaly detection programs. In addition, the memory 11 may also be used to temporarily store various types of data that have been output or will be output.

[0042] In some embodiments, processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. Processor 12 is typically used to control the overall operation of electronic device 10. In this embodiment, processor 12 is used to run program code stored in memory 11 or process data, such as running a data anomaly detection program.

[0043] Network interface 13 may include a wireless network interface or a wired network interface, and network interface 13 is typically used to establish communication connections between electronic device 10 and other electronic devices.

[0044] Communication bus 14 is used to realize communication connection between components 11-13.

[0045] Optionally, the electronic device 10 may also include a user interface ( Figure 1(Not shown in the image) The user interface may include a display, input units such as a keyboard, and may also include standard wired interfaces, wireless interfaces, etc.

[0046] Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED touchscreen, etc. Further, the display may also be referred to as a screen or display unit, used to display information processed in the electronic device 10 and to display a visual user interface.

[0047] Optionally, in some embodiments, the electronic device 10 may further include an audio unit (audio unit) Figure 1 (Not shown in the image) The audio unit can convert received or stored audio data into audio signals when the electronic device 10 is in a call signal receiving mode, a call mode, a recording mode, a voice recognition mode, a broadcast receiving mode, or other modes. Furthermore, the electronic device 10 may also include an audio output unit, which outputs the audio signal converted by the audio unit. The audio output unit can also provide audio output related to specific functions performed by the electronic device 10 (such as call signal receiving sound, message receiving sound, etc.). The audio output unit may include a speaker, a buzzer, etc.

[0048] Optionally, in some embodiments, the electronic device 10 may further include an alarm unit (not shown) that can provide output to notify the electronic device 10 of the occurrence of an event. Typical events may include call reception, message reception, key signal input, touch input, etc. In addition to audio or video output, the alarm unit may provide output to notify the occurrence of an event in different ways. For example, the alarm unit may provide output in the form of vibration, and when a call, message, or other event that causes the electronic device 10 to enter communication mode is received, the alarm unit may provide tactile output (i.e., vibration) to notify the user.

[0049] In the above embodiment, when the processor 12 executes the data anomaly detection program stored in the memory 11, it performs the following steps:

[0050] S1. Receive configuration information for data anomaly detection in the business system sent by the management terminal, and store the configuration information in a preset database table. The configuration information includes data indicators, anomaly rules, and alarm rules.

[0051] S2. After receiving the business system test instruction sent by the client, obtain the historical data of the business system within a preset time period and initialize the historical data, create a scheduling task based on the initialized historical data, execute the scheduling task, and synchronize the initialized historical data to the data table to be tested.

[0052] S3. Based on the configuration information, perform initial anomaly detection on the data table to be detected to obtain anomaly detection results, and feed back the anomaly detection results to the client.

[0053] For a detailed explanation of the above steps, please refer to the following: Figure 2 Functional module diagram of the data anomaly detection method and Figure 3 A flowchart illustrating the data anomaly detection method.

[0054] Reference Figure 2 The diagram shown is a functional module schematic of one embodiment of the data anomaly detection device of the present invention. In this embodiment, multiple modules are stored in the memory 11 and executed by the processor 12 to complete the present invention. The module referred to in the present invention is a series of computer program instruction segments capable of performing a specific function.

[0055] The data anomaly detection device may include: a receiving module 201, a task module 202, and a detection module 203.

[0056] The receiving module 201 is used to receive configuration information for data anomaly detection of the business system sent by the management terminal, and store the configuration information in a preset database table. The configuration information includes data indicators, anomaly rules and alarm rules.

[0057] In one embodiment, the management terminal can provide a configuration indicator interface, a detection rule interface, and an alarm rule interface. The management terminal can provide drop-down, drag-and-drop, and form-filling methods for selection and settings of each interface. Data indicator configuration information is obtained by the management terminal through the configuration indicator interface, anomaly rule configuration information is obtained by the management terminal through the detection rule interface, and alarm rule configuration information is obtained by the management terminal through the alarm rule interface. Anomaly detection configuration information may include alarm triggering conditions, data comparison type, comparison method, threshold, and rule execution cycle, etc.

[0058] In one embodiment, the business system is a financial payment system, where the data indicators can be the amount on the third-party platform and the number of transactions involved. The anomaly detection rule can be that when the quantile of the change value of the amount on the third-party platform is greater than or equal to 1, the data is considered abnormal. The alarm rule can be that the alarm level for the data anomaly involving the number of transactions is set to "urgent", the alarm method is email, and the relevant parties to the alarm are "responder: Zhang, rising list: Li, person in charge: Wang, on-duty personnel: Zhao" (the alarm information is sent to the relevant parties to the alarm via email).

[0059] In one embodiment, the dashboard "Finance Department > Accounting and Tax Center > User Payment Table" can be selected through the indicator configuration interface, with the Finance Department as the highest-level dashboard and the User Payment Table as the lowest-level dashboard. After selecting the dashboard, the corresponding dataset can be selected through input boxes and drop-down menus. Related indicators (such as payment table amount and difference amount) and dimensions (such as payment channel and merchant ID) can be searched through indicator input and dimension input boxes. Data indicators are configured based on the dataset, indicators, and dimensions.

[0060] In this invention, datasets and tables can be dragged and dropped directly in the relevant configuration interface to configure anomaly detection directly, which greatly improves work efficiency. The entire configuration process depends on the data synchronization efficiency.

[0061] The task module 202 is used to obtain historical data of the business system within a preset time period after receiving the business system test instruction sent by the client, initialize the historical data, create a scheduling task based on the initialized historical data, execute the scheduling task, and synchronize the initialized historical data to the data table to be tested.

[0062] The step of acquiring historical data within a preset time period from the business system and initializing the historical data includes:

[0063] According to the test instructions, the corresponding historical data is filtered from the preset dataset or database table;

[0064] Historical data selected from at least one dataset or database table is integrated and transformed into the data format of the initial data table. The transformed historical data is then imported into the initial data table for data preparation for anomaly detection.

[0065] Specifically, the step of creating a scheduling task based on initialized historical data and executing the scheduling task includes:

[0066] After the historical data is initialized, a full scheduling task is created, and the full scheduling task is executed immediately after recording its unique identifier, so as to import the historical data as full data into the initial data table.

[0067] Create an incremental scheduling task and determine whether there is a data task with a prerequisite dependency relationship corresponding to the incremental scheduling task.

[0068] If not, the incremental scheduling task is executed directly to obtain the corresponding scheduling time period according to the preset cron expression, and the data within the scheduling time period is imported into the initial data table as incremental data.

[0069] If so, the data task is executed. After the data task is completed, the incremental scheduling task is executed to obtain the corresponding scheduling time period according to the preset cron expression, and the data within the scheduling time period is imported into the initial data table as incremental data.

[0070] Further, after executing the full scheduling task, the process includes:

[0071] After the full scheduling task is completed, the execution result is imported into a preset notification template, an execution result notification is generated, and the execution result notification is sent to the test terminal.

[0072] After the full scheduling task and the incremental scheduling task are completed, the incremental scheduling task is run at preset time intervals.

[0073] Further, after executing the incremental scheduling task, the process includes:

[0074] When the incremental scheduling task is executed successfully, the data table to be detected is obtained through the RocketMQ message middleware based on the configuration information for initial anomaly detection.

[0075] Furthermore, the initial anomaly detection performed by obtaining the data table to be detected through the RocketMQ message middleware includes:

[0076] Receive the middleware message of the incremental scheduling task, extract the full data and incremental data, and detect several windows past a preset time point in the full data and incremental data;

[0077] The index values ​​corresponding to the time points are input into the pre-selected model for parallel computation, and the results of the parallel computation are used for rule calculation based on the anomaly algorithm configuration information.

[0078] The result of the rule calculation is stored on the server, and a determination is made as to whether an alarm is needed based on the rule calculation result and alarm rule configuration information.

[0079] In one embodiment, the full data preparation can be data from a period prior to the execution of the full scheduling task. For example, if the full scheduling task is executed at 00:00 on February 11, 2022, the full data can be data from the 10 days prior to 00:00 on February 1, 2022, i.e., data from 00:00 on February 1, 2022 to 00:00 on February 11, 2022. The scheduling time period can be freely set, such as 1 hour or 2 hours. When the scheduling time period is set to 1 hour, the data between 00:00 on February 11, 2022 and 01:00 on February 11, 2022 will be incrementally updated as incremental data. The preset time interval should be less than or equal to the scheduling time period.

[0080] In another embodiment, the full data is the data from 00:00 on October 1, 2022 to 00:00 on October 11, 2022. When the scheduling time period is set to 1 hour, the data between 00:00 on February 11, 2022 and 01:00 on February 11, 2022 will be updated incrementally as incremental data.

[0081] In one embodiment, the test interface can provide time settings to query data within a relevant time period (e.g., query data from October 2023 to January 2024), and provides comparison data, which is ideal data. By comparing the anomaly detection results of the two types of data, the reasonableness of the configuration rules in the current configuration information is verified. When the comparison results of the two anomaly detection results meet expectations, the configuration rules are saved to the server and applied in subsequent anomaly detections.

[0082] In one embodiment, if the data is processed in 5-minute windows, and the current detection time is 10:00:00 on January 24, 2024, then there are n = 3 * 60 / 5 = 36 windows in the past 3 hours. Then, data and corresponding indicator values ​​from the windows between 07:00:00 and 10:00:00 each day of the past 120 days are taken and fed into the model as input parameters. The model is user-selectable, including quantile models, probability models, and indicator value models, and can be chosen from the evaluation indicators on the detection rule interface. Users can also configure the relationships between model calculation results in the rule detection interface, such as AND or OR, and perform rule calculations based on these relationships.

[0083] In one embodiment, the incremental scheduling task corresponds to a related prerequisite task, which is dependent on the incremental data preparation scheduling task. The incremental data preparation scheduling task can only be executed after the prerequisite task is completed.

[0084] In one embodiment, the execution result notification only provides a brief execution result. After receiving the execution result notification, the user on the test end can click on the link to enter the relevant interface to view the detailed execution result information.

[0085] In this invention, data anomaly detection is triggered immediately upon completion of data preparation, which has good timeliness.

[0086] The detection module 203 is used to perform initial anomaly detection on the data table to be detected based on the configuration information to obtain anomaly detection results, and to feed back the anomaly detection results to the client.

[0087] Specifically, after the anomaly detection result is fed back to the client, the process includes:

[0088] The incremental data of the business system is periodically checked according to the configuration information.

[0089] Furthermore, the client provides an alarm escalation mechanism and a feedback mechanism, which automatically escalates alarms and supports receiving abnormal feedback information from the client, allowing the client to reset alarm information.

[0090] In this invention, the method supports a combination of multiple machine learning algorithms and can be rapidly expanded.

[0091] This invention relates to the field of computers and provides a data anomaly detection method. The method includes: receiving configuration information from a management terminal for data anomaly detection of a business system; storing the configuration information in a preset database table; the configuration information including data indicators, anomaly rules, and alarm rules; upon receiving a business system test command from a client, acquiring historical data within a preset time period of the business system and initializing the historical data; creating a scheduling task based on the initialized historical data; executing the scheduling task; synchronizing the initialized historical data to a data table to be tested; performing initial anomaly detection on the data table to be tested based on the configuration information to obtain anomaly detection results; and feeding back the anomaly detection results to the client. This invention, through data preparation and rule configuration, enables flexible data anomaly detection, improving the overall performance of the system.

[0092] Reference Figure 3 The diagram shown is a flowchart illustrating an embodiment of the data anomaly detection method of the present invention. In this embodiment, when the processor 12 of the electronic device 10 executes the data anomaly detection program in the memory 11, it implements the following steps of the data anomaly detection method:

[0093] Step S301: Receive configuration information for data anomaly detection in the business system sent by the management terminal, and store the configuration information in a preset database table. The configuration information includes data indicators, anomaly rules, and alarm rules.

[0094] In one embodiment, the management terminal can provide a configuration indicator interface, a detection rule interface, and an alarm rule interface. The management terminal can provide drop-down, drag-and-drop, and form-filling methods for selection and settings in each interface. Data indicator configuration information is obtained by the management terminal through the configuration indicator interface, anomaly rule configuration information is obtained by the management terminal through the detection rule interface, and alarm rule configuration information is obtained by the management terminal through the alarm rule interface. Anomaly detection configuration information may include alarm triggering conditions, data comparison type, comparison method, threshold, and rule execution cycle, etc.

[0095] In one embodiment, the business system is a financial payment system, where the data indicators can be the amount on the third-party platform and the number of transactions involved. The anomaly detection rule can be that when the quantile of the change value of the amount on the third-party platform is greater than or equal to 1, the data is considered abnormal. The alarm rule can be that the alarm level for the data anomaly involving the number of transactions is set to "urgent", the alarm method is "email", and the relevant parties to the alarm are "responder: Zhang, escalation list: Li, person in charge: Wang, duty officer: Zhao" (the alarm information is sent to the relevant parties via email).

[0096] In one embodiment, the dashboard "Finance Department > Accounting and Tax Center > User Payment Table" can be selected through the indicator configuration interface, with the Finance Department as the highest-level dashboard and the User Payment Table as the lowest-level dashboard. After selecting the dashboard, the corresponding dataset can be selected through input boxes and drop-down menus. Related indicators (such as payment table amount and difference amount) and dimensions (such as payment channel and merchant ID) can be searched through indicator input and dimension input boxes. Data indicators are configured based on the dataset, indicators, and dimensions.

[0097] In this invention, datasets and tables can be dragged and dropped directly in the relevant configuration interface to configure anomaly detection directly, which greatly improves work efficiency. The entire configuration process depends on the data synchronization efficiency.

[0098] Step S302 is used to obtain historical data of the business system within a preset time period after receiving the business system test instruction sent by the client, initialize the historical data, create a scheduling task based on the initialized historical data, execute the scheduling task, and synchronize the initialized historical data to the data table to be tested.

[0099] The step of acquiring historical data within a preset time period from the business system and initializing the historical data includes:

[0100] According to the test instructions, the corresponding historical data is filtered from the preset dataset or database table;

[0101] Historical data selected from at least one dataset or database table is integrated and transformed into the data format of the initial data table. The transformed historical data is then imported into the initial data table for data preparation for anomaly detection.

[0102] Specifically, the step of creating a scheduling task based on initialized historical data and executing the scheduling task includes:

[0103] After the historical data is initialized, a full scheduling task is created, and the full scheduling task is executed immediately after recording its unique identifier, so as to import the historical data as full data into the initial data table.

[0104] Create an incremental scheduling task and determine whether there is a data task with a prerequisite dependency relationship corresponding to the incremental scheduling task.

[0105] If not, the incremental scheduling task is executed directly to obtain the corresponding scheduling time period according to the preset cron expression, and the data within the scheduling time period is imported into the initial data table as incremental data.

[0106] If so, the data task is executed. After the data task is completed, the incremental scheduling task is executed to obtain the corresponding scheduling time period according to the preset cron expression, and the data within the scheduling time period is imported into the initial data table as incremental data.

[0107] Further, after executing the full scheduling task, the process includes:

[0108] After the full scheduling task is completed, the execution result is imported into a preset notification template, an execution result notification is generated, and the execution result notification is sent to the test terminal.

[0109] After the full scheduling task and the incremental scheduling task are completed, the incremental scheduling task is run at preset time intervals.

[0110] Further, after executing the incremental scheduling task, the process includes:

[0111] When the incremental scheduling task is executed successfully, the data table to be detected is obtained through the RocketMQ message middleware based on the configuration information for initial anomaly detection.

[0112] Furthermore, the initial anomaly detection performed by obtaining the data table to be detected through the RocketMQ message middleware includes:

[0113] Receive the middleware message of the incremental scheduling task, extract the full data and incremental data, and detect several windows past a preset time point in the full data and incremental data;

[0114] The index values ​​corresponding to the time points are input into the pre-selected model for parallel computation, and the results of the parallel computation are used for rule calculation based on the anomaly algorithm configuration information.

[0115] The result of the rule calculation is stored on the server, and a determination is made as to whether an alarm is needed based on the rule calculation result and alarm rule configuration information.

[0116] In one embodiment, the full data preparation can be data from a period prior to the execution of the full scheduling task. For example, if the full scheduling task is executed at 00:00 on February 11, 2022, the full data can be data from the 10 days prior to 00:00 on February 1, 2022, i.e., data from 00:00 on February 1, 2022 to 00:00 on February 11, 2022. The scheduling time period can be freely set, such as 1 hour or 2 hours. When the scheduling time period is set to 1 hour, the data between 00:00 on February 11, 2022 and 01:00 on February 11, 2022 will be incrementally updated as incremental data. The preset time interval should be less than or equal to the scheduling time period.

[0117] In another embodiment, the full data is the data from 00:00 on October 1, 2022 to 00:00 on October 11, 2022. When the scheduling time period is set to 1 hour, the data between 00:00 on February 11, 2022 and 01:00 on February 11, 2022 will be updated incrementally as incremental data.

[0118] In one embodiment, the test interface can provide time settings to query data within a relevant time period (e.g., query data from October 2023 to January 2024), and provides comparison data, which is ideal data. By comparing the anomaly detection results of the two types of data, the reasonableness of the configuration rules in the current configuration information is verified. When the comparison results of the two anomaly detection results meet expectations, the configuration rules are saved to the server and applied in subsequent anomaly detections.

[0119] In one embodiment, if the data is processed in 5-minute windows, and the current detection time is 10:00:00 on January 24, 2024, then there are n = 3 * 60 / 5 = 36 windows in the past 3 hours. Then, data and corresponding indicator values ​​from the windows between 07:00:00 and 10:00:00 each day of the past 120 days are taken and fed into the model as input parameters. The model is user-selectable, including quantile models, probability models, and indicator value models, and can be chosen from the evaluation indicators on the detection rule interface. Users can also configure the relationships between model calculation results in the rule detection interface, such as AND or OR, and perform rule calculations based on these relationships.

[0120] In one embodiment, the incremental scheduling task corresponds to a related prerequisite task, which is dependent on the incremental data preparation scheduling task. The incremental data preparation scheduling task can only be executed after the prerequisite task is completed.

[0121] In one embodiment, the execution result notification only provides a brief execution result. After receiving the execution result notification, the user on the test end can click on the link to enter the relevant interface to view the detailed execution result information.

[0122] In this invention, data anomaly detection is triggered immediately upon completion of data preparation, which has good timeliness.

[0123] Step S303 is used to perform initial anomaly detection on the data table to be detected based on the configuration information to obtain anomaly detection results, and to feed back the anomaly detection results to the client.

[0124] Specifically, after the anomaly detection result is fed back to the client, the process includes:

[0125] The incremental data of the business system is periodically checked according to the configuration information.

[0126] Furthermore, the client provides an alarm escalation mechanism and a feedback mechanism, which automatically escalates alarms and supports receiving abnormal feedback information from the client, allowing the client to reset alarm information.

[0127] In this invention, the method supports a combination of multiple machine learning algorithms and can be rapidly expanded.

[0128] This invention relates to the field of computers and provides a data anomaly detection method. The method includes: receiving configuration information from a management terminal for data anomaly detection of a business system; storing the configuration information in a preset database table, the configuration information including data indicators, anomaly rules, and alarm rules; upon receiving a business system test command from a client, acquiring historical data within a preset time period of the business system and initializing the historical data; creating a scheduling task based on the initialized historical data; executing the scheduling task to synchronize the initialized historical data to a data table to be tested; performing initial anomaly detection on the data table to be tested based on the configuration information to obtain anomaly detection results; and feeding back the anomaly detection results to the client. This invention, through data preparation and rule configuration, enables flexible data anomaly detection, improving the overall performance of the system.

[0129] Furthermore, this invention also proposes a computer-readable storage medium, which can be any one or any combination of several of the following: hard disk, multimedia card, SD card, flash memory card, SMC, read-only memory (ROM), erasable programmable read-only memory (EPROM), portable compact disc read-only memory (CD-ROM), USB memory, etc. The computer-readable storage medium includes a data anomaly detection program, which, when executed by a processor, performs the following operations:

[0130] S1. Receive configuration information for data anomaly detection in the business system sent by the management terminal, and store the configuration information in a preset database table. The configuration information includes data indicators, anomaly rules, and alarm rules.

[0131] S2. After receiving the business system test instruction sent by the client, obtain the historical data of the business system within a preset time period and initialize the historical data, create a scheduling task based on the initialized historical data, execute the scheduling task, and synchronize the initialized historical data to the data table to be tested.

[0132] S3. Based on the configuration information, perform initial anomaly detection on the data table to be detected to obtain anomaly detection results, and feed back the anomaly detection results to the client.

[0133] The specific implementation of the computer-readable storage medium of the present invention is largely the same as the specific implementation of the data anomaly detection method and the electronic device 10 described above, and will not be repeated here.

[0134] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0135] The sequence numbers of the above embodiments of the present invention are merely for description and do not represent the superiority or inferiority of the embodiments. Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0136] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A data anomaly detection method applied to a server, characterized in that, The method includes: S1. Receive configuration information for data anomaly detection in the business system sent by the management terminal, and store the configuration information in a preset database table. The configuration information includes data indicators, anomaly rules, and alarm rules. S2. After receiving the business system test instruction sent by the client, obtain the historical data of the business system within a preset time period and initialize the historical data, create a scheduling task based on the initialized historical data, execute the scheduling task, and synchronize the initialized historical data to the data table to be tested. S3. Based on the configuration information, perform initial anomaly detection on the data table to be detected to obtain anomaly detection results, and feed the anomaly detection results back to the client; The step of creating a scheduling task based on initialized historical data and executing the scheduling task includes: After the historical data is initialized, a full scheduling task is created, and the full scheduling task is executed immediately after recording its unique identifier, so as to import the historical data as full data into the initial data table. Create an incremental scheduling task and determine whether there is a data task with a prerequisite dependency relationship corresponding to the incremental scheduling task. If not, the incremental scheduling task is executed directly to obtain the corresponding scheduling time period according to the preset cron expression, and the data within the scheduling time period is imported into the initial data table as incremental data. If so, the data task is executed. After the data task is completed, the incremental scheduling task is executed to obtain the corresponding scheduling time period according to the preset cron expression, and the data within the scheduling time period is imported into the initial data table as incremental data.

2. The data anomaly detection method of claim 1, wherein, After the anomaly detection result is fed back to the client, the following steps are included: The incremental data of the business system is periodically checked according to the configuration information.

3. The data anomaly detection method of claim 1, wherein, The step of acquiring historical data within a preset time period from the business system and initializing the historical data includes: According to the test instructions, the corresponding historical data is filtered from the preset dataset or database table; Historical data selected from at least one dataset or database table is integrated and transformed into the data format of the initial data table. The transformed historical data is then imported into the initial data table for data preparation for anomaly detection.

4. The data anomaly detection method of claim 1, wherein, After executing the full scheduling task, the following is included: After the full scheduling task is completed, the execution result is imported into a preset notification template, an execution result notification is generated, and the execution result notification is sent to the test terminal. After the full scheduling task and the incremental scheduling task are completed, the incremental scheduling task is run at preset time intervals.

5. The data anomaly detection method of claim 1, wherein, After executing the incremental scheduling task, the process includes: When the incremental scheduling task is executed successfully, the data table to be detected is obtained through the RocketMQ message middleware based on the configuration information for initial anomaly detection.

6. The data anomaly detection method of claim 5, wherein, The initial anomaly detection, performed by obtaining the data table to be detected through the RocketMQ message middleware, includes: Receive the middleware message of the incremental scheduling task, extract the full data and incremental data, and detect several windows past a preset time point in the full data and incremental data; The index values ​​corresponding to the time points are input into the pre-selected model for parallel computation, and the results of the parallel computation are used to perform rule calculation based on the configuration information of the anomaly rules. The result of the rule calculation is stored on the server, and a determination is made on whether an alarm is needed based on the result of the rule calculation and the alarm rule configuration information. 7.A data anomaly detection apparatus for implementing the data anomaly detection method according to any one of claims 1 to 6, characterized by, The device includes: The receiving module is used to receive configuration information for data anomaly detection in the business system sent by the management terminal, and store the configuration information in a preset database table. The configuration information includes data indicators, anomaly rules and alarm rules. The task module is used to obtain historical data of the business system within a preset time period after receiving the business system test instruction sent by the client, initialize the historical data, create a scheduling task based on the initialized historical data, execute the scheduling task, and synchronize the initialized historical data to the data table to be tested. The detection module is used to perform initial anomaly detection on the data table to be detected based on the configuration information, obtain anomaly detection results, and feed back the anomaly detection results to the client.

8. An electronic device, comprising: The electronic device includes a memory and a processor. The memory stores a data anomaly detection program, which, when executed by the processor, implements the data anomaly detection method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a data anomaly detection program, which, when executed by a processor, implements the data anomaly detection method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data monitoring system and method and server

    CN110297742A

  • Transaction data abnormal information detection method and device and electronic equipment

    CN117688491A