Government affair field-oriented ai model detection method and device and electronic equipment
By building a knowledge base in the field of government affairs, generating multi-dimensional test cases, and automating the detection of AI models, the problem of low detection efficiency in existing technologies has been solved, and efficient multi-dimensional detection of government affairs AI models has been achieved.
Patent Information
- Application Number
- CN202611675794.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-28
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, general-purpose AI model detection tools have low detection efficiency in the government sector, making it difficult to effectively detect problems in dimensions other than performance, and relying on manual detection is inefficient.
A knowledge base for the government sector is built, which generates multi-dimensional test cases based on laws, regulations, standards, business specifications, and historical testing data. The system automatically tests the compliance, scenario adaptability, security, and performance of AI models, and generates test results by acquiring the AI models to be tested and the testing requirements.
It has enabled multi-dimensional automated detection of AI models in the government sector, improving detection efficiency, reducing reliance on manual detection, and enhancing the accuracy and comprehensiveness of detection.
Smart Images

Figure CN123178583A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer science, and specifically to an AI model detection method, apparatus, and electronic device for the government sector. Background Technology
[0002] With the rapid development of artificial intelligence technology, AI models such as natural language processing, computer vision, and decision reasoning have been widely applied in the field of government services, such as intelligent question answering and administrative approval assistance.
[0003] In existing technologies, general-purpose AI model detection tools are often used to inspect AI models in the government sector. However, these tools are typically built on publicly available datasets or industry standards, primarily focusing on detecting performance-related issues (such as accuracy, recall, response time, and throughput). Issues in dimensions other than performance still rely on manual inspection, resulting in low efficiency. Summary of the Invention
[0004] This application provides an AI model detection method, apparatus, and electronic device for the government sector, which can improve the problem of low efficiency in the detection of AI models for the government sector in the prior art.
[0005] This application provides an AI model detection method for the government sector, the method comprising: The process involves: acquiring regulations, standards, business specifications, and historical testing data in the government sector; constructing a knowledge base based on these data; acquiring the AI model to be tested and testing requirements, including testing accuracy standards and testing dimensions for the AI model; determining the indicators to be tested based on the dimensions and the knowledge base; generating multiple test cases using the knowledge base based on the indicators; processing the multiple test cases using the AI model to be tested to obtain model processing results; determining the indicator results for the indicators based on the model processing results, standard results, and the testing accuracy standards; and generating the testing results for the AI model based on the indicator results and the model processing results.
[0006] This application provides an AI model detection device for the government sector, the device comprising: The knowledge base construction unit is used to acquire laws, regulations, standards, business specifications, and historical testing data in the field of government affairs, and to construct a knowledge base based on the laws, regulations, standards, business specifications, and historical testing data. The model acquisition unit is used to acquire the AI model to be detected and the detection requirements, wherein the detection requirements include the detection accuracy standard and the detection dimensions for the AI model to be detected; The indicator determination unit is used to determine the indicator to be detected based on the dimension to be detected and the knowledge base; The test case generation unit is used to generate multiple test cases based on the indicator to be detected using the knowledge base; The indicator result determination unit is used to process the multiple test cases using the AI model to be detected, obtain the model processing result, and determine the indicator result of the indicator to be detected based on the model processing result, the standard result, and the detection accuracy standard. The detection result generation unit is used to generate the detection result of the AI model to be detected based on the indicator result and the model processing result.
[0007] In one implementation, the knowledge base construction unit includes: The compliance indicator subunit is used to break down the aforementioned regulations and standards into compliance indicators; The scenario adaptation subunit is used to decompose the business specifications into scenario adaptation indicators; The data partitioning subunit is used to divide the historical detection data into test cases and problem cases; The knowledge base construction subunit is used to construct the knowledge base based on the compliance indicators, scenario adaptability indicators, test cases, and problem cases.
[0008] In one implementation, the compliance indicator subunit includes: The constraint word identification sub-unit is used to perform semantic understanding of the regulatory standards and identify the regulatory constraint words in the regulatory standards. The detection index determination sub-unit is used to determine the detection index corresponding to the regulatory constraint word based on the semantics of the regulatory constraint word.
[0009] In one implementation, the business specifications include multiple process nodes, flow conditions between two adjacent process nodes, and data types corresponding to each process node. The scenario adaptability indicators include business process matching degree and cross-departmental data compatibility. Correspondingly, the scene adaptation subunit includes: The data extraction sub-unit is used to extract the process nodes, flow conditions and data types corresponding to the process nodes from the business specifications, and to determine the standard order of the business process based on the process nodes, flow conditions and data types corresponding to the process nodes. The business matching degree sub-unit is used to determine the calculation method of the business process matching degree based on the standard order of the business process; The sub-unit for the total number of management departments is used to obtain the management department corresponding to each process node in the plurality of process nodes, and thus obtain the total number of management departments corresponding to the plurality of process nodes. The data compatibility sub-unit is used to determine the calculation method for cross-departmental data compatibility based on the management department corresponding to each process node and the total number of management departments.
[0010] In one implementation, the data is divided into sub-units, including: The data structure acquisition sub-unit is used to acquire the data structure of the historical detection data for each of the historical detection data. The question-and-answer type test case determination sub-unit is used to determine that the historical detection data is a question-and-answer type test case when the data structure is input data and text output data that corresponds to the input data. The audit-type test case determination sub-unit is used to determine the historical detection data as an audit-type test case when the data structure is input data and multiple candidate output options corresponding to the input data; The problem case determination sub-unit is used to determine the historical detection data as a problem case when the data structure is a single input data.
[0011] In one implementation, the problem cases include performance-related problem cases and security-related problem cases; correspondingly, the device further includes: The keyword extraction unit is used to extract keywords from the historical detection data. The performance case determination unit is used to determine that the historical detection data is a performance-related problem case when the keyword hits the set of performance-related keywords. The security case determination unit is used to determine that the historical detection data is a security issue case when the keyword matches the set of security keywords.
[0012] In one implementation, the knowledge base construction subunit includes: The general indicator acquisition subunit is used to acquire general detection indicators; the general detection indicators include safety indicators and performance indicators. The knowledge base construction sub-unit is used to construct the knowledge base based on the compliance indicators, scenario adaptability indicators, security indicators, performance indicators, test cases, and problem cases. Correspondingly, the indicator determination unit includes: The dimension matching subunit is used to match the dimension to be detected with the dimensions to which the indicators included in the knowledge base belong, so as to obtain the dimension result of the knowledge base. The dimensions to which the indicators included in the knowledge base belong include compliance, scenario adaptability, security, and performance. The indicator determination subunit is used to determine the indicator corresponding to the dimension result, denoted as the indicator to be detected.
[0013] In one embodiment, the device further includes: The suggestion generation unit is used to generate optimization suggestions based on the detection results when the detection results indicate that the AI model to be detected does not meet the preset detection requirements, so that the AI model to be detected can be optimized based on the optimization suggestions to obtain an optimized AI model to be detected. The step jump unit is used to jump to the step: "Determine the indicator to be detected based on the dimension to be detected and the knowledge base" until the detection result indicates that the AI model to be detected meets the preset detection requirements.
[0014] This application also provides an electronic device, including a processor and a memory, wherein the memory stores multiple instructions; the processor loads instructions from the memory to execute the steps in any of the AI model detection methods for the government sector provided in this application.
[0015] This application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the AI model detection methods for the government sector provided in this application.
[0016] This application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps in any of the AI model detection methods for the government sector provided in this application.
[0017] The AI model detection method for the government sector provided in this application embodiment can acquire regulations, standards, business specifications, and historical detection data in the government sector, and construct a knowledge base based on these three. The knowledge base includes detection indicators corresponding to regulations and standards, as well as detection indicators corresponding to business specifications. This application embodiment can also acquire the AI model to be detected and the detection requirements, including detection accuracy standards and the dimensions to be detected. Based on the knowledge base and the dimensions to be detected, the indicators to be detected are determined, and multiple test cases are generated. The test cases are input into the AI model to be detected to obtain the output results of the AI model (i.e., the model processing results). Combined with the standard results and detection accuracy standards, the indicator results of the indicators to be detected are determined, thereby generating the detection results of the AI model to be detected.
[0018] In this embodiment, a knowledge base can be constructed by acquiring regulations, standards, business specifications, and historical testing data in the government sector. After acquiring the testing requirements, including the dimensions to be tested, the indicators to be tested are determined specifically based on the knowledge base and the dimensions to be tested, thereby automatically generating test cases covering multiple dimensions. The test cases are input into the AI model to be tested to obtain the model processing results, and the indicator results of each indicator are determined by combining the standard results and the testing accuracy standards. Because the construction of the knowledge base integrates government-specific regulations and business specifications, the determination of the indicators to be tested has domain-specific characteristics, thereby automating the non-performance dimension testing that originally relied on manual execution and improving the multi-dimensional testing efficiency of AI models for the government sector. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating an AI model detection method for the government sector provided in a specific embodiment of this application. Figure 2 This is a flowchart illustrating an AI model detection method for the government sector provided in another specific embodiment of this application; Figure 3 This is a schematic diagram of a structure of an AI model detection device for the government sector provided in one embodiment of this application; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] This application provides an AI model detection method, apparatus, and electronic device for the government sector.
[0023] Specifically, the AI model detection device for the government sector can be integrated into an electronic device, such as a terminal or server. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal and server can be directly or indirectly connected via wired or wireless communication; this application does not impose any restrictions.
[0024] In some embodiments, the AI model detection device for the government sector can also be integrated into multiple electronic devices. For example, the AI model detection device for the government sector can be integrated into multiple servers, and the AI model detection method for the government sector of this application can be implemented by multiple servers.
[0025] In some embodiments, the terminal can also be used as a server to implement some or all of the functions of a server.
[0026] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0027] The method provided in this application embodiment may include: acquiring regulations, standards, business specifications, and historical testing data in the government affairs field, and constructing a knowledge base based on the regulations, standards, business specifications, and historical testing data, wherein the knowledge base includes testing indicators corresponding to the regulations, standards, and business specifications; acquiring an AI model to be tested and testing requirements, wherein the testing requirements include testing accuracy standards and testing dimensions for the AI model to be tested; determining testing indicators based on the testing dimensions and the knowledge base; generating multiple test cases based on the testing indicators using the knowledge base; processing the multiple test cases using the AI model to be tested to obtain model processing results, and determining indicator results for the testing indicators based on the model processing results, standard results, and the testing accuracy standards; and generating testing results for the AI model to be tested based on the indicator results and the model processing results.
[0028] The above method constructs a knowledge base by acquiring regulations, standards, business specifications, and historical testing data from the government sector. After obtaining testing requirements including the dimensions to be tested, it determines the indicators to be tested based on the knowledge base and the dimensions to be tested, and then automatically generates test cases covering multiple dimensions. The test cases are input into the AI model to be tested to obtain the model processing results, and the indicator results for each indicator are determined by combining the standard results and the testing accuracy standards. Because the construction of the knowledge base integrates government-specific regulations and business specifications, the determination of the indicators to be tested has domain-specific characteristics, thereby automating the non-performance dimension testing that originally relied on manual execution, and improving the multi-dimensional testing efficiency of AI models for the government sector.
[0029] The following sections provide detailed descriptions of each example. It should be noted that the sequence numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0030] In this embodiment, an AI model detection method for the government sector is provided, such as... Figure 1 As shown, the specific process of this method may include the following steps 110 to 160: 110. Obtain regulations, standards, business specifications, and historical testing data in the government affairs field, and construct a knowledge base based on the regulations, standards, business specifications, and historical testing data, wherein the knowledge base includes testing indicators corresponding to the regulations, standards, and business specifications.
[0031] The "government affairs sector" refers to the areas in which government agencies, public institutions, and public service organizations conduct business activities in scenarios such as administrative approval, government services, strategic consulting, and social governance.
[0032] Regulatory standards refer to laws, regulations, departmental rules, industry standards, technical standards, and management measures related to government affairs and AI model applications, such as provisions on personal information protection, data security, administrative licensing, and government data sharing. For example, specific regulatory standards may include the "Data Security Law of the People's Republic of China" and the "Interim Measures for the Administration of Sharing Government Information Resources."
[0033] Business standards refer to the binding conditions established by government departments in the actual handling of matters, such as process rules, material requirements, processing time limits, and data format requirements. For example, business standards may include the administrative approval processes and government service response standards of various government departments.
[0034] Historical testing data refers to data generated during the testing of government AI models over a past period. Historical testing data may include historical test cases, historical testing results, typical error cases, testing reports, and problem records.
[0035] Testing indicators refer to specific quantitative standards related to regulations, standards, and business specifications, used to measure whether an AI model under test meets the requirements.
[0036] Optionally, in one embodiment, step 110 may specifically include the following steps 111 to 114: 111. Decompose the aforementioned regulations and standards into compliance indicators.
[0037] Compliance indicators refer to the quantitative metrics used in government AI model testing to assess the legality and compliance of AI models in terms of content generation, decision-making logic, and operational security, based on current laws, regulations, industry standards, and administrative procedures. For example, compliance indicators may include data anonymization rate and access control levels. Optionally, in one implementation, step 111 may specifically include the following steps 1111 to 1112: 1111. Perform semantic understanding on the aforementioned regulations and standards to identify the regulatory constraint terms in the regulations and standards.
[0038] Semantic understanding refers to the use of natural language processing to identify key subjects, behavioral requirements, and constraints in legal texts, thereby understanding the specific requirements that the provisions impose on AI models or government operations.
[0039] Regulatory binding terms refer to keywords or phrases in regulatory texts that express prohibitions, conditional requirements, or degree of requirement. For example, regulatory binding terms may include "authorized," "must not disclose," and "de-identification."
[0040] Optionally, document parsing technology can be used to extract the regulatory text, and regular expressions can be used to segment the regulations into fine-grained segments according to "chapter-section-article-clause-item" to obtain the segmented results. The document parsing technology can be OCR technology.
[0041] The segmented results can be used to identify the binding subjects, binding behaviors, and quantitative standards in the clauses. For example, let's assume that the regulatory standard includes the "Data Security Regulations." These regulations might include a clause stating that "security technical measures such as encryption and de-identification should be adopted," from which the regulatory constraint term "de-identification" can be extracted. The "Data Security Regulations" might also include a clause stating that "user identity information may not be shared without user authorization," from which the regulatory constraints terms "unauthorized" and "user identity information" can be extracted.
[0042] 1112. Based on the semantics of the regulatory constraint terms, determine the detection indicators corresponding to the regulatory constraint terms.
[0043] Optionally, in step 1112, semantic understanding can be performed on the regulatory constraint terms to generate corresponding detection indicators; alternatively, a mapping dictionary between "regulatory constraint terms" and "detection indicators" can be pre-established, and the detection indicators corresponding to the regulatory constraint terms can be determined based on the mapping relationship in the mapping dictionary. The following explanation will use the example of determining the detection indicators corresponding to the regulatory constraint terms based on the mapping relationship in the mapping dictionary.
[0044] Continuing with the example above, the regulatory constraint "de-identification" can be mapped to the metric of "data anonymization rate." Similarly, the regulatory constraints "unauthorized" and "user identity information" can be mapped to the metric of "user authorization compliance rate." These metrics are compliance indicators.
[0045] Let's take the compliance metric "data anonymization rate" as an example. The specific calculation method for this compliance metric is: Data anonymization rate = (Number of anonymized sensitive fields in the model output / Total number of sensitive fields in the input data). 100%.
[0046] In the above implementation, regulatory compliance requirements that originally relied on manual reading, understanding, and conversion can be transformed into an automated technical indicator generation process. Since each testing indicator can be traced back to a specific regulatory clause level (article, section, item), the testing results have a clear regulatory basis. This not only improves the technical difficulties faced by general testing tools in automatically understanding government regulations and quantifying compliance requirements, but also reduces the cost and subjective bias of manual interpretation of regulations.
[0047] 112. Decompose the business specifications into scenario adaptability indicators.
[0048] Optionally, the business specifications may include multiple process nodes, flow conditions between two adjacent process nodes, and the data types corresponding to each process node.
[0049] A process node refers to the smallest independent processing unit in a government business process. Optionally, for example, a process node may include "acceptance", "preliminary review", "re-review", "certificate issuance", etc., with each node corresponding to a clearly defined processing entity, operational actions, and data interaction requirements.
[0050] The transition conditions refer to the prerequisite rules that trigger a transition between two adjacent process nodes, including the completion status of the preceding node, data verification results, time limit requirements, etc., which are used to reflect whether the business process can proceed normally.
[0051] Data type refers to the data format and content range that each process node needs to process in business operations, such as form fields, attachments, electronic certificates, etc. It is the basis for judging data compatibility and business adaptability.
[0052] Scenario adaptability metrics refer to a class of testing indicators used to quantitatively evaluate the degree to which the operating logic, data processing capabilities, and output results of an AI model under test fit the actual business environment in a specific government business scenario. Specifically, scenario adaptability metrics can include the following two specific indicators: business process matching degree and cross-departmental data compatibility.
[0053] Among them, the business process matching degree is used to reflect whether the processing logic of the AI model to be tested is consistent with the standard handling process of government affairs (including node order, flow conditions, timing requirements, etc.), and reflects whether the AI model to be tested can be correctly embedded and drive the established business chain.
[0054] Cross-departmental data compatibility is used to reflect the ability of the AI model under test to adapt to and convert data formats, field definitions, and exchange protocols of different management departments in multi-departmental collaborative scenarios, and to reflect whether the model can support seamless data flow and business collaboration across levels and systems.
[0055] Accordingly, step 112 above may specifically include steps A1 to A4 as follows: A1. Extract the process nodes, flow conditions, and data types corresponding to the process nodes from the business specifications, and determine the standard sequence of the business process based on the process nodes, flow conditions, and data types corresponding to the process nodes.
[0056] Business specifications typically exist in the form of documents and flowcharts, lacking a structured expression that can be directly compared by machines. Step A1 transforms the unstructured business specifications into a business process sequence diagram by extracting three key elements: process nodes, transition conditions, and data types. Step A1 provides a benchmark for subsequent indicator calculations, avoiding errors in detection results due to misunderstandings of the business context.
[0057] A2. Based on the standard sequence of the business process, determine the calculation method for the matching degree of the business process.
[0058] Specifically, the business process matching degree can be calculated as: (number of business nodes correctly triggered or processed by the model / total number of nodes in the standard process). This quantification method allows the business adaptability of the AI model under test to be accurately measured, rather than merely remaining at the qualitative description level of "whether it conforms to business specifications".
[0059] A3. Obtain the management department corresponding to each of the multiple process nodes, and then obtain the total number of management departments corresponding to the multiple process nodes.
[0060] A4. Based on the management department corresponding to each process node and the total number of management departments, determine the calculation method for cross-departmental data compatibility.
[0061] Step A3, by identifying the management department corresponding to each node and counting the total number, can objectively reflect the cross-departmental complexity of the business. Step A4, based on the number of departments and the relationship between nodes, defines the calculation method for cross-departmental data compatibility. For example, a "cross-departmental data field mapping success rate" indicator can be used, and the weight or threshold of the compatibility indicator can be adjusted accordingly as the total number of departments increases, making the detection results more consistent with the actual difficulty of business collaboration.
[0062] The following section uses the "Cross-departmental data field mapping success rate" metric as an example to describe how this metric is calculated. The formula for calculating the "Cross-departmental data field mapping success rate" metric is as follows: )as follows: ( ) Where N is the total number of management departments involved in the business process; T i M represents the total number of fields that should be mapped in the transition steps between the i-th process node and the (i+1)-th process node; i W represents the number of fields that the AI model actually correctly mapped in the transition between the i-th process node and the (i+1)-th process node; i is the weight value in the corresponding flow link between the i-th process node and the (i+1)-th process node. When the i-th process node and the (i+1)-th process node belong to different management departments, the weight value is 1. When the i-th process node and the (i+1)-th process node belong to the same management department, the weight value is 0.5. K is the benchmark department constant, which can be 3.
[0063] The above ( The meaning of the formula is: multiply the sum of the "actual number of correctly mapped fields" of all circulation links in the business process by the corresponding link weight, divide by the sum of the "total number of fields to be mapped" of all circulation links to obtain a weighted efficiency; then multiply the weighted efficiency by the ratio of the baseline number of departments constant to the actual number of managed departments to obtain the field mapping success rate.
[0064] The above ( The formula represents: a measure of an AI model's ability to resist the increase in semantic entropy and alignment decay caused by the increase in the number of departments in a field mapping task. The success of field mapping depends not only on the model's recognition accuracy, but also on its ability to maintain semantic consistency in increasingly complex organizational networks.
[0065] In the above implementation, steps A2 and A4 do not use fixed thresholds or general formulas, but rather dynamically define the calculation methods for business process matching degree and cross-departmental data compatibility based on "standard order" and "total number of management departments," respectively. This design enables the indicators to adaptively reflect the actual coordination difficulty of different government affairs, and the resulting scenario-adaptive indicators truly fit the real operating environment of government affairs.
[0066] 113. Divide the historical detection data into test cases and problem cases.
[0067] Optionally, in one embodiment, step 113 may specifically include the following steps B1 to B4: B1. For each of the historical detection data, obtain the data structure of the historical detection data.
[0068] Data structure refers to the organization and correspondence of input and output content in historical testing data. It serves as the basis for distinguishing test case types (question and answer type / audit type) and identifying problem cases.
[0069] B2. If the data structure consists of input data and text output data that corresponds to the input data, then the historical detection data is determined to be a question-and-answer test case.
[0070] Question-and-answer test cases refer to test samples with a data structure of "input data + single corresponding text output data," used to verify the accuracy and compliance of the generated responses of the AI model under test regarding government inquiries, policy interpretations, etc. Optionally, the data structure of input data and single corresponding text output data can specifically refer to "user query + expected answer."
[0071] B3. If the data structure consists of input data and multiple candidate output options corresponding to the input data, then the historical detection data is determined to be an audit-type test case.
[0072] Review-related test cases refer to test samples with a data structure of "input data + multiple candidate output options," used to verify whether the judgment logic of the AI model under test regarding decision-making responses such as government approval and document verification is correct. Optionally, the data structure of input data and multiple candidate outputs corresponding to the input data can specifically refer to: "Application materials JSON + approval result (approved / rejected / required correction)."
[0073] The distinction between question-and-answer test cases and audit test cases is based on the input-output topology, which decouples the classification logic from specific government affairs and enables cross-business domain versatility.
[0074] B4. If the data structure is a single input data, then the historical detection data is determined to be a problem case.
[0075] Problem cases refer to test samples with a data structure of "single input data". Problem cases typically originate from defect records or anomaly logs and can be further categorized into performance or security issues through keyword matching or semantic clustering. Further classification steps for problem cases will be explained in steps B5 to B7.
[0076] Optionally, in one implementation, after step B4, the embodiments of this application may further include the following steps B5 to B7: B5. Extract keywords from the historical detection data.
[0077] B6. If the keyword matches the set of performance-related keywords, then the historical detection data is determined to be a performance-related problem case.
[0078] The performance keyword set is a predefined collection of terms related to the efficiency and resource consumption of AI model operation. Specifically, the performance keyword set may include terms such as "timeout," "low concurrency," "OOM," "slow response," and "decreased throughput."
[0079] Optionally, if a keyword matches any term in the performance-related keyword set, the historical test data corresponding to that keyword can be identified as a performance-related problem case.
[0080] B7. If the keyword matches the set of security keywords, then the historical detection data is determined to be a security issue case.
[0081] The security keyword set is a predefined collection of terms related to AI model data security, access control, and adversarial attacks. Specifically, the security keyword set may include terms such as "privilege escalation," "injection," "data breach," "prompt-word attack," and "sensitive information exposure."
[0082] Optionally, if a keyword matches any term in the set of security keywords, the historical detection data corresponding to that keyword can be identified as a security issue case.
[0083] The above implementation involves more than simple data cleaning; it transforms raw records scattered across Excel, Jira, and Word into three types of high-value testing assets: a question-and-answer test case library, an audit test case library, and a problem case library. This transformation provides a high-quality data foundation for subsequent steps, reducing the manpower costs and technical barriers to government AI model testing.
[0084] 114. Construct the knowledge base based on the aforementioned compliance indicators, scenario adaptability indicators, test cases, and problem cases.
[0085] In step 114, the four types of heterogeneous assets generated in the preceding steps—compliance metrics, scenario adaptability metrics, test cases, and issue cases—are semantically linked and structurally combined to construct a queryable and dynamically updated knowledge base. This knowledge base serves as the foundation for subsequent automated detection, intelligent diagnosis, and continuous optimization.
[0086] Optionally, in one implementation, after the knowledge base is built, a knowledge base update mechanism can be established to regularly synchronize the latest government regulations, standards and business specifications, and at the same time, new test cases and problem records generated each time are added to the knowledge base to ensure the timeliness and completeness of the knowledge base as much as possible.
[0087] 120. Obtain the AI model to be tested and the testing requirements, wherein the testing requirements include the testing accuracy standard and the dimensions to be tested for the AI model to be tested.
[0088] The AI model to be tested refers to an instance of a government AI model that requires verification for compliance, security, scenario adaptability, or performance. Specifically, the AI model to be tested can be connected to the testing system through API interfaces, containerized deployment (such as Docker), etc., thereby enabling the acquisition of the AI model to be tested.
[0089] Testing requirements refer to the target scope and acceptance criteria for this testing, as proposed by the testing initiator. Optionally, testing requirements may include testing accuracy standards, dimensions to be tested, and the format for the test report output. The testing initiator may be government officials, model developers, etc.
[0090] Optionally, the detection requirements may also include: specifications for the transmission method of the detection data (such as specific encryption methods), and specifications for the analysis rules of the detection results. For example, the analysis rules of the detection results may include: immediately comparing the expected results with the actual output after each test case is completed, and calculating the score in real time. For serious non-compliance items (such as security vulnerabilities, compliance red lines), immediately triggering high-priority alarms and recording a context snapshot; for minor deviations, adding them to the queue for analysis.
[0091] Among them, the testing accuracy standard refers to the quantitative requirements for the reliability and granularity of the testing results, which includes specific numerical values. Examples include confidence thresholds, error tolerance ranges, allowable error ranges for performance testing, and compliance testing thresholds.
[0092] The dimensions to be tested can be one or more of the following four dimensions: compliance, security, scenario adaptability, or performance. The specific dimensions to be tested can be selected by the party initiating the test.
[0093] The test report can be output in one or more formats, such as PDF, Excel, or a visual dashboard.
[0094] 130. Based on the dimension to be detected and the knowledge base, determine the indicator to be detected.
[0095] The indicators to be detected refer to the subset of indicators selected in step 130 after comparing and matching the dimensions to be detected selected by the user with the dimensions to which the indicators belong in the knowledge base, and used for this specific detection task.
[0096] Optionally, in one embodiment, step 114 may specifically include the following steps C1 to C2: C1. Obtain general testing indicators; the general testing indicators include safety indicators and performance indicators.
[0097] General testing metrics refer to fundamental evaluation criteria that are not dependent on specific government business scenarios and are applicable to all government AI models. These metrics can include security and performance indicators. Specifically, security indicators can include robustness against attacks and data leakage risk. Performance indicators can include response latency, throughput, and resource utilization.
[0098] C2. Construct the knowledge base based on the compliance indicators, scenario adaptability indicators, security indicators, performance indicators, test cases, and problem cases.
[0099] The knowledge base constructed through steps C1 to C2 above can include indicators across four dimensions: compliance indicators, scenario adaptability indicators, security indicators, and performance indicators. In other words, the indicators in the knowledge base can be categorized according to these four dimensions: compliance, scenario adaptability, security, and performance.
[0100] In the above implementation, the four types of indicators are uniformly incorporated into the knowledge base construction, so that the knowledge base fully covers the four dimensions of compliance, scenario adaptability, security, and performance, providing resource support for subsequent detection needs in any dimension.
[0101] Accordingly, step 130 above may specifically include steps 131 to 132 as follows: 131. Match the dimension to be detected with the dimensions to which the indicators included in the knowledge base belong, to obtain the dimension results of the knowledge base, wherein the dimensions to which the indicators included in the knowledge base belong include compliance, scenario adaptability, security, and performance.
[0102] Step 131 matches the dimension to be detected with the corresponding dimension of the indicator in the knowledge base, which can establish a deterministic mapping relationship between requirements and resources. Specifically, if the detection initiator selects multiple dimensions to be detected at the same time, the matching process can be executed in parallel, automatically aggregating the indicators under each dimension.
[0103] 132. Determine the index corresponding to the dimension result, and denot it as the index to be detected.
[0104] Alternatively, in one implementation, the indicators corresponding to the four dimensions of compliance, scenario adaptability, security, and performance in the knowledge base can be as follows: Compliance dimensions include: data anonymization rate (such as the anonymization ratio of sensitive information such as mobile phone numbers), access control (such as whether access permissions are differentiated between administrators, operators, and ordinary users), and log recording integrity (such as whether all operation logs of the model are recorded, and whether the log retention time complies with government requirements). Scenario adaptability dimension: including business process matching degree (such as the degree of fit between model processing steps and government approval process), cross-departmental data compatibility (such as whether it can achieve data interaction with the databases of other government departments), and abnormal scenario handling capability (such as whether it can provide reasonable prompts or alternative solutions when faced with missing government data). Security dimensions include data encryption transmission capabilities (such as whether SSL / TLS protocols are supported), data storage security (such as whether encrypted storage is used), and resistance to attacks (such as whether it can withstand model crashes caused by malicious input). Performance dimensions include model accuracy, recall, F1 score, response time, and concurrent processing capability (such as the number of government requests processed per second).
[0105] Optionally, in one implementation, after the user determines the dimension result, all indicators corresponding to the dimension result can be recorded as indicators to be detected, or a secondary menu can pop up for the user to further filter the indicators based on the determined dimension.
[0106] Step 132 records the results of dimension matching as the indicators to be detected, which enables on-demand customization of detection tasks.
[0107] In the above implementation, relevant metrics can be loaded based on the dimension to be detected selected by the detection initiator, instead of calling all metrics in the knowledge base. This can reduce the computational overhead of subsequent test case generation and execution, and avoid resource waste.
[0108] 140. Based on the indicators to be detected, generate multiple test cases using the knowledge base.
[0109] Test cases refer to structured testing units that are dynamically generated from a knowledge base based on the metrics to be tested, and contain input data and expected standard results. They are the smallest executable units that verify whether the behavior of an AI model meets the requirements under specific metrics.
[0110] Optionally, in one implementation, for the performance metrics to be tested, test cases are generated using a knowledge base. Specifically, this may include the following process: generating test cases containing different quantities and types of government data (such as 1,000 administrative approval form data and 500 government Q&A request data).
[0111] For the security metrics to be detected, test cases can be generated using a knowledge base. Specifically, this can include the following process: generating test cases containing malicious input (such as SQL injection statements or malicious code snippets) and unauthorized access requests; for example, classic attack vectors such as SQL injection, XSS, and unauthorized access can be retrieved from the knowledge base.
[0112] For compliance-related indicators to be tested, test cases can be generated using a knowledge base. Specifically, this process may include the following: generating test cases containing sensitive government data (such as business license information) to verify the model's data anonymization and access control capabilities; for example, various sensitive entities (mobile phone numbers, corporate tax numbers) can be strategically embedded in normal business data to trigger anonymization detection.
[0113] For the indicators to be tested in the scenario adaptability dimension, test cases are generated using a knowledge base. Specifically, this can include the following process: generating test cases that simulate different government scenarios (such as social security reimbursement review and real estate registration inquiry) and different abnormal situations (such as missing data fields and incompatible data formats across departments); for example, obtaining historical test cases from the knowledge base and actively injecting abnormal factors for modification, such as missing key fields, cross-departmental interface error codes, and inconsistent data formats.
[0114] Optionally, when there are multiple dimensions to be tested, the execution order of the test cases corresponding to each dimension can be determined. For example, if the dimensions to be tested include security and performance dimensions, security testing can be performed first, followed by performance testing, to avoid security issues affecting subsequent testing.
[0115] In step 140, the test cases are not a pre-defined static set, but are generated in real time from the knowledge base based on the metrics to be detected. Each metric is associated with a set of dedicated test case templates and data fragments, avoiding redundant execution of irrelevant test cases and improving detection efficiency.
[0116] 150. Use the AI model to be tested to process the multiple test cases to obtain the model processing results, and determine the indicator results of the indicator to be tested based on the model processing results, the standard results, and the detection accuracy standard.
[0117] The model processing result refers to the response output by the AI model under test after it performs actual reasoning or processing on the input data in the test case. It is a record of information that reflects the true behavioral state of the model.
[0118] Standard results refer to baseline outputs that are tied to test cases and represent compliant or accurate behavior. Optionally, standard results are typically derived from legal provisions, business specifications, or expert annotations in a knowledge base.
[0119] The indicator result refers to the result obtained by comparing the model processing result with the standard result and making a quantitative judgment based on the detection accuracy standard, which determines whether each indicator to be detected meets the standard. In other words, the indicator result is used to reflect whether each of the multiple indicators to be detected meets or fails to meet the standard.
[0120] Optionally, test cases can be sent to the AI model under test, and the output results (i.e., model processing results) returned by the AI model under test can be received. In addition to comparing the model processing results with standard results, other key data during the testing process can also be collected, such as: the response time of the AI model under test to each test case, the encryption status during data transmission, and the processing results of access requests.
[0121] Optionally, in addition to recording the above model processing results and other key data, abnormal situations during the detection process (such as model crashes and data transmission failures) and environmental parameters (such as server CPU utilization and memory usage) when the abnormality occurs can also be recorded.
[0122] In step 150, comparing the model processing results with the standard results provides factual-level discrepancies, such as whether the model output omits key clauses or generates misinterpretations. Based on the comparison, specific numerical results for each indicator to be detected can be obtained. Comparing these specific numerical results with the detection accuracy standard allows us to assess whether the specific numerical results meet the standard.
[0123] Optionally, in one implementation, for the indicators to be detected corresponding to the four dimensions of compliance, scenario adaptability, security, and performance, the process of "determining the indicator results of the indicators to be detected based on the model processing results, standard results, and the detection accuracy standard" in the above steps can be specifically as follows: For performance metrics, we can calculate the model’s average accuracy, average response time, maximum concurrent processing capacity, etc., and compare them with industry standards or historical best values in the knowledge base. Regarding security, we can statistically analyze the success rate of the model in resisting malicious attacks, the compliance rate of data encryption transmission and storage, and identify existing security vulnerabilities (such as failure to encrypt sensitive data or lax access control). For the compliance dimension, you can check whether the model meets all the selected government regulations and standards, and calculate the compliance score (e.g., 1 point for each compliance indicator that meets the standard, and 0 points for each that does not meet the standard. The total score is the compliance score when the total number of indicators is divided by the total number of indicators). Regarding the scenario adaptability dimension, the evaluation model assesses its business process matching degree, cross-departmental data compatibility, and ability to handle abnormal scenarios in different government scenarios. Qualitative evaluation is supplemented by questionnaires or feedback from business personnel.
[0124] 160. Based on the indicator results and the model processing results, generate the detection results of the AI model to be detected.
[0125] The detection result refers to a structured report that summarizes the overall detection conclusion of the AI model under test, based on the results of all the indicators to be tested and the model processing results.
[0126] Optionally, in one implementation, the structured report may specifically include: specific indicator values for each detection dimension, comparison charts with standard values, explanations of anomalies, and overall detection conclusions (such as whether the model passes the detection or whether it is recommended for application in government scenarios).
[0127] In step 160, the test results include not only the conclusion of whether the indicator meets the standard, but also the model processing results as supporting evidence. This design solves the deficiency of traditional test reports that "have conclusions but no evidence": when an indicator fails, the corresponding model processing results can be directly traced back to quickly locate the root cause of the problem.
[0128] Optionally, in one embodiment, after step 160, the present application embodiment may further include the following steps 170 to 180: 170. If the detection result indicates that the AI model to be detected does not meet the preset detection requirements, then based on the detection result, optimization suggestions are generated so that the AI model to be detected can be optimized based on the optimization suggestions to obtain an optimized AI model to be detected.
[0129] Preset testing requirements refer to the comprehensive acceptance criteria set before or during the testing task to determine whether the AI model under test is qualified. These criteria typically consist of a combination of the qualified statuses of one or more testing indicators and serve as the logical criterion for triggering optimization suggestions. In some implementations, the preset testing requirements may be consistent with the requirements corresponding to the testing accuracy standard.
[0130] Optimization suggestions refer to actionable model improvement guidelines that are automatically generated based on the specific performance of the failed indicators when the test results do not meet the standards.
[0131] Optionally, in one implementation, the optimization suggestions may specifically include: If performance is not up to standard (e.g., response time is too long), it is recommended to optimize the model algorithm (e.g., adopt a lightweight model structure) or improve hardware resources (e.g., increase server memory). If security vulnerabilities exist, it is recommended to strengthen data encryption measures (such as using the AES-256 encryption algorithm) or improve access control mechanisms (such as using the RBAC permission model). If compliance is not met, it is recommended to add a data masking module (such as masking sensitive fields) or improve the logging function (such as extending the log retention time to more than 6 months). If the model is not adaptable to the specific government affairs scenario, it is recommended to optimize the model training data (such as adding business data from specific departments) or adjust the model processing logic (such as adapting to cross-departmental data interaction formats).
[0132] The optimized AI model to be tested refers to a model instance that has been re-entered into the testing process after improvements such as parameter adjustment, data supplementation, or architecture fine-tuning based on optimization suggestions. Its version or configuration has changed and it needs to undergo a new round of verification.
[0133] Optionally, after generating optimization suggestions, the detection results and optimization suggestions can be pushed to the detection initiator, allowing users to view detailed detection data and problem analysis. The detection initiator can also optimize the model based on their work experience and optimization suggestions to obtain an optimized AI model to be detected.
[0134] 180. Proceed to step 130 until the detection results indicate that the AI model to be detected meets the preset detection requirements.
[0135] After obtaining the optimized AI model to be detected, the detection requirements can remain unchanged, avoiding convergence failure due to changes in requirements; and since the dimension to be detected remains unchanged, the dimension matching result in step 130 is usually stable, which can reduce redundant calculations.
[0136] In step 180, the results of multiple tests can be compared to analyze the model optimization effect (such as the performance index improvement rate and security vulnerability repair rate), generate an optimization effect evaluation report, and continue until the model meets the application standards in the government sector, forming a complete closed loop of testing-optimization-retesting.
[0137] Optionally, in one implementation, the above-described AI model detection method can be implemented by an AI model detection system. This system may include: The knowledge base module is used to store laws, regulations, standards, business specifications, test case libraries, and problem case libraries related to AI model testing in the government sector. It also has a knowledge base update function, which supports regular synchronization of the latest information and supplementation of new testing data. The model access and requirement receiving module provides model access interfaces (such as API interfaces and containerized deployment interfaces) to support the access of AI models to be detected, and receives detection requirements submitted by users (such as the dimension to be detected, detection accuracy standards, and report formats). The detection scheme generation module is used to filter detection indicators, generate test cases, determine the detection execution process, and form an automated detection scheme based on the user's detection needs and information in the knowledge base. The automated detection execution module is used to automatically send test cases to the AI model to be tested according to the detection plan, receive the model processing results, and collect and store other key data and abnormal situations during the detection process. The test result analysis module is used to quantitatively analyze the test data, identify problems by comparing them with standard values, generate test reports, and automatically generate model optimization suggestions based on the problem case library. The closed-loop management module is used to push detection reports and optimization suggestions, receive model optimization results (i.e., the optimized AI model to be detected), trigger secondary detection, compare the results of multiple detections to evaluate the optimization effect, and realize the detection-optimization-re-detection closed loop.
[0138] The AI model detection method for the government sector provided in this application embodiment can acquire government sector regulations, standards, business specifications, and historical detection data, and construct a knowledge base based on these three. The knowledge base includes detection indicators corresponding to regulations and standards, as well as detection indicators corresponding to business specifications. This application embodiment can also acquire the AI model to be detected and detection requirements including detection accuracy standards and detection dimensions. Based on the knowledge base and the detection dimensions, the detection indicators are determined, and multiple test cases are generated. The test cases are input into the AI model to be detected to obtain the output results (i.e., model processing results) of the AI model. Combined with the standard results and detection accuracy standards, the indicator results of the detection indicators are determined, thereby generating the detection results of the AI model to be detected. In this application embodiment, a knowledge base can be constructed by acquiring government sector regulations, standards, business specifications, and historical detection data. After acquiring detection requirements including the detection dimensions, the detection indicators are specifically determined based on the knowledge base and the detection dimensions, thereby automatically generating test cases covering multiple dimensions. The test cases are input into the AI model to be detected to obtain the model processing results, and the indicator results of each indicator are determined by combining the standard results and detection accuracy standards. Because the knowledge base integrates government-specific regulations and business standards, the determination of the indicators to be tested has domain-specific characteristics, thereby enabling the automation of non-performance dimension testing that originally relied on manual execution.
[0139] The embodiments of this application can improve the multi-dimensional detection efficiency of AI models for the government affairs field.
[0140] In this embodiment, the method of this application embodiment is described in detail. The AI model detection method for the government sector provided in this application embodiment can be executed by an electronic device. In this embodiment, as... Figure 2 As shown, the specific process of an AI model detection method for the government sector is as follows: 201. Obtain regulations, standards, business specifications, and historical testing data in the government sector.
[0141] 202. Decompose the aforementioned regulations and standards into compliance indicators.
[0142] Optionally, in one embodiment, step 202 may specifically include: performing semantic understanding on the regulatory standard to identify regulatory constraint terms in the regulatory standard; and determining the detection index corresponding to the regulatory constraint terms based on the semantics of the regulatory constraint terms.
[0143] 203. Decompose the aforementioned business specifications into scenario adaptability indicators.
[0144] Optionally, in one implementation, the business specifications include multiple process nodes, flow conditions between two adjacent process nodes, and data types corresponding to each process node. The scenario adaptability indicators include business process matching degree and cross-departmental data compatibility. Accordingly, step 203 above may specifically include: Extract the process nodes, flow conditions, and corresponding data types from the business specifications, and determine the standard order of the business process based on the process nodes, flow conditions, and corresponding data types; determine the calculation method for the business process matching degree based on the standard order of the business process; obtain the management department corresponding to each of the multiple process nodes, and then obtain the total number of management departments corresponding to the multiple process nodes; determine the calculation method for cross-departmental data compatibility based on the management department corresponding to each process node and the total number of management departments.
[0145] 204. Divide the historical detection data into test cases and problem cases.
[0146] Optionally, in one implementation, step 204 may specifically include: for each piece of historical detection data, obtaining the data structure of the historical detection data; if the data structure is input data and text output data that corresponds solely to the input data, then the historical detection data is determined to be a question-and-answer type test case; if the data structure is input data and multiple candidate output options that correspond to the input data, then the historical detection data is determined to be an audit type test case; if the data structure is a single piece of input data, then the historical detection data is determined to be a problem case. Extracting keywords from the historical detection data; if the keywords match a set of performance-related keywords, then the historical detection data is determined to be a performance-related problem case; if the keywords match a set of security-related keywords, then the historical detection data is determined to be a security-related problem case.
[0147] 205. Obtain general testing indicators; the general testing indicators include safety indicators and performance indicators.
[0148] 206. Construct the knowledge base based on the aforementioned compliance indicators, scenario adaptability indicators, security indicators, performance indicators, test cases, and problem cases.
[0149] 207. Obtain the AI model to be tested and the testing requirements, wherein the testing requirements include the testing accuracy standard and the testing dimensions for the AI model to be tested.
[0150] 208. Match the dimension to be detected with the dimensions to which the indicators included in the knowledge base belong, to obtain the dimension results of the knowledge base, wherein the dimensions to which the indicators included in the knowledge base belong include compliance, scenario adaptability, security, and performance.
[0151] 209. Determine the index corresponding to the dimension result, and denot it as the index to be detected.
[0152] 210. Based on the indicators to be detected, generate multiple test cases using the knowledge base.
[0153] 211. Use the AI model to be tested to process the multiple test cases to obtain the model processing results.
[0154] 212. Based on the model processing results, standard results, and detection accuracy standards, determine the indicator results of the indicator to be detected.
[0155] 213. Based on the indicator results and the model processing results, generate the detection results of the AI model to be detected.
[0156] 214. If the detection result indicates that the AI model to be detected does not meet the preset detection requirements, then based on the detection result, optimization suggestions are generated so that the AI model to be detected can be optimized based on the optimization suggestions to obtain an optimized AI model to be detected.
[0157] 215. Proceed to step 211 until the detection result indicates that the AI model to be detected meets the preset detection requirements.
[0158] Optionally, in one implementation, taking the AI model to be detected as a government service intelligent question-answering model as an example, the detection steps for the government service intelligent question-answering model specifically include the following: 1. Knowledge Base Construction: Collect regulations and standards such as the "Administrative Measures for Government Service Hotlines" and the "Personal Information Protection Law", and break down compliance indicators (such as user privacy information protection rate and Q&A content compliance rate); collect historical Q&A data from government service hotlines in various provinces and cities (such as consultation records of the 12345 hotline), and build a test case library (including test cases for common consultation scenarios such as social security inquiries, housing provident fund withdrawals, and business license processing).
[0159] 2. Model Access and Requirement Reception: The model to be tested is an intelligent question-and-answer model from a provincial government service platform, which is accessed through an API interface to the testing system; (staff of the provincial government service center) select "performance + compliance + scenario adaptability" as the dimensions to be tested; the testing accuracy standards may include: detection error ≤ 5%, user privacy information protection rate must reach 100%, question and answer content compliance rate must reach 95% or more, and coverage of common consultation scenarios must reach 90% or more; the testing report is output in PDF format.
[0160] 3. Detection plan generation: Retrieve the corresponding detection indicators from the knowledge base: Performance metrics: Question answering accuracy, response time, and concurrent processing capacity (100 inquiry requests per second). Compliance metrics: Protection rate of user privacy information (such as mobile phone numbers), compliance rate of Q&A content; Scenario adaptability indicators: coverage of common consultation scenarios and ability to handle abnormal consultations (such as those without relevant business information); Generate test cases: including 1000 common consultation requests (covering scenarios such as social security, housing provident fund, and business license), 50 consultation requests containing privacy information, and 100 abnormal consultation requests; 4. Automated Detection Execution: Test cases are sent to the model under test, and the following data is collected: Question and answer accuracy rate is 92%, average response time is 0.8 seconds, concurrent processing volume meets the standard, privacy information protection rate is 98% (there are 2 un-anonymized mobile phone numbers), question and answer content compliance rate is 96%, common scenario coverage is 88%, and abnormal consultation handling accuracy rate is 85%. 5. Results Analysis and Report Generation: Analysis revealed that the privacy information protection rate was below standard (2% short), and the coverage of common scenarios was also below standard (2% short). A test report was generated, pointing out the problems and providing optimization suggestions: Supplementing the privacy information desensitization module (using "138" for mobile phone numbers). (5678” format anonymization), and add training data for uncovered scenarios (such as real estate registration consultation scenarios); 6. Closed-loop management: After the developers optimize the model based on the suggestions, the system automatically performs a second test on the optimized model. The results show that the privacy information protection rate reaches 100%, the coverage of common scenarios reaches 92%, all indicators meet the standards, and an optimization effect evaluation report is generated, thus completing the closed-loop test.
[0161] Alternatively, in another implementation, taking the AI model to be tested as an example, which is an intelligent administrative approval review model, the specific testing steps for the intelligent administrative approval review model include the following: 1. Knowledge Base Construction: Collect laws and regulations such as the "Administrative Licensing Law" and the "Administrative Measures for Sharing Government Data", and break down compliance indicators (such as the compliance rate of approval data sharing and the compliance rate of approval process); collect administrative approval processes (such as the approval process for starting a business and the approval process for building engineering planning permits) and historical approval data from various government departments, and build a test case library (containing different types of approval form data). 2. Model Access and Requirement Acceptance: The model to be tested is an intelligent review model for enterprise establishment administrative approval in a certain city and department. It is deployed and accessed to the testing system via Docker containerization. The testing initiator selects "performance + security + scenario adaptability" as the testing dimensions. The testing accuracy standards may include: 100% encryption rate for approval data transmission, 100% compliance rate for access control, over 95% adaptability to different types of enterprise establishment approvals, a testing accuracy error of ≤3%, and a concurrent review volume of 50 approval forms per second. The testing report is output in a visual dashboard format. 3. Detection Plan Generation: Calling Detection Indicators: Performance metrics: review accuracy, review time, concurrent review volume; Security metrics: encrypted transmission rate of approval data, compliance rate of access control; Scenario adaptability indicators: adaptability to different types of business establishment approvals and the ability to handle missing approval data; Generate test cases: including 500 different types of business establishment approval forms (such as limited liability companies and individual businesses), 20 unauthorized access requests (such as non-auditors attempting to view approval data), and 50 approval forms with missing data; 4. Automated Detection and Execution: Executes detection and collects data; the accuracy rate of review is 94%, the average review time is 10 seconds, the concurrent review volume meets the standard, the data encryption transmission rate is 100%, the access control compliance rate is 100%, the approval adaptability to different types of enterprises is 93%, and the accuracy rate of data missing handling is 80%. 5. Results Analysis and Report Generation: Analysis revealed that the approval compatibility of different types of enterprises was not up to standard (2% difference), and the accuracy of data missing handling was low. Optimization suggestions were generated: add approval data training models for individual businesses, partnerships, and other types of enterprises; optimize the default handling logic when data is missing (e.g., prompt for supplementation of key data instead of direct rejection). 6. Closed-loop management: After model optimization, a second test is conducted. The results show that the approval fit rate reaches 96% and the accuracy rate of data missing handling reaches 90%. All indicators meet the standards, and the test closed loop is completed.
[0162] The specific execution process of steps 201 to 215 has been explained in detail above, and will not be repeated here.
[0163] The AI model detection method for the government sector provided in this application embodiment can acquire government sector regulations, standards, business specifications, and historical detection data, and construct a knowledge base based on these three. The knowledge base includes detection indicators corresponding to regulations and standards, as well as detection indicators corresponding to business specifications. This application embodiment can also acquire the AI model to be detected and detection requirements including detection accuracy standards and detection dimensions. Based on the knowledge base and the detection dimensions, the detection indicators are determined, and multiple test cases are generated. The test cases are input into the AI model to be detected to obtain the output results (i.e., model processing results) of the AI model. Combined with the standard results and detection accuracy standards, the indicator results of the detection indicators are determined, thereby generating the detection results of the AI model to be detected. In this application embodiment, a knowledge base can be constructed by acquiring government sector regulations, standards, business specifications, and historical detection data. After acquiring detection requirements including the detection dimensions, the detection indicators are specifically determined based on the knowledge base and the detection dimensions, thereby automatically generating test cases covering multiple dimensions. The test cases are input into the AI model to be detected to obtain the model processing results, and the indicator results of each indicator are determined by combining the standard results and detection accuracy standards. Because the knowledge base integrates government-specific regulations and business standards, the determination of the indicators to be tested has domain-specific characteristics, thereby enabling the automation of non-performance dimension testing that originally relied on manual execution.
[0164] This application's embodiments can improve the multi-dimensional detection efficiency of AI models for the government affairs sector. These embodiments can improve detection efficiency and accuracy by constructing a dedicated knowledge base and automated detection process for the government affairs sector, replacing traditional manual detection methods, reducing human intervention, and improving detection efficiency (shortening the detection cycle by more than 50%) and result accuracy. They achieve multi-dimensional automated detection, covering performance, security, compliance, and scenario adaptation, replacing manual processes; ensure the relevance of detection data by constructing a knowledge base based on government regulations, standards, business specifications, and historical detection data, ensuring that test cases and detection indicators align with the actual needs of government affairs scenarios, avoiding detection bias caused by general data; and automatically generate optimization suggestions, forming a "detection-optimization-re-detection" closed loop through secondary detection, ensuring the reliable application of government affairs AI models.
[0165] To better implement the above methods, this application also provides an AI model detection device for the government sector. For example... Figure 3 As shown, the device includes: The knowledge base construction unit 301 is used to acquire laws, regulations, standards, business specifications, and historical testing data in the field of government affairs, and to construct a knowledge base based on the laws, regulations, standards, business specifications, and historical testing data. The model acquisition unit 302 is used to acquire the AI model to be detected and the detection requirements, wherein the detection requirements include the detection accuracy standard and the detection dimensions for the AI model to be detected; The indicator determination unit 303 is used to determine the indicator to be detected based on the dimension to be detected and the knowledge base; The test case generation unit 304 is used to generate multiple test cases based on the indicator to be detected using the knowledge base; The indicator result determination unit 305 is used to process the multiple test cases using the AI model to be detected, obtain the model processing result, and determine the indicator result of the indicator to be detected based on the model processing result, the standard result, and the detection accuracy standard. The detection result generation unit 306 is used to generate the detection result of the AI model to be detected based on the indicator result and the model processing result.
[0166] In one implementation, the knowledge base construction unit 301 includes: The compliance indicator subunit is used to break down the aforementioned regulations and standards into compliance indicators; The scenario adaptation subunit is used to decompose the business specifications into scenario adaptation indicators; The data partitioning subunit is used to divide the historical detection data into test cases and problem cases; The knowledge base construction subunit is used to construct the knowledge base based on the compliance indicators, scenario adaptability indicators, test cases, and problem cases.
[0167] In one implementation, the compliance indicator subunit includes: The constraint word identification sub-unit is used to perform semantic understanding of the regulatory standards and identify the regulatory constraint words in the regulatory standards. The detection index determination sub-unit is used to determine the detection index corresponding to the regulatory constraint word based on the semantics of the regulatory constraint word.
[0168] In one implementation, the business specifications include multiple process nodes, flow conditions between two adjacent process nodes, and data types corresponding to each process node. The scenario adaptability indicators include business process matching degree and cross-departmental data compatibility. Correspondingly, the scene adaptation subunit includes: The data extraction sub-unit is used to extract the process nodes, flow conditions and data types corresponding to the process nodes from the business specifications, and to determine the standard order of the business process based on the process nodes, flow conditions and data types corresponding to the process nodes. The business matching degree sub-unit is used to determine the calculation method of the business process matching degree based on the standard order of the business process; The sub-unit for the total number of management departments is used to obtain the management department corresponding to each process node in the plurality of process nodes, and thus obtain the total number of management departments corresponding to the plurality of process nodes. The data compatibility sub-unit is used to determine the calculation method for cross-departmental data compatibility based on the management department corresponding to each process node and the total number of management departments.
[0169] In one implementation, the data is divided into sub-units, including: The data structure acquisition sub-unit is used to acquire the data structure of the historical detection data for each of the historical detection data. The question-and-answer type test case determination sub-unit is used to determine that the historical detection data is a question-and-answer type test case when the data structure is input data and text output data that corresponds to the input data. The audit-type test case determination sub-unit is used to determine the historical detection data as an audit-type test case when the data structure is input data and multiple candidate output options corresponding to the input data; The problem case determination sub-unit is used to determine the historical detection data as a problem case when the data structure is a single input data.
[0170] In one implementation, the problem cases include performance-related problem cases and security-related problem cases; correspondingly, the device further includes: The keyword extraction unit is used to extract keywords from the historical detection data. The performance case determination unit is used to determine that the historical detection data is a performance-related problem case when the keyword hits the set of performance-related keywords. The security case determination unit is used to determine that the historical detection data is a security issue case when the keyword matches the set of security keywords.
[0171] In one implementation, the knowledge base construction subunit includes: The general indicator acquisition subunit is used to acquire general detection indicators; the general detection indicators include safety indicators and performance indicators. The knowledge base construction sub-unit is used to construct the knowledge base based on the compliance indicators, scenario adaptability indicators, security indicators, performance indicators, test cases, and problem cases. Correspondingly, the indicator determination unit 303 includes: The dimension matching subunit is used to match the dimension to be detected with the dimensions to which the indicators included in the knowledge base belong, so as to obtain the dimension result of the knowledge base. The dimensions to which the indicators included in the knowledge base belong include compliance, scenario adaptability, security, and performance. The indicator determination subunit is used to determine the indicator corresponding to the dimension result, denoted as the indicator to be detected.
[0172] In one embodiment, the device further includes: The suggestion generation unit is used to generate optimization suggestions based on the detection results when the detection results indicate that the AI model to be detected does not meet the preset detection requirements, so that the AI model to be detected can be optimized based on the optimization suggestions to obtain an optimized AI model to be detected. The step jump unit is used to jump to the step: "Determine the indicator to be detected based on the dimension to be detected and the knowledge base" until the detection result indicates that the AI model to be detected meets the preset detection requirements.
[0173] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0174] The AI model detection method for the government sector provided in this application embodiment can acquire government sector regulations, standards, business specifications, and historical detection data, and construct a knowledge base based on these three. The knowledge base includes detection indicators corresponding to regulations and standards, as well as detection indicators corresponding to business specifications. This application embodiment can also acquire the AI model to be detected and detection requirements including detection accuracy standards and detection dimensions. Based on the knowledge base and the detection dimensions, the detection indicators are determined, and multiple test cases are generated. The test cases are input into the AI model to be detected to obtain the output results (i.e., model processing results) of the AI model. Combined with the standard results and detection accuracy standards, the indicator results of the detection indicators are determined, thereby generating the detection results of the AI model to be detected. In this application embodiment, a knowledge base can be constructed by acquiring government sector regulations, standards, business specifications, and historical detection data. After acquiring detection requirements including the detection dimensions, the detection indicators are specifically determined based on the knowledge base and the detection dimensions, thereby automatically generating test cases covering multiple dimensions. The test cases are input into the AI model to be detected to obtain the model processing results, and the indicator results of each indicator are determined by combining the standard results and detection accuracy standards. Because the knowledge base integrates government-specific regulations and business standards, the determination of the indicators to be tested has domain-specific characteristics, thereby enabling the automation of non-performance dimension testing that originally relied on manual execution.
[0175] The embodiments of this application can improve the multi-dimensional detection efficiency of AI models for the government affairs field.
[0176] This application also provides an electronic device, which can be a terminal, a server, or other similar device. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers, etc.
[0177] In some embodiments, the AI model detection device for the government sector can also be integrated into multiple electronic devices. For example, the AI model detection device for the government sector can be integrated into multiple servers, and the AI model detection method for the government sector of this application can be implemented by multiple servers.
[0178] In this embodiment, a server will be used as an example for detailed description. For example, ... Figure 4 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically: The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 401 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402. In some embodiments, the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 401.
[0179] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and AI model detection for the government sector by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0180] The electronic device also includes a power supply 403 that supplies power to the various components. In some embodiments, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0181] The electronic device may also include an input module 404, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0182] The electronic device may also include a communication module 405. In some embodiments, the communication module 405 may include a wireless module, through which the electronic device can perform short-range wireless transmission, thereby providing users with wireless broadband internet access. For example, the communication module 405 can be used to help users send and receive emails, browse web pages, and access streaming media.
[0183] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402, thereby realizing the various functions in the various method embodiments of this application, as follows: The process involves: acquiring regulations, standards, business specifications, and historical testing data in the government sector; constructing a knowledge base based on these data, including testing indicators corresponding to the regulations, standards, and business specifications; acquiring an AI model to be tested and testing requirements, including testing accuracy standards and testing dimensions for the AI model; determining testing indicators based on the testing dimensions and the knowledge base; generating multiple test cases using the knowledge base based on the testing indicators; processing the multiple test cases using the AI model to be tested to obtain model processing results; determining the indicator results of the testing indicators based on the model processing results, standard results, and the testing accuracy standards; and generating the testing results of the AI model to be tested based on the indicator results and the model processing results.
[0184] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0185] Therefore, embodiments of this application provide a computer-readable storage medium storing instructions that can be loaded by a processor to execute steps in any of the AI model detection methods for the government sector provided in embodiments of this application. For example, the instructions can execute the following steps: The process involves: acquiring regulations, standards, business specifications, and historical testing data in the government sector; constructing a knowledge base based on these data, including testing indicators corresponding to the regulations, standards, and business specifications; acquiring an AI model to be tested and testing requirements, including testing accuracy standards and testing dimensions for the AI model; determining testing indicators based on the testing dimensions and the knowledge base; generating multiple test cases using the knowledge base based on the testing indicators; processing the multiple test cases using the AI model to be tested to obtain model processing results; determining the indicator results of the testing indicators based on the model processing results, standard results, and the testing accuracy standards; and generating the testing results of the AI model to be tested based on the indicator results and the model processing results.
[0186] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0187] According to one aspect of this application, a computer program product or computer program is provided, comprising instructions stored in a computer-readable storage medium. A processor of a computer device reads the instructions from the computer-readable storage medium and executes the instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.
[0188] Since the instructions stored in the storage medium can execute the steps in any of the AI model detection methods for the government sector provided in the embodiments of this application, the beneficial effects that any of the AI model detection methods for the government sector provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0189] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0190] The foregoing has provided a detailed description of an AI model detection method, apparatus, electronic device, and computer-readable storage medium for the government sector, as provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An AI model detection method for the government sector, characterized in that, The method includes: Acquire regulations, standards, business specifications, and historical testing data in the government affairs field, and construct a knowledge base based on the regulations, standards, business specifications, and historical testing data. The knowledge base includes testing indicators corresponding to the regulations, standards, and business specifications. Obtain the AI model to be tested and the testing requirements, wherein the testing requirements include the testing accuracy standard and the dimensions to be tested for the AI model to be tested; Based on the dimension to be detected and the knowledge base, the indicator to be detected is determined; Based on the indicators to be detected, multiple test cases are generated using the knowledge base; The AI model to be tested is used to process the multiple test cases to obtain the model processing results. Based on the model processing results, the standard results, and the detection accuracy standard, the indicator results of the indicator to be tested are determined. Based on the indicator results and the model processing results, the detection results of the AI model to be detected are generated.
2. The method as described in claim 1, characterized in that, The knowledge base constructed based on the aforementioned regulations, standards, business specifications, and historical testing data includes: The aforementioned regulations and standards are broken down into compliance indicators; The business specifications are broken down into scenario adaptability indicators; The historical detection data is divided into test cases and problem cases; The knowledge base is constructed based on the aforementioned compliance metrics, scenario adaptability metrics, test cases, and issue cases.
3. The method as described in claim 2, characterized in that, The process of breaking down the regulations and standards into compliance indicators includes: Perform semantic understanding on the aforementioned regulations and standards to identify regulatory constraint terms within them; Based on the semantics of the regulatory constraint terms, the detection indicators corresponding to the regulatory constraint terms are determined.
4. The method as described in claim 2, characterized in that, The business specifications include multiple process nodes, the flow conditions between two adjacent process nodes, and the data types corresponding to each process node. The scenario adaptability indicators include business process matching degree and cross-departmental data compatibility. The step of breaking down the business specifications into scenario adaptability indicators includes: Extract the process nodes, flow conditions, and data types corresponding to the process nodes from the business specifications, and determine the standard sequence of the business process based on the process nodes, flow conditions, and data types corresponding to the process nodes. Based on the standard sequence of the business process, determine the calculation method for the matching degree of the business process; Obtain the management department corresponding to each of the multiple process nodes, and then obtain the total number of management departments corresponding to the multiple process nodes; The calculation method for cross-departmental data compatibility is determined based on the management department corresponding to each process node and the total number of management departments.
5. The method as described in claim 2, characterized in that, The process of dividing the historical detection data into test cases and problem cases includes: For each historical detection data, obtain the data structure of the historical detection data; If the data structure consists of input data and text output data that corresponds to the input data, then the historical detection data is determined to be a question-and-answer test case. If the data structure consists of input data and multiple candidate output options corresponding to the input data, then the historical detection data is determined to be an audit-type test case; If the data structure is a single input data, then the historical detection data is determined to be a problem case.
6. The method as described in claim 5, characterized in that, The problem cases include performance-related problems and security-related problems; After determining that the historical detection data is a problem case if the data structure is a single input data, the method further includes: Extract keywords from the historical detection data; If the keyword matches the set of performance-related keywords, then the historical detection data is determined to be a performance-related problem case; If the keyword matches a set of security-related keywords, then the historical detection data is determined to be a security-related issue case.
7. The method as described in claim 2, characterized in that, The knowledge base, constructed based on the compliance metrics, scenario adaptability metrics, test cases, and issue cases, includes: Obtain general testing indicators; the general testing indicators include safety indicators and performance indicators; The knowledge base is constructed based on the aforementioned compliance indicators, scenario adaptability indicators, security indicators, performance indicators, test cases, and issue cases. The step of determining the indicator to be detected based on the dimension to be detected and the knowledge base includes: The dimension to be detected is matched with the dimension to which the indicators included in the knowledge base belong, to obtain the dimension result of the knowledge base. The dimensions to which the indicators included in the knowledge base belong include compliance, scenario adaptability, security, and performance. The corresponding index for the dimension result is determined and denoted as the index to be detected.
8. The method as described in claim 1, characterized in that, After generating the detection result of the AI model to be detected based on the indicator results and the model processing results, the method further includes: If the detection result indicates that the AI model to be detected does not meet the preset detection requirements, then based on the detection result, optimization suggestions are generated so that the AI model to be detected can be optimized based on the optimization suggestions to obtain an optimized AI model to be detected. Proceed to step: "Determine the indicators to be detected based on the dimension to be detected and the knowledge base" until the detection results indicate that the AI model to be detected meets the preset detection requirements.
9. An AI model detection device for the government sector, characterized in that, The device includes: The knowledge base construction unit is used to acquire laws, regulations, standards, business specifications, and historical testing data in the field of government affairs, and to construct a knowledge base based on the laws, regulations, standards, business specifications, and historical testing data. The model acquisition unit is used to acquire the AI model to be detected and the detection requirements, wherein the detection requirements include the detection accuracy standard and the detection dimensions for the AI model to be detected; The indicator determination unit is used to determine the indicator to be detected based on the dimension to be detected and the knowledge base; The test case generation unit is used to generate multiple test cases based on the indicator to be detected using the knowledge base; The indicator result determination unit is used to process the multiple test cases using the AI model to be detected, obtain the model processing result, and determine the indicator result of the indicator to be detected based on the model processing result, the standard result, and the detection accuracy standard. The detection result generation unit is used to generate the detection result of the AI model to be detected based on the indicator result and the model processing result.
10. An electronic device, characterized in that, It includes a processor and a memory, the memory storing instructions; the processor loads instructions from the memory to perform the steps in the AI model detection method for the government sector as described in any one of claims 1 to 8.
