Data verification method and device, electronic equipment and readable storage medium
By generating target rules in the CMDB, the data verification process is simplified, and the problems of inaccurate data and cumbersome verification steps caused by the wide variety of resources in the CMDB are solved, achieving efficient data verification and flexible rule management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SF TECH CO LTD
- Filing Date
- 2021-11-25
- Publication Date
- 2026-05-29
AI Technical Summary
The CMDB contains a wide variety of resources, and the resource lifecycle records are not standardized, resulting in inaccurate data. The existing data verification process is cumbersome and time-consuming, and lacks flexible rule management and verification result statistics.
By obtaining the data identifier of the data to be verified, the template identifier is searched in the preset rule association table, the target rule is generated according to the template identifier, the verification process is simplified by using the rule template, the verification rule is generated and the data is verified.
It simplifies rule configuration, saves verification time, improves efficiency, and supports flexible rule management and verification result statistics.
Smart Images

Figure CN116166694B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically, to a data verification method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] A Configuration Management Database (CMDB) is a logical database that contains information about the entire lifecycle of configuration items and the relationships between them. The CMDB stores and manages various configuration information for devices within an enterprise's IT architecture. It is closely linked to all service support and delivery processes, supporting their operation, maximizing the value of configuration information, and ensuring data accuracy through these processes.
[0003] As the entry point for chassis data, the CMDB's primary purpose is to provide real-time and accurate data to operations and maintenance personnel. However, due to the diverse types of resources managed and the potentially non-standardized resource lifecycle recording process, the data pushed to the CMDB may be inaccurate, requiring the CMDB to validate the data. However, different resources require different validation items, necessitating separate configuration for validation, which is cumbersome and time-consuming. Summary of the Invention
[0004] Based on the above research, the present invention provides a data verification method, apparatus, electronic device, and readable storage medium, which can simplify operation, save time, and improve efficiency.
[0005] Embodiments of the present invention can be implemented through the following:
[0006] In a first aspect, embodiments of the present invention provide a data verification method, characterized in that the method includes:
[0007] Obtain the data to be verified and its data identifier;
[0008] Based on the data identifier, the template identifier associated with the data identifier is searched in a preset rule association table; the rule association table stores at least one data identifier and a template identifier associated with the data identifier.
[0009] Based on the template identifier, a rule template for the data to be verified is determined, and a target rule is generated based on the rule template.
[0010] The data to be verified is verified according to the target rules.
[0011] In an optional implementation, generating the target rule based on the rule template includes:
[0012] Based on the data identifier, the field information corresponding to the data identifier is searched in a preset model table; the model table stores at least one data identifier and the field information corresponding to the data identifier.
[0013] Based on the field information, the rule placeholders in the rule template are replaced to obtain the target rule.
[0014] In an optional implementation, before searching for the template identifier associated with the data identifier in a preset rule association table based on the data identifier, the method further includes:
[0015] The rules in the sample rule set are classified to obtain different categories of rules;
[0016] For each category of rules, a rule template corresponding to that category is generated based on the similarity of the rules in that category.
[0017] In an optional implementation, the target rule includes verification rules and statistical rules; the step of verifying the data to be verified according to the target rule includes:
[0018] According to the verification rules, the data to be verified is verified to obtain the verification result of the data to be verified.
[0019] According to the statistical rules, the verification results of the data to be verified are statistically analyzed to obtain the statistical results.
[0020] In an optional implementation, after verifying the data to be verified according to the verification rules and obtaining the verification result of the data to be verified, the method further includes:
[0021] Based on the verification result of the data to be verified, the result data in the preset detail table is updated; wherein, the preset detail table stores the result data of different data to be verified.
[0022] The accuracy of the results data in the updated preset details table is calculated according to the set dimensions.
[0023] In an optional implementation, updating the result data in the preset detail table based on the verification result of the data to be verified includes:
[0024] The verification result of the data to be verified is compared with the result data in the preset detail table to obtain the newly added result data and the processed result data in the preset detail table;
[0025] The newly added result data is inserted into the preset detail table, and the processed result data is removed from the preset detail table.
[0026] In an optional implementation, before verifying the data to be verified according to the target rule, the method further includes:
[0027] Based on the data identifier, check whether the rule parameter associated with the data identifier is stored in the rule association table;
[0028] If the rule parameters exist, the target rule is updated according to the rule parameters to obtain the updated target rule;
[0029] The step of validating the data to be verified according to the target rule includes:
[0030] The data to be verified is verified according to the updated target rules.
[0031] Secondly, embodiments of the present invention provide a data verification device, the data verification device comprising:
[0032] The data acquisition module is used to acquire the data to be verified and the data identifier of the data to be verified.
[0033] The identifier lookup module is used to look up the template identifier associated with the data identifier in a preset rule association table based on the data identifier; the rule association table stores at least one data identifier and the template identifier associated with the data identifier;
[0034] The rule generation module is used to determine the rule template for the data to be verified based on the template identifier, and to generate target rules based on the rule template.
[0035] The data verification module is used to verify the data to be verified according to the target rules.
[0036] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data verification method described in any of the foregoing embodiments.
[0037] Fourthly, embodiments of the present invention provide a readable storage medium, the readable storage medium including a computer program, wherein the computer program, when running, controls the electronic device containing the readable storage medium to execute the data verification method described in any of the foregoing embodiments.
[0038] The data verification method, apparatus, electronic device, and readable storage medium provided in this invention, after acquiring the data to be verified and its data identifier, search for a template identifier associated with the data identifier in a preset rule association table based on the data identifier, determine the rule template for the data to be verified based on the template identifier, generate a target rule based on the rule template, and then verify the data to be verified according to the target rule. Thus, by generating target rules through rule templates, rule configuration operations are simplified, verification time is saved, and efficiency is improved. Attached Figure Description
[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0041] Figure 2 This is a flowchart illustrating a data verification method provided in an embodiment of the present invention.
[0042] Figure 3 This is a block diagram of a data verification device provided in an embodiment of the present invention.
[0043] Icons: 100-Electronic device; 10-Data verification device; 11-Data acquisition module; 12-Identifier lookup module; 13-Rule generation module; 14-Data verification module; 20-Memory; 30-Processor; 40-Communication unit; 50-Display unit. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0045] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0046] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0047] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0048] As described in the background section, the CMDB, as the entry point for chassis data, primarily provides real-time and accurate data to operations and maintenance personnel. However, due to the diverse types of resources managed and the potentially non-standardized resource lifecycle recording process, the data pushed to the CMDB may be inaccurate, necessitating CMDB data verification. However, different resources require different verification items and data verification rules, necessitating separate configuration for each verification step, which is cumbersome and time-consuming. Furthermore, there are frequent requirements to modify rules for different resources; therefore, flexible rule management is needed. Additionally, the lack of statistical analysis of the verification results after data verification hinders the analysis and processing by resource data providers.
[0049] Based on the above research, this invention provides a data verification method, apparatus, electronic device, and readable storage medium. After obtaining the data to be verified and its data identifier, the method searches for a template identifier associated with the data identifier in a preset rule association table based on the data identifier. Then, based on the template identifier, a rule template for the data to be verified is determined. Finally, a target rule is generated based on the rule template, and the data to be verified is verified according to the target rule. In this way, generating target rules through rule templates simplifies rule configuration, saves verification time, and improves efficiency.
[0050] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of the electronic device provided in this embodiment. Figure 1 As shown, the electronic device 100 includes a data verification device 10, a memory 20, a processor 30, a communication unit 40, and a display unit 50. The memory 20, processor 30, communication unit 40, and display unit 50 are electrically connected directly or indirectly to each other to achieve signal transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0051] In this embodiment, the data verification device 10 includes at least one software functional module that can be stored in the memory 20 in the form of software or firmware. The processor 30 is used to execute the executable module (e.g., the software functional module or computer program included in the data verification device 10) stored in the memory 20. When the electronic device 100 is running, the processor 30 communicates with the memory 20 via a bus, and the processor 30 executes the executable module or computer program to implement the data verification method for game characters described in this embodiment.
[0052] The memory 20 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0053] Processor 30 is used to perform one or more functions described in this embodiment. In some embodiments, processor 30 may include one or more processing cores (e.g., a single-core processor (S) or a multi-core processor (S)). By way of example only, processor 30 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), an application-specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field-programmable gate array (FPGA), a programmable logic device (PLD), a controller, a microcontroller unit, a reduced instruction set computing (RISC) computer, or a microprocessor, or any combination thereof.
[0054] For ease of explanation, only one processor is described in the electronic device 100. However, it should be noted that the electronic device 100 in this embodiment may also include multiple processors, and therefore the steps performed by one processor as described in this embodiment may also be performed jointly or individually by multiple processors. For example, if the processor of the electronic device performs steps A and B, it should be understood that steps A and B may also be performed jointly by two different processors or individually by one processor. For example, one processor performs step A, and a second processor performs step B, or the first processor and the second processor jointly perform steps A and B.
[0055] In this embodiment, the process definition method disclosed in any implementation can be applied to the processor 30, or implemented by the processor 30.
[0056] The communication unit 40 is used to establish a communication connection between the electronic device 100 and other devices via a network, and to send and receive data via the network.
[0057] In some implementations, the network can be any type of wired or wireless network, or a combination thereof. By way of example only, the network may include wired networks, wireless networks, fiber optic networks, telecommunications networks, intranets, the Internet, local area networks (LANs), wide area networks (WANs), wireless local area networks (WLANs), metropolitan area networks (MANs), public switched telephone networks (PSTNs), Bluetooth networks, ZigBee networks, or near field communication (NFC) networks, or any combination thereof.
[0058] In this embodiment, the display unit 50 provides an interactive interface (e.g., a user interface) between the electronic device 100 and the user for displaying image information. In this embodiment, the display unit 50 can be a liquid crystal display (LCD) or a touch display. If it is a touch display, it can be a capacitive touchscreen or a resistive touchscreen that supports single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations generated from one or more locations on the touch display and pass the sensed touch operations to the processor 30 for calculation and processing.
[0059] To facilitate interaction between the user and the display unit 50, in this embodiment, the electronic device 100 may further include an input / output unit. The input / output unit provides input data to the user, enabling interaction between the user and the electronic device 100. The input / output unit may be, but is not limited to, a mouse and keyboard.
[0060] In some embodiments, the electronic device 100 may include one or N display units 50, where N is a positive integer greater than 1.
[0061] In this embodiment, the electronic device 100 may be, but is not limited to, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), or other electronic devices. This embodiment does not impose any restrictions on the specific type of electronic device. In one implementation, the electronic device may also be a physical server or a service cluster composed of multiple physical servers. This embodiment does not impose any restrictions on the specific type of electronic device.
[0062] Understandably, Figure 1 The structure shown is for illustrative purposes only. The electronic device 100 may also have... Figure 1 Showing more or fewer components, or having with Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.
[0063] based on Figure 1 The implementation architecture of this embodiment provides a data verification method, which is based on... Figure 1 The electronic device shown performs the following based on Figure 1 The structural diagram of the electronic device 100 shown illustrates in detail the steps of the data verification method provided in this embodiment. Please refer to the attached diagram. Figure 2 The data verification method provided in this embodiment includes steps S101 to S104.
[0064] Step S101: Obtain the data to be verified and the data identifier of the data to be verified.
[0065] The data to be verified can be data from resources stored in the CMDB. Resources that can be stored in the CMDB include, but are not limited to, servers, personnel, applications, and domain names. The CMDB treats each resource as an object, stored in a dedicated object model table. Each resource object has a corresponding physical table for storing detailed resource information. In addition to the object tables, the relationships between resource objects can also be stored using a relational model table. For example, Cloud Virtual Machine (CVM) instance resources can be associated with images, disks, IPs, etc., with relationships such as 1:N, 1:1, and N:N. Here, 1:N indicates that one CVM can run N images, disks, IPs, etc.; 1:1 indicates that one CVM can run 1 image, disk, IP, etc.; and N:N indicates that one CVM can run N images, disks, IPs, etc., where N is a positive integer.
[0066] The data to be verified can be specific information about each resource object, the relationships between resource objects, etc. In this embodiment, a data identifier is set for each resource object or the relationship between each resource object. When the data of a resource object is obtained, the data identifier of the resource object is also obtained at the same time.
[0067] Data identifiers can be any type of character, such as letters, numbers, or words, as long as they are unique. Optionally, in this embodiment, data identifiers can be implemented through encoding. For example, for each resource object in the object model table, the data identifier is the object code; for each relation in the relation model table, the data identifier is the relation code.
[0068] Optionally, in this embodiment, a scheduled task, such as the Quartz scheduled task framework, can be set up to periodically read the data and data identifier of the resource object for data verification. This allows for timely detection of data problems while avoiding frequent data verification runs that consume memory resources.
[0069] Step S102: Based on the data identifier, search for the template identifier associated with the data identifier in the preset rule association table.
[0070] The rule association table is a pre-established table used to store the association relationship between data identifiers and template identifiers.
[0071] In this embodiment, after creating a resource object or a relationship between resource objects, a unique data identifier is set for the created resource object or the relationship between resource objects. Then, the object definition and data identifier of the created resource object are associated and stored in the object model table, or the relationship definition and data identifier of the created resource object are associated and stored in the relationship model table.
[0072] In this embodiment, the electronic device also stores a rule template table, which stores the definition of pre-defined rule templates, including fields such as template identifier, type, and template statement.
[0073] The template identifier can be any type of character, such as letters, numbers, or text. It can be understood that the template identifier can also be implemented through encoding, as long as it is unique. The type of rule template can be set according to its function, including object-type rule models and relationship-type rule templates. Object-type rule templates are used to validate specific information of resource objects, while relationship-type rule templates are used to validate relationships between resource objects. For example, when validating information about resource objects, an object-type rule template can be used; when validating relationships between resource objects, a relationship-type rule model can be used. In this embodiment, the template statement represents the rule statement that generates the rule, which can be a Structured Query Language (SQL). The template statement includes statements for validating rules and statements for statistical rules. Statements for validating rules are specific validation logic statements, i.e., statements that verify whether data has problems, including statements for generating details of problematic resources. Statements for statistical rules are statements that statistically analyze the validation results, including statements for counting problematic resources and statements for counting the total number of resources.
[0074] In this embodiment, after storing object definitions and data identifiers in the object model table, or relationship definitions and data identifiers in the relationship model table, a model table interface and a rule template table interface are provided through the display unit. When a user needs to generate rules for validating data using a rule template, they can operate the template identifier of the required rule template in the rule template interface and operate the data identifier of the data to be validated in the model table interface. Then, in response to the user's operation, the template identifier and data identifier determined by the user are bound together, i.e., an association relationship is established, and then stored in the rule association table. Thus, the rule association table stores the data identifier and the template identifier associated with that data identifier.
[0075] Once the device obtains the data to be verified and its data identifier, it searches for the template identifier associated with the data identifier in the rule association table based on the data identifier.
[0076] Step S103: Determine the rule template for the data to be verified based on the template identifier, and generate the target rule based on the rule template.
[0077] Once the template identifier is determined, a rule template with the same template identifier can be found in the rule template table. Then, a target rule is generated based on the definition of the found rule template, that is, a target rule is generated based on the template statement. In other words, a target rule represents a rule used to validate the data to be validated, and it can be executable SQL.
[0078] Optionally, in this embodiment, a rule identifier can also be set for the target rule generated by the rule template. The rule identifier is also unique and can be a combination of a template identifier and a data identifier. For example, for data to be verified with data identifier A, if a rule generated by rule template B is used for verification, then the rule identifier of the rule generated by rule template B is AB. When setting the rule identifier, an association can be established between the rule identifier and the template identifier and data identifier of the rule template, and then stored in a rule association table. Thus, based on the rule association table, the association between the rule template, the generated specific rule, and the verification data can be obtained.
[0079] Step S104: Verify the data to be verified according to the target rules.
[0080] Once the target rule is found, the data to be verified can be verified according to the target rule. In this embodiment, the target rule is an executable SQL statement. The query conditions in the SQL statement are used to filter out data of resources with problems. The query conditions can be to check whether a field of a resource's data is null or to verify the upstream and downstream relationships of the resource, etc. The specific verification logic can be set according to actual needs, and this embodiment does not impose any restrictions.
[0081] The data verification method provided in this embodiment, after obtaining the data to be verified and its data identifier, searches for the template identifier associated with the data identifier in a preset rule association table based on the data identifier, determines the rule template for the data to be verified based on the template identifier, generates a target rule based on the rule template, and then verifies the data to be verified according to the target rule. In this way, by generating target rules through rule templates, the rule configuration operation is simplified, verification time is saved, and efficiency is improved.
[0082] In this embodiment, a rule template represents a standardized representation of multiple rules with similar or identical characteristics, and can be constructed through the following steps:
[0083] The rules in the sample rule set are classified to obtain different categories of rules.
[0084] For each category of rules, a rule template corresponding to that category is generated based on the relevance of the rules in that category.
[0085] The sample rule set includes multiple rules for data validation. These rules can be categorized based on their purpose, grouping rules of the same type together. For example, rules validating information about resource objects can be grouped together, as can rules validating relationships between resource objects. This results in different categories of rules.
[0086] When performing data validation in a CMDB, you can validate either the specific information of a resource object or the relationships between resource objects. Validating the specific information of a resource object can be done through its object definition, while validating the relationships between resource objects can be done through their relationship definitions.
[0087] The definition of a resource object typically includes the same object fields: object code, object name, corresponding physical table name, object data status, object description, and field definitions. Therefore, when validating the specific information of a resource object, this can be achieved through these object fields; that is, the attribute information of the object fields can be extracted for validation. Understandably, the specific attribute information of the object fields differs for different resource objects.
[0088] Regarding the relationships between resource objects in a CMDB, some resources in a CMDB exist as a complete resource relationship chain. For example, a data center, physical machines located in the data center, and disks configured on those physical machines can form a resource relationship chain. These resources have fields for mutual association, which can be used to query resources at different levels. If the corresponding resource cannot be found, it can be considered that there is a problem with the relationship chain, and the resource provider needs to re-verify the resource association relationships.
[0089] When validating data using these fields (including object fields and relational fields), executable SQL statements can be constructed from these fields. These SQL statements can then be used to generate rules for data validation. The SQL statements constructed using these fields are largely similar. For example, SQL statements for validating resource relationships using relational fields are all very similar, as are SQL statements for validating resource object information using object fields. Therefore, for rules of the same category, rule templates corresponding to that category can be constructed based on the similarity of the SQL statements. That is, one rule template corresponds to one category of rules; for example, relational rule templates correspond to rules for validating resource relationships, and object-based rule templates correspond to rules for validating resource information.
[0090] When constructing rule templates for a category based on the similarity of SQL statements, template statements are built using similar or identical SQL statements within that category. Variables in the SQL statements can be replaced with placeholders in the template statements. After constructing the template statements, setting the template identifier and type information completes the rule template construction.
[0091] In this embodiment, after constructing the rule template, rules for validating the data can be generated using the rule template during data validation, saving rule configuration time. For example, when adding a new resource relationship and validating it, it is necessary to add corresponding rules, which is cumbersome. However, with the rule template, when adding a new resource relationship, the applicable rule template can be selected, and the new resource relationship can be associated with the selected rule template to configure the rules. There is no need to repeatedly write similar SQL statements, simplifying rule configuration and saving time.
[0092] Since the data being validated differs, the parameters of the validation rules also differ. Therefore, in this embodiment, when generating the target rule based on the rule template, the following steps can be taken:
[0093] Based on the data identifier, search for the field information corresponding to the data identifier in the preset model table.
[0094] Based on the field information, the rule placeholders in the rule template are replaced to obtain the target rule.
[0095] The template statements in the rule template contain placeholders, making it impossible to validate the data to be validated. Therefore, after obtaining the rule template, the field information corresponding to the data identifier is searched in the model table based on the data identifier.
[0096] The model table stores data identifiers and the field information corresponding to those data identifiers. When searching for the field information corresponding to a data identifier in the model table, you can first search for the target identifier that is the same as the data identifier in the model table, and then obtain the field information associated with the target identifier.
[0097] Understandably, if the data to be verified is information about each resource object, the associated field information can be found in the object model table; if the data to be verified is the relationship between each resource object, the associated field information can be found in the relationship model table.
[0098] In this embodiment, the field information is the specific definition of the resource corresponding to the data. When the data to be verified is the information of each resource object, the field information is the object definition of the resource corresponding to the data; when the data to be verified is the relationship between each resource object, the field information is the relationship definition of the resource corresponding to the data.
[0099] In this embodiment, the object definition may include the object name, the corresponding physical table name, the object data status, the object description, and the field definitions. The relationship definition may include the relationship name, the source object code (data identifier of the source object), the associated fields of the source object, the target object code (data identifier of the target object), the associated fields of the target object, and the relationship type (1:N, 1:1, N:N). Here, the source object represents the source resource in the relationship chain, and the target object represents the adjacent upper and lower layer resources of the current resource. For example, in the context of a data center, physical machines located in the data center, and disks on the physical machines, the adjacent upper layer resource for the physical machine is the data center, and the adjacent lower layer resource is the disk.
[0100] After finding the field information corresponding to the data identifier, the field information can be used to replace the placeholders in the template statement in the rule template to generate the SQL statement to be executed, thus obtaining the target rule. After obtaining the target rule, the target rule can be run to verify the data to be verified.
[0101] Given that users have different validation requirements for different data in practical applications, and in order to meet these requirements and improve the flexibility of rule template generation, this embodiment provides a data validation method that further includes the following steps before validating the data to be validated according to the target rule:
[0102] Based on the data identifier, check whether the rule parameter associated with the data identifier is stored in the rule association table.
[0103] If rule parameters exist, the target rule is updated based on the rule parameters to obtain the updated target rule.
[0104] Accordingly, the data to be validated is validated according to the target rules, including:
[0105] The data to be validated is validated according to the updated target rules.
[0106] Among them, the rule parameters are user-defined parameters. When a user is validating a rule generated by a rule template for sampling data to be validated, if the user needs to modify the rule generated by the rule template, such as modifying the parameters of one of the rules or deleting a rule, the user can define the rule parameters in the rule association table and associate the defined rule parameters with the data identifier.
[0107] In an optional implementation, the rule parameters can be associated with at least one of the template identifier and the corresponding rule identifier, so that the corresponding rule parameters can be found based on the template identifier or the rule identifier.
[0108] In this embodiment, the rule parameters can be stored in the rule association table in JSON format. After the rule parameters are found, the target rule can be updated according to the rule parameters to obtain the updated target rule. Then, the target rule is run to verify the data to be verified.
[0109] In this embodiment, if the template identifier associated with the data identifier is not found in the preset rule association table according to the data identifier, the user can be prompted with the message "Unable to find associated template information". At the same time, the rule configuration interface is displayed to the user through the display unit so that the user can configure the rules in the rule configuration interface.
[0110] To improve the flexibility of the rules, in this embodiment, before data verification, a data verification interface can be displayed to the user via a display unit. The data verification interface includes buttons for template verification and rule configuration verification. When the user needs to perform data verification using rules generated from a rule template, they can click the template verification button. The device then responds to the user's operation by obtaining the data to be verified and its data identifier from the CMDB. When the user needs to perform data verification using custom rules, they can click the rule configuration verification button. The device then responds to the user's operation by displaying a rule configuration interface, allowing the user to configure the rules according to the interface.
[0111] In this embodiment, when configuring the rules in the rule configuration interface, it is also necessary to configure the rule identifier, rule name, problem resource details generation statement, problem resource count statement, and total resource count statement. Specifically, in this embodiment, the rule configuration interface includes input boxes for the rule identifier, rule name, problem resource details generation statement, problem resource count statement, and total resource count statement. Through these input boxes, the user can input information such as the rule identifier, rule name, problem resource details generation statement, problem resource count statement, and total resource count statement. The device, in response to the user's input, generates verification data and rules for statistically analyzing the verification results based on the input rule identifier, rule name, problem resource details generation statement, problem resource count statement, and total resource count statement. It can be understood that the problem resource details generation statement is the rule statement for verifying whether the data has a problem, and the problem resource count statement and total resource count statement are the rule statements for statistically analyzing the verification results.
[0112] In this embodiment, to allow rules to be repeatedly modified during the initial design phase, the rule configuration interface can also include input boxes for information such as service identifier, inclusion in assessment identifier, and inclusion in assessment time. The service identifier is the identifier of the service to which the rule belongs. The inclusion in assessment identifier indicates whether the rule is included in accuracy statistics, and is categorized as included in accuracy statistics, not included in accuracy statistics, and pending inclusion in accuracy statistics. If a configured rule needs to be included in accuracy statistics, it is marked as included in accuracy statistics; if a configured rule does not need to be included in accuracy statistics, it is marked as not included in accuracy statistics; if a configured rule needs to wait to be included in accuracy statistics, it is marked as pending inclusion in accuracy statistics. The inclusion in assessment time indicates the time it takes for a rule pending inclusion in accuracy statistics to be automatically included in the accuracy statistics.
[0113] Understandably, information such as service identifier, assessment inclusion identifier, and assessment inclusion time can also be configured for template statements in the rule template.
[0114] In this embodiment, the rules configured through the rule configuration interface can be stored in the rule table of the database. When data verification is performed, the rules in the rule table can be read and the rules can be run.
[0115] The data verification method provided in this embodiment can generate rules through a rule configuration page or through a rule template, and the rules can be modified according to user needs, thus improving the flexibility of rule management.
[0116] In this embodiment, data validation can be performed using both the target rule generated by the rule template and the rules in the rule table. Since both the target rule generated by the rule template and the rule table contain multiple rules, to improve efficiency, a sub-thread can be created for each rule's execution, utilizing multi-threading technology to enhance rule execution efficiency. The validation of the data to be validated will be explained below using the target rule generated by the rule template.
[0117] Since the target rules generated by the rule template include both validation rules and statistical rules, in this embodiment, the data to be validated is validated according to the target rules, including:
[0118] According to the verification rules, the data to be verified is verified to obtain the verification result.
[0119] According to the statistical rules, the verification results of the data to be verified are statistically analyzed to obtain the statistical results.
[0120] The verification rules are the rules used to generate the problem resource details generation statement. This statement can be a query condition statement, such as checking for null values in the fields of the data to be verified or querying the upstream and downstream relationships of resources. By running the verification rules, problematic resources and non-problematic resources can be filtered from the data to be verified. In this embodiment, the verification result includes both the verified problematic resources and the non-problematic resources.
[0121] After obtaining the verification results of the data to be verified, statistical rules can be used to statistically analyze these results and obtain statistical results. In this embodiment, the statistical rules are those generated by the problematic resource counting statement and the total resource count statement. The rules generated by the problematic resource counting statement are used to count resources with problems, while the rules generated by the total resource count statement are used to count the total number of resources. Therefore, this embodiment obtains statistical results by statistically analyzing the verification results of the data to be verified, including the number of problematic resources in the data to be verified and the total number of resources in the data to be verified.
[0122] In an optional implementation, after obtaining the statistical results, the statistical results can be saved using a rule result table.
[0123] In this embodiment, the rule result table is used to store the rule aggregation results after the rule execution is completed. Optionally, it can store the rule aggregation results of the most recent execution. The rule result table includes fields such as rule identifier, service identifier, number of issues, and cardinality. The rule identifier is the identifier of the rule used to verify the data; the service identifier is the identifier of the service to which the rule used to verify the data belongs; the number of issues is the number of resources with issues detected during the rule execution; and the cardinality is the total number of resources verified by the rule.
[0124] In this embodiment, after storing the statistical results in the rule result table, the rule result table can be pushed to the resource data provider and displayed through the display unit, so as to facilitate analysis and processing through the statistical results.
[0125] This embodiment obtains statistical results by statistically analyzing the problematic resources and the total number of resources, which facilitates the analysis and processing of the data to be verified.
[0126] To more intuitively reflect the accuracy of resource data, it is necessary to statistically analyze the accuracy rate of the problem data generated by the rules. Based on this, after verifying the data to be verified according to the verification rules and obtaining the verification result of the data to be verified, the data verification method provided in this embodiment may further include the following steps:
[0127] Based on the verification results of the data to be verified, update the result data in the preset details table.
[0128] The accuracy of the results data in the updated preset details table is calculated according to the set dimensions.
[0129] Specifically, for each piece of data to be verified, after each rule is executed for verification, the verification result data is stored in a preset detail table. Thus, the preset detail table stores the result data of different pieces of data to be verified multiple times.
[0130] In this embodiment, the result data in the preset detail table represents specific resource issue records after the rule execution. This includes the unique identifier of the problematic resource, the issue value, and the issue start time. Each record can be understood as an issue order. Therefore, the preset detail table may include fields such as rule identifier, resource identifier, issue value, and issue start time. The rule identifier is the identifier of the rule used to verify the data. The resource identifier is the unique identifier of the problematic resource. The issue value is the value recorded for the resource that was found to have a problem, which contradicts the rule. The issue start time is the time when the issue was most recently detected.
[0131] In this embodiment, after obtaining the verification result of the data to be verified, the result data in the preset detail table can be updated according to the verification result of the data to be verified.
[0132] Since the preset detail table stores records of specific resource issues after the rules are executed, updating the result data in the preset detail table based on the verification results of the data to be verified means updating the result data in the preset detail table based on the issues detected in the data to be verified.
[0133] In this embodiment, the step of updating the result data in the preset detail table based on the verification result of the data to be verified may include:
[0134] The verification result of the data to be verified is compared with the result data in the preset detail table to obtain the newly added result data and the processed result data in the preset detail table.
[0135] Insert new result data into the preset detail table, and remove processed result data from the preset detail table.
[0136] Since the preset detail table stores multiple result data for different data to be verified, comparing the verification result of the data to be verified with the result data in the preset detail table means comparing the result data of the same data to be verified in the preset detail table using the same rules with the verification result of the data to be verified.
[0137] By comparing the result data of the same data to be verified in the preset detail table with the verification result of the data to be verified, the newly added result data and the processed result data in the preset detail table can be obtained.
[0138] In this embodiment, the newly added result data is the data that is not in the preset detail table but exists in the verification result of the data to be verified after comparing the verification result of the data to be verified with the result data in the preset detail table.
[0139] Data that does not exist in the preset details table but exists in the verification results of the data to be verified is considered a new problem detected in this verification of the data to be verified. In other words, the newly added result data represents a new problem detected in this verification of the data to be verified.
[0140] The processed result data refers to the data that is not present in the result data of the data to be verified but exists in the preset detail table after comparing the verification result of the data to be verified with the result data of the preset detail table. Data that is not present in the result data of the data to be verified but exists in the preset detail table indicates that the problem with that data has been processed and was not detected in this verification.
[0141] Understandably, data that exists in the preset details table and also exists in the verification results of the data to be verified is considered to have an unresolved problem and is considered unprocessed result data.
[0142] For newly added result data, the new result data can be inserted into the preset detail table for storage. For unprocessed result data, it will continue to be saved in the preset detail table for processing. For processed result data, it can be closed in the preset detail table, and then the processed result data can be removed from the preset detail table and stored in the historical data table for archiving, so as to facilitate the traceability of subsequent issues.
[0143] To facilitate comparison between the verification results of the data to be verified and the results in the preset detail table, a temporary table is set up in this embodiment to store the verification results of the data to be verified. Then, the results in the preset temporary table are compared with the results in the preset detail table, which facilitates data analysis and processing.
[0144] The fields in the preset temporary table are the same as those in the preset details table. It is mainly used to temporarily store the verification results generated by this rule execution, that is, the problem tickets generated by this rule execution.
[0145] When storing the verification results generated by the current rule in a preset temporary table, it is necessary to clear the previous verification results stored in the preset temporary table. In this embodiment, since the rules are run by multiple threads, each thread has different running efficiency. Some threads are more efficient and obtain the verification results first, saving them to the preset temporary table first, while other threads are less efficient and obtain the verification results more slowly. Thus, when running one rule, clearing all the verification results in the preset temporary table will also clear the current verification results of the rules run by other threads.
[0146] Therefore, in this embodiment, for each rule, when running the rule, only the verification result of the previous run corresponding to that rule in the preset temporary table is cleared, and then the verification result of the current run is recorded. In this embodiment, when searching for the previous run verification result to be cleared in the preset temporary table for each rule, the search can be performed based on the rule identifier of the rule. If a target rule identifier with the same rule identifier as the rule exists in the preset temporary table, the verification result record corresponding to the target rule identifier in the preset temporary table is cleared, and then the verification result of the current run of the rule is recorded. If no target rule identifier with the same rule identifier as the rule exists in the preset temporary table, the verification result of the current run of the rule is directly stored in the preset temporary table.
[0147] In this way, the verification results of the data to be verified in this run can be stored in a preset temporary table. Since the fields in the preset temporary table are the same as those in the preset detail table, storing the verification results of the data to be verified in the preset temporary table makes it easy to quickly compare the verification results of the data to be verified with the results data in the preset detail table.
[0148] In this embodiment, by comparing the verification result of the data to be verified with the result data in the preset detail table, the unprocessed result data, processed result data, and newly added result data can be quickly obtained, which facilitates data analysis and processing.
[0149] In this embodiment, the preset detail table is updated by inserting new result data into the preset detail table for storage and removing the processed result data from the preset detail table.
[0150] After updating the preset details table, the accuracy of the results data in the updated preset details table can be statistically analyzed.
[0151] Optionally, in this embodiment, the accuracy of the result data in the preset detail table can be statistically analyzed according to a set period. For example, if the set period is 24 hours, the accuracy of the result data stored in the preset detail table can be statistically analyzed every 24 hours. It is understood that if there are multiple data verifications within 24 hours, the result data in the preset detail table needs to be updated after each data verification. That is, within 24 hours, the preset detail table can include the verification results of multiple data verification runs. Optionally, in this embodiment, the accuracy of the result data in the preset detail table can also be statistically analyzed after each data verification. For example, after verifying the current data to be verified, the result data in the preset detail table is updated based on the verification results, and then the accuracy of the updated result data in the preset detail table can be statistically analyzed.
[0152] In this embodiment, when calculating the accuracy of the result data in the preset detail table, the accuracy of the result data in the updated preset detail table can be calculated according to a set dimension. The set dimension can be, but is not limited to, resource dimension, rule dimension, and service dimension. For each dimension, after grouping according to that dimension, the accuracy of each group can be calculated.
[0153] In this embodiment, the accuracy of the result data in the preset detail table can also be calculated using SQL. The statistics can be performed using functions such as count, sum, and if, as well as group by. Dimensional grouping can be achieved using the group by command, and the accuracy calculation can be achieved using functions such as count, sum, and if.
[0154] It should be noted that, in this embodiment, when performing accuracy statistics on the result data in the preset detail table, the verification results of rules marked as not included in the accuracy assessment statistics, as well as the verification results of rules marked as pending inclusion in the accuracy assessment but whose assessment time has not yet arrived, need to be excluded. That is, in this embodiment, the accuracy statistics only apply to the verification results of rules marked as included in the accuracy assessment statistics, and the verification results of rules marked as pending inclusion in the accuracy assessment but whose assessment time has already arrived.
[0155] In this embodiment, after the accuracy statistics of the result data are performed, the accuracy statistics results can be displayed through the display unit and sent to the resource data provider so that the resource data provider can repair the managed resource data.
[0156] The data verification method provided in this embodiment can set standards for resource data providers based on the accuracy of the result data by statistically analyzing the accuracy, thereby urging resource data providers to repair the resource data under their management and improving the overall data accuracy of the CMDB.
[0157] To facilitate a clear understanding of the implementation process of the data verification method provided in this embodiment, a specific implementation method is described below. After obtaining the target rule for data verification through a rule template or a rule table in the database, this embodiment first clears the data in the rule result table, backs up the target rule, and then updates the inclusion flag of the target rule to include it in the accuracy assessment statistics. This updates the inclusion flag of target rules that are to be included in the accuracy assessment statistics but whose assessment time has expired. Next, the target rule is run. Based on the rule flag of the target rule, the corresponding result data in the preset temporary table is cleared, and the verification result of the target rule is stored in the preset temporary table. The result data in the preset temporary table is compared with the result data in the preset detailed table to update the result data in the preset detailed table. Then, accuracy statistics are performed on the updated result data in the preset detailed table, and the accuracy statistics results are output. Simultaneously, the verification result of the target rule is statistically analyzed, and the statistical results are stored in the rule result table, which is then input into the rule result table.
[0158] The data verification method provided in this embodiment, after obtaining the data to be verified and its data identifier, searches for the template identifier associated with the data identifier in a preset rule association table based on the data identifier, determines the rule template for the data to be verified based on the template identifier, generates a target rule based on the rule template, and then verifies the data to be verified according to the target rule. In this way, by generating target rules through rule templates, the rule configuration operation is simplified, verification time is saved, and efficiency is improved.
[0159] The data verification method provided in this embodiment can set standards for resource data providers based on the accuracy of the result data by statistically analyzing the accuracy. This can urge resource data providers to repair the resource data they manage, thereby improving the overall data accuracy of the CMDB and helping operation and maintenance personnel to use the CMDB more effectively.
[0160] Based on the same inventive concept, please refer to the following: Figure 3 This embodiment also provides a data verification device 10, which is applied to... Figure 1 The electronic devices shown, such as Figure 3 As shown, the data verification device 10 provided in this embodiment includes a data acquisition module 11, an identifier lookup module 12, a rule generation module 13, and a data verification module 14.
[0161] The data acquisition module 11 is used to acquire the data to be verified and the data identifier of the data to be verified.
[0162] The identifier lookup module 12 is used to look up the template identifier associated with the data identifier in a preset rule association table based on the data identifier; the rule association table stores at least one data identifier and the template identifier associated with the data identifier.
[0163] The rule generation module 13 is used to determine the rule template of the data to be verified based on the template identifier, and generate the target rule based on the rule template.
[0164] The data verification module 14 is used to verify the data to be verified according to the target rules.
[0165] In an optional implementation, the rule generation module 13 is used for:
[0166] Based on the data identifier, search for the field information corresponding to the data identifier in the preset model table; the model table stores at least one data identifier and the field information corresponding to that data identifier.
[0167] Based on the field information, the rule placeholders in the rule template are replaced to obtain the target rule.
[0168] In an optional implementation, the data verification device 10 further includes a template generation module. Before searching for the template identifier associated with the data identifier in a preset rule association table based on the data identifier, the template generation module is used to:
[0169] The rules in the sample rule set are classified to obtain different categories of rules.
[0170] For each category of rules, a rule template corresponding to that category is generated based on the similarity of the rules in that category.
[0171] In an optional implementation, the target rules include verification rules and statistical rules; the data verification module 14 is used for:
[0172] According to the verification rules, the data to be verified is verified to obtain the verification result.
[0173] According to the statistical rules, the verification results of the data to be verified are statistically analyzed to obtain the statistical results.
[0174] In an optional implementation, after verifying the data to be verified according to the verification rules and obtaining the verification result of the data to be verified, the data verification module 14 is further used for:
[0175] Based on the verification results of the data to be verified, the result data in the preset detail table is updated; the preset detail table stores the result data of different data to be verified.
[0176] The accuracy of the results data in the updated preset details table is calculated according to the set dimensions.
[0177] In an optional implementation, the result data in the preset detail table is updated based on the verification result of the data to be verified. The data verification module 14 is further configured to:
[0178] The verification result of the data to be verified is compared with the result data in the preset detail table to obtain the newly added result data and the processed result data in the preset detail table.
[0179] Insert new result data into the preset detail table, and remove processed result data from the preset detail table.
[0180] In an optional implementation, before validating the data to be validated according to the target rules, the data validation module 14 is further configured to:
[0181] Based on the data identifier, check whether the rule parameter associated with the data identifier is stored in the rule association table.
[0182] If rule parameters exist, the target rule is updated based on the rule parameters to obtain the updated target rule.
[0183] The data to be validated is validated according to the target rules, including:
[0184] The data to be validated is validated according to the updated target rules.
[0185] The data verification device provided in this embodiment, after acquiring the data to be verified and its data identifier, searches for the template identifier associated with the data identifier in a preset rule association table based on the data identifier, determines the rule template for the data to be verified based on the template identifier, generates a target rule based on the rule template, and then verifies the data to be verified according to the target rule. In this way, generating target rules through rule templates simplifies rule configuration operations, saves verification time, and improves efficiency.
[0186] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the data verification device 10 described above can be referred to the corresponding process in the aforementioned method, and will not be elaborated further here.
[0187] Based on the above, this embodiment provides a readable storage medium, which includes a computer program. When the computer program is executed, it controls the electronic device where the readable storage medium is located to perform the data verification method described in any of the foregoing embodiments.
[0188] The readable storage medium can be, but is not limited to, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, and other media capable of storing program code.
[0189] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the readable storage medium described above can be referred to the corresponding process in the aforementioned method, and will not be elaborated further here.
[0190] In summary, the data verification method, apparatus, electronic device, and readable storage medium provided in this embodiment of the invention, after obtaining the data to be verified and its data identifier, search for a template identifier associated with the data identifier in a preset rule association table based on the data identifier, determine the rule template for the data to be verified based on the template identifier, generate a target rule based on the rule template, and then verify the data to be verified according to the target rule. Thus, by generating target rules through rule templates, the rule configuration operation is simplified, verification time is saved, and efficiency is improved.
[0191] In the several embodiments provided in this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus and method embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0192] In addition, the functional modules in the embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0193] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. In the absence of further restrictions, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0194] The above descriptions are merely various embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A data verification method, characterized in that, The method includes: Obtain the data to be verified and its data identifier; wherein the data to be verified is information about a resource object or a relationship between the resource objects; Based on the data identifier, the template identifier associated with the data identifier is searched in a preset rule association table; the rule association table stores at least one data identifier and a template identifier associated with the data identifier. Based on the template identifier, a rule template for the data to be verified is determined, and a target rule is generated based on the rule template. The rule template is either an object-type rule template or a relationship-type rule template. The object-type rule template is used to verify the information of resource objects, and the relationship-type rule template is used to verify the relationships between resource objects. The data to be verified is verified according to the target rules. Before searching for the template identifier associated with the data identifier in a preset rule association table based on the data identifier, the method further includes: The rules in the sample rule set are classified to obtain different categories of rules; For each category of rules, a rule template corresponding to that category is generated based on the similarity of the rules in that category. The step of generating target rules based on the rule template includes: Based on the data identifier, the field information corresponding to the data identifier is searched in a preset model table; the model table stores at least one data identifier and the field information corresponding to the data identifier. Based on the field information, the rule placeholders in the rule template are replaced to obtain the target rule.
2. The data verification method according to claim 1, characterized in that, The target rules include verification rules and statistical rules; the verification of the data to be verified according to the target rules includes: According to the verification rules, the data to be verified is verified to obtain the verification result of the data to be verified. According to the statistical rules, the verification results of the data to be verified are statistically analyzed to obtain the statistical results.
3. The data verification method according to claim 2, characterized in that, After verifying the data to be verified according to the verification rules and obtaining the verification result of the data to be verified, the method further includes: Based on the verification result of the data to be verified, the result data in the preset detail table is updated; wherein, the preset detail table stores the result data of different data to be verified. The accuracy of the results data in the updated preset details table is calculated according to the set dimensions.
4. The data verification method according to claim 3, characterized in that, The step of updating the result data in the preset detail table based on the verification result of the data to be verified includes: The verification result of the data to be verified is compared with the result data in the preset detail table to obtain the newly added result data and the processed result data in the preset detail table; The newly added result data is inserted into the preset detail table, and the processed result data is removed from the preset detail table.
5. The data verification method according to claim 1, characterized in that, Before verifying the data to be verified according to the target rule, the method further includes: Based on the data identifier, check whether the rule parameter associated with the data identifier is stored in the rule association table; If the rule parameters exist, the target rule is updated according to the rule parameters to obtain the updated target rule; The step of validating the data to be verified according to the target rule includes: The data to be verified is verified according to the updated target rules.
6. A data verification device, characterized in that, The data verification device includes: The data acquisition module is used to acquire the data to be verified and the data identifier of the data to be verified; wherein, the data to be verified is information about resource objects or the relationship between the resource objects; The identifier lookup module is used to look up the template identifier associated with the data identifier in a preset rule association table based on the data identifier; the rule association table stores at least one data identifier and the template identifier associated with the data identifier; The rule generation module is used to determine the rule template of the data to be verified based on the template identifier, and to generate target rules based on the rule template; the rule template is an object type rule template or a relationship type rule template; the object type rule template is used to verify the information of resource objects, and the relationship type rule template is used to verify the relationship between resource objects; The data verification module is used to verify the data to be verified according to the target rules. The identifier lookup module is also used to classify the rules in the sample rule set to obtain rules of different categories. For each category of rules, a rule template corresponding to that category is generated based on the similarity of the rules in that category. The step of generating target rules based on the rule template includes: Based on the data identifier, the field information corresponding to the data identifier is searched in a preset model table; the model table stores at least one data identifier and the field information corresponding to the data identifier. Based on the field information, the rule placeholders in the rule template are replaced to obtain the target rule.
7. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data verification method according to any one of claims 1 to 5.
8. A readable storage medium, characterized in that, The readable storage medium includes a computer program, which, when executed, controls the electronic device containing the readable storage medium to perform the data verification method according to any one of claims 1 to 5.