Bayesian rule-based data recovery method, apparatus and device, and medium
Through Bayesian law, the exception probability is calculated and the repair method is automatically matched, the problem of low exception handling efficiency in Internet systems is solved, rapid automated processing is realized, and exception handling efficiency is improved.
Patent Information
- Application Number
- CN202411097525.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-13
AI Technical Summary
When an exception occurs during the operation of the Internet system, the manual processing efficiency is low, resulting in a long time for exception processing.
The data repair method based on Bayesian law is adopted to obtain historical data, calculate the probability of exceptions, automatically identify the exception types and match the repair method, and realize automated processing.
Quickly determine the location of the exception, improve the efficiency of exception handling and shorten the time to solve business exceptions.
Smart Images

Figure CN119127542A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data repair technology, and in particular to a data repair method, device, equipment and medium based on Bayesian law. Background Art
[0002] In the Internet age, there are many types of systems that use Internet technology. However, each Internet system will inevitably have exceptions during operation. A small exception will cause the system to be unable to operate at a normal speed. Usually, after an exception occurs in the system, the staff will query the exception log through the operation and maintenance tools, analyze and locate the cause of the problem based on the exception log, and then manually handle the exception, which takes a long time to handle the exception and is inefficient. Summary of the invention
[0003] The purpose of the present invention is to provide a data repair method, device, equipment and medium based on Bayes' theorem to improve the above problems. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0004] In a first aspect, the present application provides a data repair method based on Bayes' theorem, comprising:
[0005] Obtain historical data of the target business within the historical time period;
[0006] Running the target business to obtain target operation data;
[0007] Based on the Bayesian formula and the historical data, the abnormal probability of the target operation data is calculated to obtain an abnormal probability value, where the abnormal probability value is used to characterize the probability that the target business will be abnormal after the target operation data is abnormal;
[0008] Comparing the abnormal probability value with a first set threshold;
[0009] When the abnormal probability value is greater than the first set threshold, storing the target operation data into a target table, and determining the corresponding target abnormal type;
[0010] Based on the target abnormality type, a corresponding abnormality repair method is determined, and repair is performed to obtain target data.
[0011] In a second aspect, the present application also provides a data repair device based on the Bayesian rule, comprising:
[0012] A first acquisition unit, used to acquire historical data of a target business within a historical time period;
[0013] An operation unit, used for operating the target service and obtaining target operation data;
[0014] A first calculation unit, configured to calculate the abnormal probability of the target operation data based on the Bayesian formula and the historical data, and obtain an abnormal probability value, wherein the abnormal probability value is used to characterize the probability that the target business will be abnormal after the target operation data is abnormal;
[0015] A first comparison unit, used for comparing the abnormal probability value with a first set threshold;
[0016] A first storage unit, configured to store the target operation data in a target table and determine a corresponding target abnormality type when the abnormal probability value is greater than the first set threshold value;
[0017] The first repair unit is used to determine a corresponding abnormality repair method based on the target abnormality type, and perform repair to obtain target data.
[0018] In a third aspect, the present application also provides a data repair device based on the Bayesian rule, comprising:
[0019] Memory for storing computer programs;
[0020] A processor is used to implement the steps of the data repair method based on the Bayesian rule when executing the computer program.
[0021] In a fourth aspect, the present application further provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned data repair method based on the Bayesian law are implemented.
[0022] The beneficial effects of the present invention are:
[0023] Based on the Bayesian theorem, the present invention can quickly determine the location of the exception after the system fails to operate normally, and automatically match the processing method required for the exception, thereby automatically processing and repairing the exception, which can solve the problem of business exceptions in a relatively short time and improve the efficiency of exception processing.
[0024] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A schematic diagram of a data repair method based on the Bayesian rule described in an embodiment of the present invention;
[0027] Figure 2 Schematic diagram of the structure of a data repair device based on the Bayesian rule described in an embodiment of the present invention;
[0028] Figure 3 Schematic diagram of the structure of a data repair device based on the Bayesian principle described in an embodiment of the present invention.
[0029] Markings in the figure:
[0030] 100, first acquisition unit; 200, operation unit; 300, first calculation unit; 400, first comparison unit; 500, first storage unit; 600, first repair unit; 101, second acquisition unit; 102, first operation unit; 103, second operation unit; 104, third operation unit; 105, fourth operation unit; 301, first determination unit; 302, second calculation unit; 303, second determination unit; 304, third determination unit; 305, third calculation unit; 306, fourth calculation unit; 307, fifth calculation unit; 308, sixth calculation unit element; 501, matching unit; 502, second comparison unit; 503, second storage unit; 504, input unit; 505, third storage unit; 601, fourth determination unit; 602, fifth determination unit; 603, sixth determination unit; 604, seventh calculation unit; 605, eighth calculation unit; 606, ninth calculation unit; 607, tenth calculation unit; 608, third comparison unit; 609, second repair unit; 610, first processing unit; 611, second processing unit; 612, third processing unit; 613, fourth processing unit; 614, replacement unit;
[0031] 800. Data repair device based on Bayes' theorem; 801. Processor; 802. Memory; 803. Multimedia component; 804. I / O interface; 805. Communication component. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0033] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0034] Embodiment 1:
[0035] This embodiment provides a data repair method based on Bayesian law.
[0036] See also Figure 1 , the figure shows that the method includes step S100, step S200, step S300, step S400, step S500 and step S600.
[0037] Step S100. Obtain historical data of the target business within a historical time period;
[0038] Specifically, the number of times the target business is run in a historical time period and the corresponding historical data generated during each run are obtained.
[0039] Specifically, step S100 specifically includes:
[0040] Step S101. Obtain all initial data of the target business within the historical time period;
[0041] Step S102: Perform a cleaning operation on the initial data to obtain first data;
[0042] Specifically, the cleaning operation is used to remove invalid data and duplicate data. Invalid data includes incomplete, inaccurate or unavailable data, delete duplicate records, and ensure that each piece of data is unique.
[0043] Step S103. Perform a missing value processing operation on the first data to obtain second data;
[0044] Specifically, the missing values in the first data are first checked to determine which fields have missing data, and then the missing values are filled. The methods for filling missing values for different types of data are different. For numerical data, statistical indicators such as mean, median, etc. can be used to fill missing values; for categorical data, the mode can be used to fill, and interpolation methods or prediction models based on other relevant features can also be used to fill. There is no special limitation here.
[0045] Step S104: Perform a format conversion operation on the second data to obtain third data;
[0046] Specifically, data type conversion and standardization are performed on the second data to ensure that each field has a correct data type and that the data is within the same scale range.
[0047] Step S105: Perform a smoothing operation on the third data to obtain historical data.
[0048] Specifically, the third data is smoothed to reduce the influence of random noise.
[0049] Step S200. Run the target business and obtain target operation data;
[0050] Step S300. Based on the Bayesian formula and historical data, the abnormal probability of the target operation data is calculated to obtain an abnormal probability value, which is used to characterize the probability that the target business will be abnormal after the target operation data is abnormal;
[0051] Specifically, step S300 specifically includes:
[0052] Step S301. Determine the historical operation times and historical abnormal times of the target business based on historical data;
[0053] Step S302. Calculate the ratio of the historical abnormal number of times to the historical running number of times to obtain a first probability value;
[0054] Step S303. Determine the total number of times all data are abnormal from the historical data to obtain the first number;
[0055] Step S304. Determine the target historical data corresponding to the target operating data from the historical data, and determine the number of times the target historical data is abnormal, and obtain a second number;
[0056] Step S305. Based on the second number and the number of historical abnormalities, a second probability value is calculated;
[0057] Step S306. Calculate the ratio of the second number to the first number to obtain a third probability value;
[0058] Step S307. Calculate the product of the first probability value and the second probability value to obtain a first calculation result;
[0059] Step S308. Calculate the ratio of the first calculation result to the third probability value to obtain an abnormal probability value;
[0060] Specifically, firstly, based on historical data, the prior probability that the target operation data is abnormal is calculated. Secondly, based on historical data, the probability that the target business is abnormal when the target data is abnormal is calculated as the likelihood probability. Then, based on the ratio of the total number of target business operations and the number of abnormalities, the probability that the target business is abnormal is obtained. Finally, based on the above probabilities, the posterior probability of the target operation data when the target business is abnormal at the current moment is obtained. The larger the posterior probability, the greater the possibility that the target operation data is abnormal. The specific calculation formula is:
[0061]
[0062] Among them, P(A|B) is the probability that the target operation data will also be abnormal when the target business is abnormal; P(B|A) is the probability that the target business will also be abnormal when the target operation data is abnormal; P(A) is the probability that the target operation data will be abnormal; P(B) is the probability that the target business will be abnormal.
[0063] Step S400. Compare the abnormal probability value with a first set threshold;
[0064] Specifically, by setting a suitable threshold and comparing the posterior probability with the set threshold, it is possible to accurately determine whether the target operating data is actually abnormal.
[0065] Step S500. When the abnormal probability value is greater than the first set threshold, the target operation data is stored in the target table, and the corresponding target abnormal type is determined;
[0066] Specifically, determining the type and cause of abnormal operation data is a key step in exception handling, which helps to adopt appropriate processing strategies for different types of exceptions, and store the abnormal operation data and exception type corresponding to the target business in the target table. By setting a timed work, the data in the target table is searched in rounds. Since the data stored in the target table are all abnormal operation data corresponding to the target business, the work does not need to search all the data of all businesses in the system, but only searches the abnormal data corresponding to the target business in the system, which can improve the time for the work to search the target business and improve the efficiency of the work's search for exceptions.
[0067] Specifically, step S500 specifically includes:
[0068] Step S501. Match the target operation data with the pre-set exception rules to obtain a matching result, which represents the matching degree between the target operation data and multiple exception categories in the exception rules;
[0069] Step S502. Compare the matching result with a second set threshold;
[0070] Step S503. When the matching result is greater than the second set threshold, the target operation data is matched with the abnormal category corresponding to the matching result and stored in the target table;
[0071] Specifically, the type of abnormal data can be further determined based on pre-set business rules. Business rules are an understanding of business processes and can help identify certain specific types of anomalies, such as whether the value of a field complies with business regulations.
[0072] Step S504. When the comparison result is less than the second set threshold, the target operation data is input into a preset abnormal classification model to obtain an abnormal classification result;
[0073] Step S505. Match the abnormal classification results with the target operation data and store them in the target table;
[0074] Specifically, for target operation data whose abnormal types are difficult to identify through business rules, the types of abnormal data can be automatically classified through a model trained based on historical data, so that the abnormal types of most target operation data can be accurately classified.
[0075] Step S600. Determine the corresponding abnormality repair method based on the target abnormality type, and perform repair to obtain target data;
[0076] Specifically, when the scheduled work round finds the target business in the target table, it can determine whether the pre-stored repair table has a data repair plan corresponding to the exception type stored in it, based on the exception type corresponding to the target business. If so, the work can repair the abnormal data corresponding to the target business according to the repair plan corresponding to the exception type; if not, the target business is pushed to the terminal corresponding to the technician so that the technician can repair the abnormal data corresponding to the target business through manual repair, and the manual data repair plan can be stored in the repair table so that when the same or similar problems occur in the future, automatic repair can be achieved to improve the repair efficiency.
[0077] Specifically, step S600 includes:
[0078] Step S601. Determine all abnormal types from historical data and obtain abnormal type values;
[0079] Step S602. Determine the total number of times all repair methods are used from historical data to obtain the third number;
[0080] Step S603. Determine the target repair method corresponding to the target abnormality type from the historical data, and determine the number of times the target repair method is used to obtain a fourth number;
[0081] Step S604. Calculate the ratio of the fourth number to the third number to obtain a fourth probability value;
[0082] Step S605. Based on the fourth number and the abnormal type value, a fifth probability value is calculated;
[0083] Step S606. Calculate the product of the fifth probability value and the fourth probability value to obtain a second calculation result;
[0084] Step S607. Calculate the ratio of the second calculation result to the first probability value to obtain the repair probability value of the target repair method;
[0085] Step S608. Compare the repair probability value with a third set threshold;
[0086] Step S609. When the repair probability value is greater than the third set threshold, the target operation data is repaired based on the target repair method to obtain the target data;
[0087] Specifically, in order to improve the efficiency of searching for anomaly repair methods, this application adopts the Bayesian rule for calculation, and the specific calculation formula is:
[0088]
[0089] Among them, P(C|A) is the probability of using the target repair method when the target operation data is abnormal; P(A|C) is the probability of using the target repair method when the target operation data is abnormal; P(A) is the probability of the target operation data being abnormal; P(C) is the probability of using the target repair method;
[0090] The larger the calculated value of P(C|A), the greater the possibility that the target repair method will be used to repair the target operating data.
[0091] Specifically, in order to ensure that the target data after repair can continue to be brought into the target business and continue to run, it is necessary to ensure the consistency of the target data after repair and the target running data.
[0092] Step S610. Perform field verification processing on the target data based on a preset verification standard to obtain a first verification result;
[0093] Specifically, each field of the target data is validated to ensure that its data type, length, format, etc. meet expectations. For example, whether the date field contains a valid date, whether the numeric field is within a reasonable range, and whether the string field meets the format requirements.
[0094] Step S611. When the first verification result satisfies the first set condition, the target data is recorded and verified based on the inspection standard to obtain a second verification result;
[0095] Specifically, ensure that each record of the target data meets the uniqueness requirement and no duplicate records appear.
[0096] Step S612. When the second verification result satisfies the second set condition, the target data is subjected to business rule verification based on the inspection standard to obtain a third verification result;
[0097] Specifically, according to business rules, verify whether the target data meets the expectations of business logic, for example, whether the values of certain fields meet the conditions specified by the business, and whether the combination of fields meets the business rules.
[0098] Step S613. When the third verification result satisfies the third set condition, an abnormal verification process is performed on the target data based on the inspection standard to obtain a fourth verification result;
[0099] Specifically, statistical methods or machine learning techniques are used to detect outliers in the target data and ensure that the existence of outliers is reasonable.
[0100] Step S614: When the fourth verification result satisfies the fourth setting condition, the target operation data is replaced with the target data.
[0101] Specifically, when the target data meets the above verification, the data corresponding to the target business in the target table can be updated, that is, the data corresponding to the target business is the repaired target data, so that the target business continues to run according to the matching repaired data, and it is convenient for subsequent technical personnel to determine which part of the system is more likely to have an abnormality based on the data in the target table, and improve that part.
[0102] Embodiment 2:
[0103] like Figure 2 As shown, this embodiment provides a data repair device based on the Bayesian rule, the device comprising:
[0104] The first acquisition unit 100 is used to acquire historical data of a target business within a historical time period;
[0105] The operation unit 200 is used to operate the target business and obtain target operation data;
[0106] The first calculation unit 300 is used to calculate the abnormal probability of the target operation data based on the Bayesian formula and historical data to obtain an abnormal probability value, where the abnormal probability value is used to characterize the probability that the target business will be abnormal after the target operation data is abnormal;
[0107] A first comparison unit 400, configured to compare the abnormal probability value with a first set threshold;
[0108] The first storage unit 500 is used to store the target operation data into the target table and determine the corresponding target abnormality type when the abnormal probability value is greater than the first set threshold value;
[0109] The first repairing unit 600 is used to determine a corresponding abnormality repair method based on a target abnormality type, and perform repair to obtain target data.
[0110] In a specific implementation disclosed in the present application, the first computing unit 300 includes:
[0111] A first determining unit 301 is used to determine the historical operation times and the historical abnormal times of the target business based on the historical data;
[0112] The second calculation unit 302 is used to calculate the ratio of the historical abnormal number of times to the historical running number of times to obtain a first probability value;
[0113] The second determining unit 303 is used to determine the total number of times all data are abnormal from the historical data to obtain the first number;
[0114] The third determining unit 304 is used to determine the target historical data corresponding to the target operating data from the historical data, and determine the number of times the target historical data is abnormal, to obtain a second number;
[0115] The third calculation unit 305 is used to calculate a second probability value based on the second number and the historical abnormal number;
[0116] The fourth calculation unit 306 is used to calculate the ratio of the second number to the first number to obtain a third probability value;
[0117] A fifth calculation unit 307, configured to calculate the product of the first probability value and the second probability value to obtain a first calculation result;
[0118] The sixth calculation unit 308 is used to calculate the ratio of the first calculation result to the third probability value to obtain an abnormal probability value.
[0119] In a specific implementation disclosed in the present application, the first storage unit 500 includes:
[0120] A matching unit 501 is used to match the target operation data with a preset anomaly rule to obtain a matching result, wherein the matching result represents a matching degree between the target operation data and a plurality of anomaly categories in the anomaly rule;
[0121] A second comparison unit 502, configured to compare the matching result with a second set threshold;
[0122] The second storage unit 503 is used to match the target operation data with the abnormal category corresponding to the matching result when the matching result is greater than the second set threshold, and store it in the target table;
[0123] An input unit 504 is used to input the target operation data into a preset abnormal classification model to obtain an abnormal classification result when the comparison result is less than a second set threshold;
[0124] The third storage unit 505 is used to match the abnormal classification result with the target operation data and store them in the target table.
[0125] In a specific embodiment disclosed in the present application, the first repair unit 600 includes:
[0126] The fourth determining unit 601 is used to determine all abnormal types from the historical data and obtain abnormal type values;
[0127] A fifth determining unit 602 is used to determine the total number of times all the repair methods are used from the historical data to obtain a third number;
[0128] The sixth determining unit 603 is used to determine the target repair method corresponding to the target abnormality type from the historical data, and determine the number of times the target repair method is used to obtain a fourth number;
[0129] A seventh calculation unit 604 is used to calculate the ratio of the fourth number to the third number to obtain a fourth probability value;
[0130] An eighth calculation unit 605 is used to calculate a fifth probability value based on the fourth number of times and the abnormal type value;
[0131] A ninth calculation unit 606, configured to calculate the product of the fifth probability value and the fourth probability value to obtain a second calculation result;
[0132] A tenth calculation unit 607 is used to calculate the ratio of the second calculation result to the first probability value to obtain a repair probability value of the target repair method;
[0133] A third comparison unit 608, configured to compare the repair probability value with a third set threshold;
[0134] The second repairing unit 609 is used to repair the target operating data based on the target repair method to obtain target data when the repair probability value is greater than a third set threshold.
[0135] In a specific implementation manner disclosed in the present application, the first repair unit 600 further includes:
[0136] The first processing unit 610 is used to perform field verification processing on the target data based on a preset verification standard to obtain a first verification result;
[0137] The second processing unit 611 is used to perform record verification processing on the target data based on the inspection standard to obtain a second verification result when the first verification result meets the first set condition;
[0138] The third processing unit 612 is used to perform business rule verification processing on the target data based on the inspection standard to obtain a third verification result when the second verification result meets the second set condition;
[0139] The fourth processing unit 613 is used to perform abnormal verification processing on the target data based on the inspection standard to obtain a fourth verification result when the third verification result meets the third set condition;
[0140] The replacing unit 614 is configured to replace the target operating data with the target data when the fourth verification result satisfies a fourth setting condition.
[0141] In a specific implementation manner disclosed in the present application, the first acquisition unit 100 includes:
[0142] The second acquisition unit 101 is used to acquire all initial data of the target business in the historical time period;
[0143] A first operation unit 102 is used to perform a cleaning operation on the initial data to obtain first data;
[0144] A second operation unit 103 is used to perform a missing value processing operation on the first data to obtain second data;
[0145] A third operation unit 104 is used to perform a format conversion operation on the second data to obtain third data;
[0146] The fourth operating unit 105 is used to perform a smoothing operation on the third data to obtain historical data.
[0147] It should be noted that, regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0148] Embodiment 3:
[0149] Corresponding to the above method embodiment, this embodiment also provides a data repair device based on the Bayesian rule. The data repair device based on the Bayesian rule described below and the data repair method based on the Bayesian rule described above can refer to each other.
[0150] Figure 3 FIG. 8 is a block diagram of a data repair device 800 based on the Bayesian rule according to an exemplary embodiment. Figure 3 As shown, the data repair device 800 based on the Bayesian rule may include: a processor 801 and a memory 802. The data repair device 800 based on the Bayesian rule may also include one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.
[0151] The processor 801 is used to control the overall operation of the data repair device 800 based on the Bayesian rule to complete all or part of the steps in the above-mentioned data repair method based on the Bayesian rule. The memory 802 is used to store various types of data to support the operation of the data repair device 800 based on the Bayesian rule. These data may include, for example, instructions for any application or method operating on the data repair device 800 based on the Bayesian rule, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by 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 memory, flash memory, disk or optical disk. The multimedia component 803 can include a screen and an audio component. The screen can be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component can include a microphone, and the microphone is used to receive external audio signals. The received audio signal can be further stored in the memory 802 or sent through the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the data repair device 800 based on the Bayesian rule and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 can include: Wi-Fi module, Bluetooth module, NFC module.
[0152] In an exemplary embodiment, the data repair device 800 based on the Bayesian law can be implemented by one or more application-specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned data repair method based on the Bayesian law.
[0153] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned data repair method based on the Bayesian rule are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 802 including program instructions, and the above-mentioned program instructions can be executed by the processor 801 of the data repair device 800 based on the Bayesian rule to complete the above-mentioned data repair method based on the Bayesian rule.
[0154] Embodiment 4:
[0155] Corresponding to the above method embodiment, a readable storage medium is also provided in this embodiment. The readable storage medium described below and the data repair method based on the Bayesian rule described above can refer to each other.
[0156] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data repair method based on the Bayesian rule of the above method embodiment are implemented.
[0157] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.
[0158] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0159] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data repair method based on Bayesian rule, characterized in that: include: Obtain historical data of the target business within the historical time period; Running the target business to obtain target operation data; Based on the Bayesian formula and the historical data, the abnormal probability of the target operation data is calculated to obtain an abnormal probability value, where the abnormal probability value is used to characterize the probability that the target business will be abnormal after the target operation data is abnormal; Comparing the abnormal probability value with a first set threshold; When the abnormal probability value is greater than the first set threshold, storing the target operation data into a target table, and determining the corresponding target abnormal type; Based on the target abnormality type, a corresponding abnormality repair method is determined, and repair is performed to obtain target data.
2. The data repair method based on Bayesian rule according to claim 1 is characterized in that ,Based on the Bayesian formula and the historical data, the abnormal probability of the target operation data is calculated to obtain the abnormal probability value, including: Determine the historical operation times and historical abnormal times of the target business based on the historical data; Calculate the ratio of the historical abnormal number of times to the historical running number of times to obtain a first probability value; Determine the total number of times all data are abnormal from the historical data to obtain the first number; Determining target historical data corresponding to the target operating data from the historical data, and determining the number of times the target historical data is abnormal, to obtain a second number; Based on the second number and the historical abnormal number, a second probability value is calculated; Calculate the ratio of the second number of times to the first number of times to obtain a third probability value; Calculate the product of the first probability value and the second probability value to obtain a first calculation result; The ratio of the first calculation result to the third probability value is calculated to obtain an abnormal probability value.
3. The data repair method based on Bayesian rule according to claim 2 is characterized in that ,Store the target operation data in the target table, and determine the corresponding target abnormality type, including: Matching the target operation data with a preset anomaly rule to obtain a matching result, wherein the matching result represents a matching degree between the target operation data and a plurality of anomaly categories in the anomaly rule; Comparing the matching result with a second set threshold; When the matching result is greater than a second set threshold, matching the target operation data with the abnormal category corresponding to the matching result and storing them in the target table; When the comparison result is less than a second set threshold, the target operation data is input into a preset abnormal classification model to obtain an abnormal classification result; The abnormal classification result is matched with the target operation data and stored in the target table.
4. The data repair method based on Bayesian rule according to claim 3 is characterized in that , based on the target abnormality type, determine the corresponding abnormality repair method, and perform repair to obtain target data, including: Determine all abnormal types from the historical data and obtain abnormal type values; Determine the total number of times all repair methods are used from the historical data to obtain a third number; Determining a target repair method corresponding to the target abnormality type from the historical data, and determining the number of times the target repair method is used, to obtain a fourth number; Calculate the ratio of the fourth number to the third number to obtain a fourth probability value; Based on the fourth number of times and the abnormal type value, a fifth probability value is calculated; Calculate the product of the fifth probability value and the fourth probability value to obtain a second calculation result; Calculating the ratio of the second calculation result to the first probability value to obtain a repair probability value of the target repair method; comparing the repair probability value with a third set threshold; When the repair probability value is greater than the third set threshold, the target operating data is repaired based on the target repair method to obtain the target data.
5. According to the data repair method based on the Bayesian rule of claim 4, when the repair probability value is greater than the third set threshold, the target operation data is repaired based on the target repair method to obtain the target data, comprising: Performing field verification processing on the target data based on a preset verification standard to obtain a first verification result; When the first verification result satisfies the first set condition, performing record verification processing on the target data based on the inspection standard to obtain a second verification result; When the second verification result satisfies the second set condition, performing business rule verification processing on the target data based on the inspection standard to obtain a third verification result; When the third verification result satisfies the third set condition, performing abnormal verification processing on the target data based on the inspection standard to obtain a fourth verification result; When the fourth verification result satisfies a fourth setting condition, the target operation data is replaced with the target data.
6. The data repair method based on Bayesian rule according to claim 1 is characterized in that , obtain the historical data of the target business within the historical time period, including: Acquire all initial data of the target business within the historical time period; Performing a cleaning operation on the initial data to obtain first data; Performing a missing value processing operation on the first data to obtain second data; Performing a format conversion operation on the second data to obtain third data; A smoothing operation is performed on the third data to obtain the historical data.
7. A data repair device based on Bayes' theorem, characterized in that: include: A first acquisition unit, used to acquire historical data of a target business within a historical time period; An operation unit, used for operating the target service and obtaining target operation data; A first calculation unit is used to calculate the abnormal probability of the target operation data based on the Bayesian formula and the historical data to obtain an abnormal probability value, where the abnormal probability value is used to characterize the probability that the target business will be abnormal after the target operation data is abnormal; A first comparison unit, used for comparing the abnormal probability value with a first set threshold; A first storage unit, configured to store the target operation data in a target table and determine a corresponding target abnormality type when the abnormal probability value is greater than the first set threshold value; The first repair unit is used to determine a corresponding abnormality repair method based on the target abnormality type, and perform repair to obtain target data.
8. The data repair device based on Bayesian rule according to claim 7, characterized in that: The first computing unit comprises: A first determining unit, configured to determine a historical number of operations and a historical number of exceptions of the target business based on the historical data; A second calculation unit is used to calculate the ratio of the historical abnormal number of times to the historical operation number to obtain a first probability value; A second determining unit is used to determine the total number of times that all data are abnormal from the historical data to obtain a first number; a third determining unit, configured to determine target historical data corresponding to the target operating data from the historical data, and determine the number of times the target historical data is abnormal, to obtain a second number; A third calculation unit, configured to calculate a second probability value based on the second number of times and the historical abnormal number of times; a fourth calculation unit, configured to calculate a ratio of the second number of times to the first number of times to obtain a third probability value; a fifth calculation unit, configured to calculate a product of the first probability value and the second probability value to obtain a first calculation result; The sixth calculation unit is used to calculate the ratio of the first calculation result to the third probability value to obtain an abnormal probability value.
9. The data repair device based on Bayesian rule according to claim 8, characterized in that: The first storage unit comprises: A matching unit, configured to match the target operation data with a preset anomaly rule to obtain a matching result, wherein the matching result represents a matching degree between the target operation data and a plurality of anomaly categories in the anomaly rule; A second comparing unit, used for comparing the matching result with a second set threshold; A second storage unit, for matching the target operation data with the abnormal category corresponding to the matching result and storing the matched data in the target table when the matching result is greater than a second set threshold; An input unit, used for inputting the target operation data into a preset abnormal classification model to obtain an abnormal classification result when the comparison result is less than a second set threshold; The third storage unit is used to match the abnormal classification result with the target operation data and store them in the target table.
10. The data repair device based on Bayesian rule according to claim 9, characterized in that: The first repair unit comprises: A fourth determination unit, configured to determine all abnormality types from the historical data and obtain abnormality type values; A fifth determining unit, configured to determine the total number of times all the repair methods are used from the historical data to obtain a third number; a sixth determining unit, configured to determine a target repair method corresponding to the target abnormality type from the historical data, and determine a number of times the target repair method is used to obtain a fourth number; a seventh calculation unit, configured to calculate a ratio of the fourth number to the third number to obtain a fourth probability value; An eighth calculation unit, configured to calculate a fifth probability value based on the fourth number of times and the abnormality type value; a ninth calculation unit, configured to calculate a product of the fifth probability value and the fourth probability value to obtain a second calculation result; a tenth calculation unit, configured to calculate a ratio of the second calculation result to the first probability value to obtain a repair probability value of the target repair method; A third comparing unit, used for comparing the repair probability value with a third set threshold; The second repairing unit is used to repair the target operating data based on the target repair method to obtain the target data when the repair probability value is greater than the third set threshold.
11. The data repair device based on Bayesian rule according to claim 10, characterized in that: The first repair unit also includes: A first processing unit, configured to perform field verification processing on the target data based on a preset verification standard to obtain a first verification result; A second processing unit, configured to perform record verification processing on the target data based on the inspection standard to obtain a second verification result when the first verification result satisfies a first set condition; A third processing unit, configured to perform business rule verification processing on the target data based on the inspection standard to obtain a third verification result when the second verification result satisfies a second set condition; a fourth processing unit, configured to perform abnormal verification processing on the target data based on the inspection standard to obtain a fourth verification result when the third verification result satisfies a third set condition; A replacement unit is used to replace the target operation data with the target data when the fourth verification result meets a fourth setting condition.
12. The data repair device based on Bayesian rule according to claim 7, characterized in that: The first acquiring unit includes: A second acquisition unit, configured to acquire all initial data of the target business within the historical time period; A first operation unit, configured to perform a cleaning operation on the initial data to obtain first data; A second operation unit, configured to perform a missing value processing operation on the first data to obtain second data; A third operation unit, configured to perform a format conversion operation on the second data to obtain third data; The fourth operating unit is used to perform a smoothing operation on the third data to obtain the historical data.
13. A data repair device based on Bayes' theorem, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data repair method based on the Bayesian rule as claimed in any one of claims 1 to 6 when executing the computer program.
14. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data repair method based on the Bayesian rule as claimed in any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Intelligentization-based business auditing operation method and apparatus, and electronic device
CN120509772A
