Monitoring rule processing method and device, processor and electronic device
By calculating the similarity between target metadata and the monitoring rule base, the system automatically selects and deploys the most similar monitoring rules, solving the problem of low efficiency in manual configuration and achieving efficient and accurate deployment of monitoring rules.
Patent Information
- Application Number
- CN202210461506.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2026-03-20
- Estimated Expiration
- 2042-04-28
AI Technical Summary
In existing technologies, the deployment of monitoring rules requires manual configuration, which leads to inefficiency.
By calculating the similarity between the target metadata field information and the monitoring rule base, the most similar monitoring rule is automatically selected and deployed. This includes similarity calculations for name, description information, and type. The target monitoring rule is determined using a linear regression model and implicit transformation rules.
It improves the deployment efficiency of monitoring rules, reduces manual intervention, and enhances the accuracy and automation of monitoring rules.
Smart Images

Figure CN114817209B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology, in particular to a processing method and device of monitoring rules, a processor and an electronic device. BACKGROUND
[0002] In the field of big data, it is necessary to monitor the rationality of data quality. Usually, some monitoring rule strategies are configured for target data to ensure the quality of the target data. When the target data meets the monitoring rules, the target data is correct and enters the next target data processing task; when the target data does not meet the monitoring rules, the target data is incorrect and the next work is stopped. With the development of big data, various monitoring rules need to be set for target data, for example, the null rate of data field is less than 10%, the number of field enumeration values is equal to 2, etc. However, such monitoring rules cannot be automatically configured at present and can only be manually configured by technical personnel based on past experience.
[0003] For the problem that in the related art, the deployment of monitoring rules for target data information can only be performed in an artificial manner, resulting in low efficiency of deploying monitoring rules, no effective solution has been proposed yet. SUMMARY
[0004] The main purpose of the present application is to provide a processing method and device of monitoring rules, a processor and an electronic device, so as to solve the problem that in the related art, the deployment of monitoring rules for target data information can only be performed in an artificial manner, resulting in low efficiency of deploying monitoring rules.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a processing method of monitoring rules is provided. The method comprises: obtaining first field information of target metadata to be configured with monitoring rules; calculating the similarity between the first field information and the second field information of each monitoring rule in a monitoring rule library to obtain a plurality of initial similarity values; taking the initial similarity value with the highest similarity value as a target similarity value, and taking the monitoring rule corresponding to the target similarity value as a preset monitoring rule; determining the target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule.
[0006] Further, the method further comprises: calculating the similarity between the first field name in the first field information and the second field name in the second field information to obtain a similarity value one, including: dividing the first field name into a plurality of first elements according to a preset rule; dividing the second field name into a plurality of second elements according to the preset rule, wherein the number of the first elements is the same as the number of the second elements; calculating the similarity between each first element and each second element to obtain a similarity value set corresponding to each first element; taking the maximum similarity value as the similarity value of each first element; calculating the average value of the similarity values of all first elements, and taking the average value as the similarity value one.
[0007] Further, the method further comprises: calculating the similarity between the first field name in the first field information and the second field name in the second field information to obtain a similarity value one, including: dividing the first field name into a plurality of first elements according to a preset rule; dividing the second field name into a plurality of second elements according to the preset rule, wherein the number of the first elements is the same as the number of the second elements; calculating the similarity between each first element and each second element to obtain a similarity value set corresponding to each first element; taking the maximum similarity value as the similarity value of each first element; calculating the average value of the similarity values of all first elements, and taking the average value as the similarity value one.
[0008] Further, the method further comprises: calculating the similarity between the first field name in the first field information and the second field name in the second field information to obtain a similarity value one, including: dividing the first field name into a plurality of first elements according to a preset rule; dividing the second field name into a plurality of second elements according to the preset rule, wherein the number of the first elements is the same as the number of the second elements; calculating the similarity between each first element and each second element to obtain a similarity value set corresponding to each first element; taking the maximum similarity value as the similarity value of each first element; calculating the average value of the similarity values of all first elements, and taking the average value as the similarity value one.
[0009] Further, the method further comprises: determining the target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule, including: obtaining the type of the preset monitoring rule, wherein the type of the preset monitoring rule is one of the following: a proportion type monitoring rule and a threshold type monitoring rule; if the type of the preset monitoring rule is the proportion type monitoring rule, determining whether the target similarity value is greater than a preset value one; if the target similarity value is greater than the preset value one, determining the preset monitoring rule as the target monitoring rule of the target metadata.
[0010] Further, the method further comprises: if the type of the preset monitoring rule is the threshold type monitoring rule, determining whether the target similarity value is greater than a preset value two, wherein the preset value two is greater than the preset value one; if the target similarity value is greater than the preset value two, determining the preset monitoring rule as the target monitoring rule of the target metadata.
[0011] Further, after determining the target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule, the method further comprises: deploying the target monitoring rule on the target metadata according to the first database name, the first data table name and the first field name in the first field information; and storing the correspondence between the target metadata and the target monitoring rule in the monitoring rule library after deploying the target monitoring rule on the target metadata, so as to update the monitoring rule library.
[0012] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a processing device of a monitoring rule is provided. The device comprises: an acquisition unit configured to acquire first field information of target metadata to be configured with a monitoring rule; a calculation unit configured to calculate similarity between the first field information and second field information of each monitoring rule in a monitoring rule library, to obtain a plurality of initial similarity values; a selection unit configured to take an initial similarity value with the highest similarity value as a target similarity value, and take a monitoring rule corresponding to the target similarity value as a preset monitoring rule; and a first determination unit configured to determine a target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule.
[0013] Further, the calculation unit comprises: a first calculation sub-unit configured to calculate similarity between a first field name in the first field information and a second field name in the second field information, to obtain a similarity value one; a second calculation sub-unit configured to calculate similarity between Chinese description information of the first field in the first field information and Chinese description information of the second field in the second field information, to obtain a similarity value two; a third calculation sub-unit configured to calculate similarity between a first field type in the first field information and a second field type in the second field information, to obtain a similarity value three; and a fourth calculation sub-unit configured to input the similarity value one, the similarity value two and the similarity value three into a linear regression model for calculation processing, and output the initial similarity value.
[0014] Further, the first calculation sub-unit comprises: a first segmentation module configured to segment the first field name into a plurality of first elements according to a preset rule; a second segmentation module configured to segment the second field name into a plurality of second elements according to the preset rule, wherein the number of the first elements is the same as the number of the second elements; a first calculation module configured to calculate similarity between each first element and each second element, to obtain a similarity value set corresponding to each first element; a selection module configured to take a maximum similarity value as the similarity value of each first element; and a second calculation module configured to calculate an average value of the similarity values of all first elements, and take the average value as the similarity value one.
[0015] Further, the third calculating sub-unit comprises a third calculating module, configured to calculate the similarity between the first field type and the second field type based on the implicit conversion rule of field type, to obtain a similarity value three.
[0016] Further, the first determining unit comprises an obtaining sub-unit, configured to obtain the type of the preset monitoring rule, wherein the type of the preset monitoring rule is one of the following: a proportional monitoring rule and a threshold monitoring rule; a judging sub-unit, configured to judge whether the target similarity value is greater than a preset value one if the type of the preset monitoring rule is the proportional monitoring rule; and a determining sub-unit, configured to determine the preset monitoring rule as the target monitoring rule of the target metadata if the target similarity value is greater than the preset value one.
[0017] Further, the device further comprises a judging unit, configured to judge whether the target similarity value is greater than a preset value two if the type of the preset monitoring rule is the threshold monitoring rule, wherein the preset value two is greater than the preset value one; and a second determining unit, configured to determine the preset monitoring rule as the target monitoring rule of the target metadata if the target similarity value is greater than the preset value two.
[0018] Further, the device further comprises a deploying unit, configured to deploy the target monitoring rule to the target metadata according to the first database name, the first data table name and the first field name in the first field information after determining the target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule; and an updating unit, configured to store the correspondence between the target metadata and the target monitoring rule into the monitoring rule library to update the monitoring rule library after deploying the target monitoring rule to the target metadata.
[0019] In order to achieve the above-mentioned purpose, according to an aspect of the present application, a processor is provided, which is used to run a program, wherein the program performs the processing method of the monitoring rule of any one of the above-mentioned aspects when running.
[0020] In order to achieve the above-mentioned purpose, according to an aspect of the present application, an electronic device is provided, which comprises one or more processors and a memory, the memory is used to store the processing method of the monitoring rule of any one of the above-mentioned aspects implemented by the one or more processors.
[0021] According to the application, the following steps are adopted: obtaining first field information of target metadata to be configured with a monitoring rule; calculating similarity of the first field information and second field information of each monitoring rule in a monitoring rule library, to obtain multiple initial similarity values; taking an initial similarity value with the highest similarity value as a target similarity value, and taking a monitoring rule corresponding to the target similarity value as a preset monitoring rule; and determining a target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule, thereby solving the problem in the related art that the deployment of a monitoring rule on target data information can only be performed in an artificial manner, resulting in low efficiency of deploying the monitoring rule. By calculating the similarity of the first field information of the target metadata and the second field information of each monitoring rule, and selecting a preset monitoring rule corresponding to the highest similarity value, the deployment of the monitoring rule on the target metadata is implemented, and the efficiency of deploying the monitoring rule is improved. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and are used to interpret the application together with the description. In the drawings:
[0023] Figure 1 is a flowchart of a processing method of a monitoring rule according to an embodiment of the present application;
[0024] Figure 2 is a flowchart of an optional processing method of a monitoring rule according to an embodiment of the present application;
[0025] Figure 3 is a schematic diagram of a processing device of a monitoring rule according to an embodiment of the present application;
[0026] Figure 4 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] It should be noted that the embodiments and features in the present application can be combined with each other without conflict. The technical solutions in the embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0028] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the protection scope of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] The present application will be described below in conjunction with preferred implementation steps, Figure 1 is a flowchart of a processing method of a monitoring rule provided according to an embodiment of the present application, as shown in the figure, the method comprises the following steps: Figure 1
[0031] Step S101, obtaining first field information of target metadata to be configured with a monitoring rule.
[0032] Specifically, in the monitoring rule library, a plurality of monitoring rules and the correspondence between each monitoring rule and its monitoring metadata are included. Then it can be determined from the monitoring rule library that the metadata without a configured monitoring rule, i.e. the above-mentioned target metadata. Then the first field information of the target metadata is obtained, which at least includes database name, data table name, field name, field Chinese description information and field type, etc.
[0033] Step S102, calculating the similarity between the first field information and the second field information of each monitoring rule in the monitoring rule library, to obtain a plurality of initial similarity values.
[0034] Specifically, each monitoring rule includes database name, data table name, field name, field Chinese description information, field type, monitoring rule type and monitoring rule algorithm, etc. i.e. the above-mentioned second field information. The similarity between the first field information and the second field information of each monitoring rule is calculated to obtain a plurality of initial similarity values.
[0035] Step S103, taking the initial similarity value with the highest similarity value as the target similarity value, and taking the monitoring rule corresponding to the target similarity value as the preset monitoring rule.
[0036] Specifically, the initial similarity value with the highest similarity value is selected from the plurality of initial similarity values as the target similarity value, and the monitoring rule corresponding to the target similarity value is taken as the preset monitoring rule.
[0037] In step S104, the target monitoring rule of the target metadata is determined according to the target similarity value and the preset monitoring rule.
[0038] In summary, by calculating the similarity between the first field information of the target metadata and the second field information of each monitoring rule, selecting the preset monitoring rule corresponding to the highest similarity value, the work of deploying the monitoring rule for the target metadata is realized, the manual deployment of the monitoring rule is avoided, and the efficiency of deploying the monitoring rule is improved.
[0039] Optionally, in the method for processing the monitoring rule provided in the embodiments of the present application, the similarity between the first field information and the second field information of each monitoring rule is calculated to obtain a plurality of initial similarity values, including: calculating the similarity between the first field name in the first field information and the second field name in the second field information to obtain a similarity value one; calculating the similarity between the first field Chinese description information in the first field information and the second field Chinese description information in the second field information to obtain a similarity value two; calculating the similarity between the first field type in the first field information and the second field type in the second field information to obtain a similarity value three; inputting the similarity value one, the similarity value two and the similarity value three into a linear regression model for calculation and processing, and outputting the initial similarity value.
[0040] Specifically, the similarity between the first field name in the first field information and the second field name in the second field information, the similarity between the first field Chinese description information in the first field information and the second field Chinese description information in the second field information, and the similarity between the first field type in the first field information and the second field type in the second field information are calculated respectively to obtain the similarity value one, the similarity value two and the similarity value three. The initial similarity value is calculated through the linear regression model. The linear regression model can be used to calculate the initial similarity value according to the following formula: initial similarity value = 0.4*similarity value one + 0.3*similarity value two + 0.3*similarity value three.
[0041] Through the above steps, the similarities of the field name, the field Chinese description information and the field type are calculated, which can effectively improve the accuracy of determining the monitoring rule of the target metadata.
[0042] Optionally, in the method for processing the monitoring rule, the similarity between the first field name in the first field information and the second field name in the second field information is calculated to obtain a similarity value one, including: the first field name is segmented into a plurality of first elements according to a preset rule; the second field name is segmented into a plurality of second elements according to the preset rule, wherein the number of the first elements is the same as the number of the second elements; the similarity between each first element and each second element is calculated to obtain a set of similarity values corresponding to each first element; the maximum similarity value is taken as the similarity value of each first element; and the average of the similarity values of all the first elements is calculated, and the average is taken as the similarity value one.
[0043] Specifically, the naming rule of the field name in the big data development is generally: modifier atomic index time window, for example, the naming of the transaction count in the last 1 year is “trade_cnt_1y”; when there are multiple modifiers, the order is defined by the data developer, for example, the transaction count of a certain payment platform channel outflow transaction of another bank in the last 1 year can be named as “zfb_out_th_cnt_1y”, or can be named as “zfb_th_out_cnt_1y”.
[0044] Suppose the first field name is “zfb_out_th_cnt_1y” and the second field name is “zfb_th_out_cnt_1y”, then the step of calculating the similarity value one is:
[0045] Step one: the first field name and the second field name are segmented according to “_” as a separator, and the first elements and the second elements are obtained accordingly; for example, the first elements are [zfb, out, th, cnt, 1y] and the second elements are [zfb, th, out, cnt, 1y]. Step two: the similarity between each first element and each second element is calculated, and the maximum similarity value is taken; for example, the similarity of the first element zfb to [zfb, th, out, cnt, 1y] is [1, 0, 0, 0, 0], and the maximum similarity value is 1; the similarity of the other first elements to each second element is calculated, and the maximum similarity value is 1. Step three, the average of the similarity values of all the first elements is calculated, and the average is taken as the similarity value one. For example, the similarity value one is (1+1+1+1+1) / 5=1. Through the above steps, the similarity value of the field name can be accurately calculated.
[0046] Optionally, in the method for processing the monitoring rule, the similarity between the first field type in the first field information and the second field type in the second field information is calculated to obtain a similarity value three, including: based on the implicit conversion rule of the field type, the similarity between the first field type and the second field type is calculated to obtain the similarity value three.
[0047] Specifically, field types are generally categorized as: integer, floating-point, character, date, and boolean. Based on implicit conversion rules for field types, short data types can be implicitly converted to long data types; for example, `int` can be automatically converted to `bigint`, and `float` can be converted to `double`. Therefore, when calculating the similarity value, we can consider the similarity value of field types that can be implicitly converted to be 0.9, the similarity value of field types that cannot be implicitly converted to be 0, and the similarity value of fields with the same type to be 1. This method allows for the rapid acquisition of field type similarity values, thereby improving the efficiency of deploying monitoring rules.
[0048] For example, the target metadata's field name, Chinese description, and type are "trade_cnt_1m, number of transactions in the last month, bigint". The first monitoring rule's field name, Chinese description, and type are "trade_amt_1m, transaction amount in the last month, decimal"; the second monitoring rule's field name, Chinese description, and type are "trade_cnt_1y, number of transactions in the last year, bigint". Using the above method, the similarity between the target metadata and the first monitoring rule's field names is 0.7778, the Chinese description similarity is 0.75, the field type similarity is 0.9, and the final similarity is 0.8061. The target metadata and the second monitoring rule's field name similarity is 0.8333, the Chinese description similarity is 0.875, the field type similarity is 1, and the final similarity is 0.9333. The monitoring rule corresponding to the highest similarity value is selected as the preset monitoring rule, i.e., the second monitoring rule is selected as the preset monitoring rule.
[0049] Optionally, in the monitoring rule processing method provided in this application embodiment, determining the target monitoring rule for the target metadata based on the target similarity value and the preset monitoring rule includes: obtaining the type of the preset monitoring rule, wherein the type of the preset monitoring rule is one of the following: proportional monitoring rule and threshold monitoring rule; if the type of the preset monitoring rule is a proportional monitoring rule, determining whether the target similarity value is greater than a preset value one; if the target similarity value is greater than the preset value one, then determining the preset monitoring rule as the target monitoring rule for the target metadata.
[0050] Specifically, the type of the preset monitoring rule is determined, and different preset data is set for different types. The types of the monitoring rules mainly include a proportion type and a threshold type. For the proportion type, if the calculated target similarity value is greater than 0.8 (the preset value one), the preset monitoring rule can be determined as the target monitoring rule of the target metadata. Different judgment requirements are set for different types of monitoring rules, and the accuracy of matching the target metadata with the monitoring rule is further improved.
[0051] Optionally, in the method for processing the monitoring rule provided in the embodiment of the present application, the method further includes: if the type of the preset monitoring rule is the threshold type, judging whether the target similarity value is greater than a preset value two, wherein the preset value two is greater than the preset value one; and if the target similarity value is greater than the preset value two, determining the preset monitoring rule as the target monitoring rule of the target metadata.
[0052] Specifically, for the threshold type, if the calculated target similarity value is greater than 0.95 (the preset value two), the preset monitoring rule can be determined as the target monitoring rule of the target metadata.
[0053] Optionally, in the method for processing the monitoring rule provided in the embodiment of the present application, after the target monitoring rule of the target metadata is determined according to the target similarity value and the preset monitoring rule, the method further includes: deploying the target monitoring rule to the target metadata according to the first database name, the first data table name and the first field name in the first field information; and after the target monitoring rule is deployed to the target metadata, storing the corresponding relationship between the target metadata and the target monitoring rule in the monitoring rule library to update the monitoring rule library.
[0054] Specifically, the target cloud data is deployed with the monitoring rule according to the first database name, the first data table name and the first field name in the first field information. After the monitoring rule is deployed, the corresponding relationship between the target metadata and the target monitoring rule is recorded in the monitoring rule library for subsequent query.
[0055] The processing method of the monitoring rule provided in the embodiments of the present application comprises the following steps: obtaining first field information of target metadata to be configured with a monitoring rule; calculating the similarity between the first field information and second field information of each monitoring rule in a monitoring rule library, to obtain a plurality of initial similarity values; taking the initial similarity value with the highest similarity value as a target similarity value, and taking the monitoring rule corresponding to the target similarity value as a preset monitoring rule; and determining a target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule. The problem that the deployment of the monitoring rule for the target data information can only be performed in an artificial manner in the related art, resulting in a relatively low efficiency of deploying the monitoring rule, is solved. The preset monitoring rule corresponding to the highest similarity value is selected by calculating the similarity between the first field information of the target metadata and the second field information of each monitoring rule, so as to implement the deployment of the monitoring rule for the target metadata, and the efficiency of deploying the monitoring rule is improved.
[0056] Figure 2 is a flowchart of the optional processing method of the monitoring rule provided in the embodiments of the present application. In the first step, first field information of target metadata to be configured with a monitoring rule is obtained. In the second step, the similarity between the first field information and second field information of each monitoring rule in a monitoring rule library is calculated, to obtain a target similarity value. In the third step, a target monitoring rule of the target metadata is determined. In the fourth step, the target monitoring rule is deployed and the monitoring rule library is updated.
[0057] It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a group of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0058] The embodiments of the present application also provide a processing device of a monitoring rule. It should be noted that the processing device of the monitoring rule in the embodiments of the present application can be used to execute the processing method of the monitoring rule provided in the embodiments of the present application. The processing device of the monitoring rule provided in the embodiments of the present application is introduced as follows.
[0059] Figure 3 is a schematic diagram of the processing device of the monitoring rule according to the embodiments of the present application. As shown in Figure 3 , the device comprises an obtaining unit 301, a calculating unit 302, a selecting unit 303 and a first determining unit 304.
[0060] The obtaining unit 301 is configured to obtain first field information of target metadata to be configured with a monitoring rule.
[0061] The calculating unit 302 is configured to calculate the similarity between the first field information and second field information of each monitoring rule in a monitoring rule library, to obtain a plurality of initial similarity values.
[0062] The selecting unit 303 is configured to select the initial similarity value with the highest similarity value as a target similarity value, and select the monitoring rule corresponding to the target similarity value as a preset monitoring rule.
[0063] The first determining unit 304 is configured to determine a target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule.
[0064] The processing apparatus for monitoring rules provided by the embodiments of the present application acquires the first field information of the target metadata to which the monitoring rule is to be configured by the acquiring unit 301; calculates the similarity between the first field information and the second field information of each monitoring rule in the monitoring rule library by the calculating unit 302, to obtain a plurality of initial similarity values; selects the initial similarity value with the highest similarity value as a target similarity value, and selects the monitoring rule corresponding to the target similarity value as a preset monitoring rule by the selecting unit 303; and determines the target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule by the first determining unit 304, thereby solving the problem that the deployment of the monitoring rule for the target data information can only be performed by manual work in the related art, and the efficiency of deploying the monitoring rule is relatively low. The work of deploying the monitoring rule for the target metadata is performed by calculating the similarity between the first field information of the target metadata and the second field information of each monitoring rule, and selecting the preset monitoring rule corresponding to the highest similarity value, thereby achieving the effect of improving the efficiency of deploying the monitoring rule.
[0065] Optionally, in the processing apparatus for monitoring rules provided by the embodiments of the present application, the calculating unit 302 includes: a first calculating subunit configured to calculate the similarity between the first field name in the first field information and the second field name in the second field information, to obtain a similarity value one; a second calculating subunit configured to calculate the similarity between the first field Chinese description information in the first field information and the second field Chinese description information in the second field information, to obtain a similarity value two; a third calculating subunit configured to calculate the similarity between the first field type in the first field information and the second field type in the second field information, to obtain a similarity value three; and a fourth calculating subunit configured to input the similarity value one, the similarity value two and the similarity value three into a linear regression model for calculation and processing, and output the initial similarity value.
[0066] Optionally, in the processing apparatus for monitoring rules provided in the embodiments of the present application, the first calculating subunit comprises: a first segmentation module, configured to segment the first field name into a plurality of first elements according to a preset rule; a second segmentation module, configured to segment the second field name into a plurality of second elements according to the preset rule, wherein the number of the first elements is the same as the number of the second elements; a first calculating module, configured to calculate the similarity between each first element and each second element to obtain a set of similarity values corresponding to each first element; a selection module, configured to select the maximum similarity value as the similarity value of each first element; and a second calculating module, configured to calculate the average value of the similarity values of all the first elements and take the average value as the similarity value one.
[0067] Optionally, in the processing apparatus for monitoring rules provided in the embodiments of the present application, the third calculating subunit comprises: a third calculating module, configured to calculate the similarity between the first field type and the second field type based on the implicit conversion rule of the field type to obtain the similarity value three.
[0068] Optionally, in the processing apparatus for monitoring rules provided in the embodiments of the present application, the first determining unit 304 comprises: an acquisition subunit, configured to acquire the type of the preset monitoring rule, wherein the type of the preset monitoring rule is one of the following: a proportional type monitoring rule and a threshold type monitoring rule; a judgment subunit, configured to judge whether the target similarity value is greater than a preset value one if the type of the preset monitoring rule is the proportional type monitoring rule; and a determination subunit, configured to determine the preset monitoring rule as the target monitoring rule of the target metadata if the target similarity value is greater than the preset value one.
[0069] Optionally, in the processing apparatus for monitoring rules provided in the embodiments of the present application, the apparatus further comprises: a judgment unit, configured to judge whether the target similarity value is greater than a preset value two if the type of the preset monitoring rule is the threshold type monitoring rule, wherein the preset value two is greater than the preset value one; and a second determination unit, configured to determine the preset monitoring rule as the target monitoring rule of the target metadata if the target similarity value is greater than the preset value two.
[0070] Optionally, in the processing apparatus for monitoring rules provided in the embodiments of the present application, the apparatus further comprises: a deployment unit, configured to deploy the target monitoring rule on the target metadata according to the first database name, the first data table name and the first field name in the first field information after determining the target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule; and an update unit, configured to store the correspondence between the target metadata and the target monitoring rule in the monitoring rule library to update the monitoring rule library after deploying the target monitoring rule on the target metadata.
[0071] The processing device of the monitoring rule comprises a processor and a memory, and the acquisition unit 301, the calculation unit 302, the selection unit 303 and the first determination unit 304 are stored in the memory as program units, and the corresponding functions are realized by executing the program units stored in the memory by the processor.
[0072] The processor comprises a core, and the core is used to call the corresponding program units in the memory. One or more cores can be set, and the determination of the monitoring rule is realized by adjusting the core parameters.
[0073] The memory can comprise a non-permanent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory comprises at least one memory chip.
[0074] The embodiment of the present application provides a processor, which is used for running a program, wherein the processor is used for executing the processing method of the monitoring rule when the program is running.
[0075] As shown in Figure 4 The embodiment of the present application provides an electronic device, which comprises a processor, a memory and a program stored in the memory and capable of running on the processor, and the processor realizes the following steps when the program is executed: acquiring first field information of target metadata to be configured with a monitoring rule; calculating the similarity between the first field information and second field information of each monitoring rule in a monitoring rule library to obtain a plurality of initial similarity values; taking the initial similarity value with the highest similarity value as a target similarity value, and taking the monitoring rule corresponding to the target similarity value as a preset monitoring rule; and determining the target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule.
[0076] Optionally, the calculating the similarity between the first field information and the second field information of each monitoring rule to obtain a plurality of initial similarity values comprises: calculating the similarity between a first field name in the first field information and a second field name in the second field information to obtain a similarity value one; calculating the similarity between first field Chinese description information in the first field information and second field Chinese description information in the second field information to obtain a similarity value two; calculating the similarity between a first field type in the first field information and a second field type in the second field information to obtain a similarity value three; and inputting the similarity value one, the similarity value two and the similarity value three into a linear regression model for calculation and processing, and outputting the initial similarity value.
[0077] Optionally, the similarity between the first field name in the first field information and the second field name in the second field information is calculated to obtain a similarity value one, including: the first field name is segmented into a plurality of first elements according to a preset rule; the second field name is segmented into a plurality of second elements according to the preset rule, wherein the number of the first elements is the same as the number of the second elements; the similarity between each first element and each second element is calculated to obtain a similarity value set corresponding to each first element; the maximum similarity value is taken as the similarity value of each first element; and the average of the similarity values of all the first elements is calculated, and the average is taken as the similarity value one.
[0078] Optionally, the similarity between the first field type in the first field information and the second field type in the second field information is calculated to obtain a similarity value three, including: the similarity between the first field type and the second field type is calculated based on an implicit conversion rule of the field type to obtain the similarity value three.
[0079] Optionally, the target monitoring rule of the target metadata is determined according to the target similarity value and a preset monitoring rule, including: a type of the preset monitoring rule is obtained, wherein the type of the preset monitoring rule is one of: a proportional monitoring rule and a threshold monitoring rule; if the type of the preset monitoring rule is the proportional monitoring rule, it is determined whether the target similarity value is greater than a preset value one; and if the target similarity value is greater than the preset value one, the preset monitoring rule is determined as the target monitoring rule of the target metadata.
[0080] Optionally, the method further includes: if the type of the preset monitoring rule is the threshold monitoring rule, it is determined whether the target similarity value is greater than a preset value two, wherein the preset value two is greater than the preset value one; and if the target similarity value is greater than the preset value two, the preset monitoring rule is determined as the target monitoring rule of the target metadata.
[0081] Optionally, after the target monitoring rule of the target metadata is determined according to the target similarity value and the preset monitoring rule, the method further includes: the target monitoring rule is deployed to the target metadata according to the first database name, the first data table name and the first field name in the first field information; and after the target monitoring rule is deployed to the target metadata, a correspondence between the target metadata and the target monitoring rule is stored in a monitoring rule library to update the monitoring rule library. The device herein can be a server, a PC, a PAD, a mobile phone, etc.
[0082] The application further provides a computer program product, which is adapted to execute the program of the following method steps when executed on a data processing device: obtaining first field information of target metadata of a monitoring rule to be configured; calculating the similarity of the first field information and second field information of each monitoring rule in a monitoring rule library to obtain a plurality of initial similarity values; taking the initial similarity value with the highest similarity value as a target similarity value, and taking the monitoring rule corresponding to the target similarity value as a preset monitoring rule; and determining a target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule.
[0083] Optionally, the calculating of the similarity of the first field information and the second field information of each monitoring rule to obtain a plurality of initial similarity values comprises: calculating the similarity of a first field name in the first field information and a second field name in the second field information to obtain a similarity value one; calculating the similarity of first field Chinese description information in the first field information and second field Chinese description information in the second field information to obtain a similarity value two; calculating the similarity of a first field type in the first field information and a second field type in the second field information to obtain a similarity value three; and inputting the similarity value one, the similarity value two and the similarity value three into a linear regression model for calculation and processing, and outputting the initial similarity value.
[0084] Optionally, the calculating of the similarity of the first field name in the first field information and the second field name in the second field information to obtain the similarity value one comprises: segmenting the first field name into a plurality of first elements according to a preset rule; segmenting the second field name into a plurality of second elements according to the preset rule, wherein the number of the first elements is the same as the number of the second elements; calculating the similarity between each first element and each second element to obtain a similarity value set corresponding to each first element; taking the maximum similarity value as the similarity value of each first element; and calculating the average value of the similarity values of all the first elements, and taking the average value as the similarity value one.
[0085] Optionally, the calculating of the similarity of the first field type in the first field information and the second field type in the second field information to obtain the similarity value three comprises: calculating the similarity of the first field type and the second field type based on an implicit conversion rule of the field type to obtain the similarity value three.
[0086] Optionally, the determining of the target monitoring rule of the target metadata according to the target similarity value and the preset monitoring rule comprises: obtaining the type of the preset monitoring rule, wherein the type of the preset monitoring rule is one of the following: a proportional type monitoring rule and a threshold type monitoring rule; if the type of the preset monitoring rule is the proportional type monitoring rule, determining whether the target similarity value is greater than a preset value one; and if the target similarity value is greater than the preset value one, taking the preset monitoring rule as the target monitoring rule of the target metadata.
[0087] Optionally, the method further comprises: if the type of the preset monitoring rule is a threshold type monitoring rule, determining whether the target similarity value is greater than a second preset value, wherein the second preset value is greater than the first preset value; and if the target similarity value is greater than the second preset value, determining the preset monitoring rule as the target monitoring rule of the target metadata.
[0088] Optionally, after the target monitoring rule of the target metadata is determined according to the target similarity value and the preset monitoring rule, the method further comprises: deploying the target monitoring rule to the target metadata according to the first database name, the first data table name and the first field name in the first field information; and storing the correspondence between the target metadata and the target monitoring rule in the monitoring rule library to update the monitoring rule library after the target monitoring rule is deployed to the target metadata.
[0089] Those skilled in the art should understand that embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer-usable program code.
[0090] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce an apparatus that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks
[0091] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in a flow or multiple flows and / or blocks Figure 1 The functions specified in a flow or multiple flows and / or blocks
[0092] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 Figure 1
[0093] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0094] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the processor can execute instructions. The memory can also include non-volatile memory, such as read only memory (ROM), electrically programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), flash memory, or other memory technologies, CD-ROM, digital versatile disc (DVD), or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information for access by a computing device. In no case does the medium include a transitory signal.
[0095] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically programmable read only memory (EEPROM), flash memory or other memory technologies, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information accessible by a computing device. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carrier waves.
[0096] It should also be noted that the terms "comprising," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements in the list, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0097] Those skilled in the art will appreciate that embodiments of the present application can be devised for a method, a system, or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer-readable program code thereon for use by or in connection with an instruction execution system. For the purposes of this description, a computer-usable or computer readable storage medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The medium can be electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. The computer-usable or computer readable program code can be downloaded from an Internet website, server, or other remote source via a network or a data stream communication path. From the Internet website, server, or other remote source, the code can be downloaded into the instruction execution system, apparatus, or device where execution of the same can take place. The present application is directed to any number and type of computer-usable storage media, apparatuses, and devices self-evidently known to one of ordinary skill in the art.
[0098] The foregoing is merely illustrative of the principles of the application, and various modifications can be made by those skilled in the art without departing from the scope of the application. The depicted embodiments are to be considered in all respects only as illustrative, and not restrictive.
Claims
1. A method for processing monitoring rules, characterized in that, include: Retrieve the first field information of the target metadata of the monitoring rule to be configured; Calculate the similarity between the first field information and the second field information of each monitoring rule in the monitoring rule base to obtain multiple initial similarity values; The initial similarity value with the highest similarity value is taken as the target similarity value, and the monitoring rule corresponding to the target similarity value is taken as the preset monitoring rule; Based on the target similarity value and the preset monitoring rules, the target monitoring rules for the target metadata are determined; Specifically, the similarity between the first field information and the second field information of each monitoring rule is calculated to obtain multiple initial similarity values, including: Calculate the similarity between the first field name in the first field information and the second field name in the second field information to obtain a similarity value of 1; Calculate the similarity between the Chinese description information of the first field in the first field information and the Chinese description information of the second field in the second field information to obtain a similarity value of two. Calculate the similarity between the first field type in the first field information and the second field type in the second field information to obtain a similarity value of three; The similarity value one, the similarity value two, and the similarity value three are input into the linear regression model for calculation and processing, and the initial similarity value is output. The preset monitoring rules can be of one of the following types: proportional monitoring rules and threshold monitoring rules; different discrimination requirements are set for different types of preset monitoring rules. Specifically, the similarity between the first field name in the first field information and the second field name in the second field information is calculated to obtain a similarity value one, including: The first field name is divided into multiple first elements according to a preset rule; The second field name is divided into multiple second elements according to the preset rules, wherein the number of first elements and the number of second elements are the same; Calculate the similarity between each first element and each second element to obtain the set of similarity values corresponding to each first element; Use the maximum similarity value as the similarity value for each first element; Calculate the average of the similarity values of all first elements, and use the average as the first similarity value.
2. The method according to claim 1, characterized in that, Calculate the similarity between the first field type in the first field information and the second field type in the second field information to obtain a similarity value three, including: Based on the implicit conversion rules of field types, the similarity between the first field type and the second field type is calculated to obtain a similarity value of three.
3. The method according to claim 1, characterized in that, Based on the target similarity value and the preset monitoring rules, the target monitoring rules for the target metadata are determined, including: Obtain the type of the preset monitoring rule; If the type of the preset monitoring rule is the proportional monitoring rule, determine whether the target similarity value is greater than a preset value of one; If the target similarity value is greater than the preset value, then the preset monitoring rule is determined as the target monitoring rule for the target metadata.
4. The method according to claim 3, characterized in that, The method further includes: If the type of the preset monitoring rule is the threshold-type monitoring rule, determine whether the target similarity value is greater than a preset value two, wherein the preset value two is greater than the preset value one; If the target similarity value is greater than the preset value two, then the preset monitoring rule is determined as the target monitoring rule for the target metadata.
5. The method according to claim 1, characterized in that, After determining the target monitoring rules for the target metadata based on the target similarity value and the preset monitoring rules, the method further includes: Based on the first database name, first data table name and first field name in the first field information, deploy the target monitoring rules on the target metadata; After deploying the target monitoring rules on the target metadata, the correspondence between the target metadata and the target monitoring rules is stored in the monitoring rule base to update the monitoring rule base.
6. A device for processing monitoring rules, characterized in that, include: The acquisition unit is used to acquire the first field information of the target metadata of the monitoring rule to be configured. The calculation unit is used to calculate the similarity between the first field information and the second field information of each monitoring rule in the monitoring rule base, and obtain multiple initial similarity values; The selection unit is used to select the initial similarity value with the highest similarity value as the target similarity value, and to select the monitoring rule corresponding to the target similarity value as the preset monitoring rule. The first determining unit is used to determine the target monitoring rules for the target metadata based on the target similarity value and the preset monitoring rules. The calculation unit includes: a first calculation subunit, used to calculate the similarity between the first field name in the first field information and the second field name in the second field information, to obtain a similarity value one; a second calculation subunit, used to calculate the similarity between the Chinese description information of the first field in the first field information and the Chinese description information of the second field in the second field information, to obtain a similarity value two; a third calculation subunit, used to calculate the similarity between the type of the first field in the first field information and the type of the second field in the second field information, to obtain a similarity value three; and a fourth calculation subunit, used to input the similarity value one, similarity value two, and similarity value three into a linear regression model for calculation and processing, and output an initial similarity value; wherein, the type of the preset monitoring rule is one of the following: proportional monitoring rule and threshold monitoring rule; different discrimination requirements are set for different types of preset monitoring rules; The first calculation subunit includes: a first segmentation module, used to segment the first field name into multiple first elements according to a preset rule; a second segmentation module, used to segment the second field name into multiple second elements according to a preset rule, wherein the number of first elements and the number of second elements are the same; a first calculation module, used to calculate the similarity between each first element and each second element to obtain a set of similarity values corresponding to each first element; a selection module, used to use the maximum similarity value as the similarity value of each first element; and a second calculation module, used to calculate the average of the similarity values of all first elements and use the average as the similarity value one.
7. A processor, characterized in that, The processor is used to run a program, wherein the program executes the processing method of the monitoring rules according to any one of claims 1 to 5 when it runs.
8. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the monitoring rule processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Data processing method, equipment and system
CN106371973A
Intranet and extranet secure transmission control method and device, computer equipment and storage medium
CN110830246A