Powerful model test case recommendation method and related device
By using a graph exploration depth determination model and a relation-aware attention mechanism pre-trained by reinforcement learning, the recommendation process for test cases of large power models is dynamically adjusted, solving the problem of excessively long recommendation latency for large power models. This achieves synergistic optimization of recommendation accuracy and response speed, supporting rapid safety assessment of large power models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
- Filing Date
- 2026-04-24
- Publication Date
- 2026-08-04
AI Technical Summary
Existing knowledge graph-based test case recommendation methods for large power models suffer from ineffective exploration under complex multi-source input conditions, resulting in excessively long recommendation delays and making it difficult to support rapid evaluation of the safety performance of large power models.
A graph exploration depth determination model pre-trained with reinforcement learning is adopted. Combined with the state data of power business scenarios and test cases, the graph exploration depth is dynamically adjusted through a relationship-aware attention mechanism and a bidirectional interactive aggregator to optimize the test case recommendation process.
It significantly improves the accuracy of the correlation between test cases and security requirements, optimizes recommendation accuracy and response speed, and supports rapid security performance evaluation of large power models.
Smart Images

Figure CN122507622A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of large power language models, and relates to a method and related apparatus for recommending test cases for large power models, specifically a method and related apparatus for recommending test cases for large power models based on knowledge graphs. Background Technology
[0002] With the increasing application of large-scale power models in power systems, these models are gradually covering key business scenarios such as power generation, transmission and distribution, equipment operation and maintenance, and the power market, undertaking important tasks such as power data classification, data analysis, and knowledge-based question answering. To ensure the safety and reliability of large-scale power models under complex multi-source input conditions, red-team testing using security test cases is necessary. This system evaluates potential non-compliant content generated by the model, such as unauthorized maintenance suggestions and abnormal dispatch instructions, thereby ensuring the safe and stable operation of the power system.
[0003] Knowledge graph technology provides effective support for the systematic modeling and management of security test cases. Existing methods construct knowledge graphs containing the relationships between application scenarios, test requirements, and test cases, and combine graph analysis or machine learning methods to support the generation and recommendation of test cases. However, in the practical application scenarios of large-scale power models, the knowledge graphs for test cases are large in scale and have complex relational structures. The reasoning process is prone to exploring invalid or pseudo-paths, resulting in excessively long recommendation delays. Specifically, power business scenarios cover multiple fields such as power data classification, data analysis, and knowledge question answering. Test cases come from diverse sources and contain various attack types and risk labels, with complex many-to-many relationships between entities. Existing knowledge graph-based recommendation methods often use fixed exploration depths or blindly perform deep propagation when performing multi-hop reasoning. This easily leads to the exploration of invalid paths unrelated to the security requirements of the scenario due to excessively long relational paths. This not only reduces the accuracy of recommendations but also significantly increases recommendation delays due to unnecessary computational overhead, making it difficult to support the rapid evaluation of the security performance of large-scale power models. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art, such as invalid exploration and low response speed of test case recommendation in the graph reasoning process of power large-scale model test cases, and to provide a method and related apparatus for recommending test cases for power large-scale models.
[0005] To achieve the above objectives, the present invention employs the following technical solution: In a first aspect, this invention provides a method for recommending test cases for a large-scale power model, comprising: obtaining the attack success rate and recommendation latency of the previously recommended test cases, constructing state data in conjunction with power business scenarios, and calling a graph exploration depth determination model based on reinforcement learning pre-training according to the state data to obtain the current graph exploration depth; performing recursive propagation of the preset test case recommendation knowledge graph to the current graph exploration depth, and in each recursive propagation: for triples with each entity as the head entity, performing weighted aggregation of each head entity's neighbor tail entities through a relation-aware attention mechanism and fusing them with each head entity through a bidirectional interactive aggregator to obtain the feature representation of each entity in the current recursive propagation; concatenating the feature representation of the entity corresponding to the power business scenario and the feature representation of the entity corresponding to each test case in each recursive propagation to obtain the fused feature of the power business scenario and the fused feature of each test case, obtaining the inner product of the fused feature of the power business scenario and the fused feature of each test case, and selecting the test case corresponding to the largest preset number of inner products as the currently recommended test case.
[0006] Optionally, the graph exploration depth determination model includes a benefit value prediction network and a risk value prediction network; the step of calling the graph exploration depth determination model based on reinforcement learning pre-training according to the state data to obtain the current graph exploration depth includes: obtaining the sampling probability distribution of the graph exploration depth through the following formula:
[0007] in, for The sampling probability, To explore the depth of the currently calculated map, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. For state data, To predict the network parameters of the benefit value prediction network, To predict network parameters for risk values, Explore depth for any map. To explore deep sets for the map.
[0008] The current map exploration depth is obtained by randomly sampling based on the sampling probability distribution of the map exploration depth.
[0009] Optionally, the benefit value prediction network and the risk value prediction network are trained in the following manner: Constructing experience samples and random sampling Based on a set of empirical samples, the network parameters of the benefit value prediction network and the risk value prediction network are updated using the following formula:
[0010]
[0011] in, For the first The status data of the second recommendation , For power business scenarios, For the first The attack success rate of the second recommended test case. for Recommended latency for recommended test cases. For the first The next recommended depth of current map exploration. For the first The second recommended calculated benefit value, For the first The next recommended calculation of the risk value, For the first The status data of the second recommendation; , , , and The first empirical samples , , , and ; For the network parameters to be optimized, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. and This is the preset discount factor.
[0012] Optionally, the first The second recommended calculation benefit value We obtain it from the following formula:
[0013] in, For the first The attack success rate of the second recommended test case. The preset importance coefficient for measuring recommended latency, For the first Recommended latency for the next recommended test case.
[0014] The first The recommended calculation of risk value We obtain it from the following formula:
[0015] in, The number of levels quantified to determine the success rate of an attack. For the first A penalty factor that quantifies the success rate of an attack. For the first Each attack success rate is quantified into a single level.
[0016] Optionally, both the benefit value prediction network and the risk value prediction network consist of four fully connected layers connected in sequence.
[0017] Optionally, the entities in the test case recommendation knowledge graph include power business scenarios, test cases, and test case semantics; the relationships between entities include interaction relationships and attribution relationships; wherein, the test case semantics include the large model attack type targeted by the test case and the risk type corresponding to the test case.
[0018] Optionally, the weighted aggregation of each head entity's neighboring tail entities through the relation-aware attention mechanism, followed by fusion with each head entity via a bidirectional interactive aggregator, to obtain the feature representation of each entity in the current recursive propagation includes: obtaining the attention score of the triple with each entity as the head entity using the following formula:
[0019] in, For triples Attention score In entity As the head entity, based on relationships For relationships between entities, based on entities For tail entities, for The transformation matrix, for Continuous eigenvectors, for Continuous eigenvectors, for Continuous eigenvectors, It is the hyperbolic tangent activation function.
[0020] The following formula will be used to... Normalization is performed:
[0021] in, For normalization , For The set of all triples of the head entity. For triples Attention score.
[0022] The following formula is used to weight and aggregate the neighboring tail entities of each head entity:
[0023] in, For the first Entity in the second recursive propagation neighborhood characteristics, For the first Entity in the second recursive propagation The characteristics are represented.
[0024] The feature representations of each entity in the current recursive propagation are obtained using the following formula:
[0025] in, For the first Entity in the second recursive propagation Feature representation, For leaky modified linear unit activation functions, and This is the pre-trained weight matrix; For the first Entity in the second recursive propagation Feature representation, This is an element-wise product operation.
[0026] In a second aspect, the present invention provides a power large-scale model test case recommendation system, comprising: an exploration depth determination module, used to obtain the attack success rate and recommendation latency of the previously recommended test cases, construct state data in conjunction with power business scenarios, and call a graph exploration depth determination model based on reinforcement learning pre-training according to the state data to obtain the current graph exploration depth; a recursive propagation module, used to perform recursive propagation of the preset test case recommendation knowledge graph to the current graph exploration depth, and in each recursive propagation: for triples with each entity as the head entity, the neighbor tail entities of each head entity are weighted and aggregated through a relation-aware attention mechanism and then fused with each head entity through a bidirectional interactive aggregator to obtain the feature representation of each entity in the current recursive propagation; and a test case recommendation module, used to concatenate the feature representation of the entity corresponding to the power business scenario and the feature representation of the entity corresponding to each test case in each recursive propagation to obtain the fused feature of the power business scenario and the fused feature of each test case, and obtain the inner product of the fused feature of the power business scenario and the fused feature of each test case, and select the test case corresponding to the largest inner product of the previous preset number as the currently recommended test case.
[0027] Optionally, the graph exploration depth determination model includes a benefit value prediction network and a risk value prediction network; the step of calling the graph exploration depth determination model based on reinforcement learning pre-training according to the state data to obtain the current graph exploration depth includes: obtaining the sampling probability distribution of the graph exploration depth through the following formula:
[0028] in, for The sampling probability, To explore the depth of the currently calculated map, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. For state data, To predict the network parameters of the benefit value prediction network, To predict network parameters for risk values, Explore depth for any map. To explore deep sets for the map.
[0029] The current map exploration depth is obtained by randomly sampling based on the sampling probability distribution of the map exploration depth.
[0030] Optionally, the benefit value prediction network and the risk value prediction network are trained in the following manner: Constructing experience samples and random sampling Based on a set of empirical samples, the network parameters of the benefit value prediction network and the risk value prediction network are updated using the following formula:
[0031]
[0032] in, For the first The status data of the second recommendation , For power business scenarios, For the first The attack success rate of the second recommended test case. for Recommended latency for recommended test cases. For the first The next recommended depth of current map exploration. For the first The second recommended calculated benefit value, For the first The next recommended calculation of the risk value, For the first The status data of the second recommendation; , , , and The first empirical samples , , , and ; For the network parameters to be optimized, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. and This is the preset discount factor.
[0033] Optionally, the first The second recommended calculation benefit value We obtain it from the following formula:
[0034] in, For the first The attack success rate of the second recommended test case. The preset importance coefficient for measuring recommended latency, For the first Recommended latency for the next recommended test case.
[0035] The first The recommended calculation of risk value We obtain it from the following formula:
[0036] in, The number of levels quantified to determine the success rate of an attack. For the first A penalty factor that quantifies the success rate of an attack. For the first Each attack success rate is quantified into a single level.
[0037] Optionally, both the benefit value prediction network and the risk value prediction network consist of four fully connected layers connected in sequence.
[0038] Optionally, the entities in the test case recommendation knowledge graph include power business scenarios, test cases, and test case semantics; the relationships between entities include interaction relationships and attribution relationships; wherein, the test case semantics include the large model attack type targeted by the test case and the risk type corresponding to the test case.
[0039] Optionally, the weighted aggregation of each head entity's neighboring tail entities through the relation-aware attention mechanism, followed by fusion with each head entity via a bidirectional interactive aggregator, to obtain the feature representation of each entity in the current recursive propagation includes: obtaining the attention score of the triple with each entity as the head entity using the following formula:
[0040] in, For triples Attention score In entity As the head entity, based on relationships For relationships between entities, based on entities For tail entities, for The transformation matrix, for Continuous eigenvectors, for Continuous eigenvectors, for Continuous eigenvectors, It is the hyperbolic tangent activation function.
[0041] The following formula will be used to... Normalization is performed:
[0042] in, For normalization , For The set of all triples of the head entity. For triples Attention score.
[0043] The following formula is used to weight and aggregate the neighboring tail entities of each head entity:
[0044] in, For the first Entity in the second recursive propagation neighborhood characteristics, For the first Entity in the second recursive propagation The characteristics are represented.
[0045] The feature representations of each entity in the current recursive propagation are obtained using the following formula:
[0046] in, For the first Entity in the second recursive propagation Feature representation, For leaky modified linear unit activation functions, and This is the pre-trained weight matrix; For the first Entity in the second recursive propagation Feature representation, This is an element-wise product operation.
[0047] In a third aspect, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the power large-scale model test case recommendation method.
[0048] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the power large-scale model test case recommendation method.
[0049] Compared with the prior art, the present invention has the following beneficial effects: This invention presents a power large-scale model test case recommendation method. By constructing state data containing attack success rate and recommendation latency, and utilizing the depth determined by reinforcement learning pre-training, the model adaptively selects the optimal current knowledge graph exploration depth. This dynamically adjusts the knowledge graph's propagation range based on historical recommendation performance, ensuring sufficient semantic information capture while effectively avoiding ineffective computation and excessively high recommendation latency caused by fixed depth or blind deep propagation. Furthermore, by employing a relation-aware attention mechanism in recursive propagation to weighted aggregate the neighboring tail entities of each head entity, it can project entity features under different relations onto the target entity. Semantic matching is performed in the corresponding relation space, which significantly improves the accuracy of the association between test cases and security requirements in complex power business scenarios. Combined with a bidirectional interactive aggregator, the features of the product and the features of the neighboring products are fused through addition and multiplication, which further enhances the richness and interactivity of the feature expression. Finally, the deep features are concatenated into a fusion vector through a layer aggregation mechanism and the test cases are selected by inner product sorting. This allows the recommendation results to simultaneously integrate the hierarchical semantic information in multi-hop propagation, thereby achieving synergistic optimization of recommendation accuracy and response speed in the power large model test scenario, effectively supporting the rapid evaluation of the security performance of the power large model. Attached Figure Description
[0050] Figure 1 The flowchart shows the method for recommending test cases for a large-scale power model according to an embodiment of the present invention.
[0051] Figure 2The following is a system structure diagram for recommending test cases for a large-scale power model according to an embodiment of the present invention. Detailed Implementation
[0052] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0053] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0054] The present invention will now be described in further detail with reference to the accompanying drawings: See Figure 1 In one embodiment of the present invention, a method for recommending test cases for a large power model is provided. A relational attention mechanism is introduced to enhance the high-order semantic representation capability of nodes. Based on the attack success rate and recommendation latency, reinforcement learning is used to adaptively optimize the graph exploration depth. While ensuring semantic expression capability, the recommendation efficiency is improved, supporting efficient matching and security assessment of test cases for a large power model.
[0055] Specifically, the method for recommending test cases for the large-scale power model of this invention includes the following steps: S1: Obtain the attack success rate and recommendation latency of the last recommended test case, construct state data in conjunction with the power business scenario, and call the graph exploration depth determination model based on reinforcement learning pre-training according to the state data to obtain the current graph exploration depth.
[0056] Explanatory, in this embodiment, the power business scenario It covers typical application scenarios of multiple large-scale power models, including power data classification, power data analysis, and power knowledge Q&A.
[0057] Explanatory, initial recommendation uses the initial attack success rate. and recommended latency The success rate of a typical initial attack and recommended latency Set to 0.
[0058] For example, in this embodiment, a result discriminator is constructed to determine the attack success rate of the recommended test cases. Specifically, it is constructed using a pre-trained small-scale language model, whose network parameters are: When using this method, the recommended test cases are applied to large-scale power model tests, and a result discriminator is employed. Identify whether the output of the large-scale power model contains keywords related to violations, illegal or irregular public opinion, etc., and base decisions on the power business scenario. The system determines whether the recommended test cases are effective and then calculates the attack success rate of the recommended test cases. For example, in power flow calculation, the large-scale power model test only considers the risk of violations in the power industry. If test cases related to business risks are recommended, then the test cases will not be effective.
[0059] S2: For the pre-defined test cases, the recommended knowledge graph is recursively propagated to the current graph exploration depth. In each recursive propagation: for triples with each entity as the head entity, the neighbor tail entities of each head entity are weighted and aggregated through a relation-aware attention mechanism and then fused with each head entity through a bidirectional interactive aggregator to obtain the feature representation of each entity in the current recursive propagation.
[0060] For example, the entities in the test case recommendation knowledge graph include power business scenarios, test cases, and test case semantics; the relationships between entities include interaction relationships and attribution relationships; among them, test case semantics includes the large model attack type targeted by the test case and the risk type corresponding to the test case.
[0061] Specifically, test cases It covers test cases generated through various methods, including those constructed by human experts, automatically generated based on prompt word templates, and automatically generated from large-scale red team test models; test case semantics. This includes the types of large-scale attacks targeted by the test cases, such as jailbreak attacks, prompt injection attacks, and adversarial attacks, as well as the types of risks corresponding to the test cases, such as business risks, user rights infringement risks, and power industry violation risks.
[0062] For interpretable test case recommendation knowledge graphs, during initial construction, interaction relationships between entities can be built based on historical interaction records between power business scenarios and test cases, and attribution relationships can also be built based on the attribution of test cases and their semantics.
[0063] Therefore, the knowledge graph of test cases for the large power model can be represented as several triples. Among them, entities and entity As head and tail entities, the relationship Representing relationships between entities, entity set Includes all power business scenarios, test cases, and test case semantic entities, as well as relationship sets. It consists of relationships such as interaction and attribution between entities.
[0064] Interpretive, initialization of optional map exploration depth set This represents the number of layers in the knowledge graph where recursive feature propagation is performed. Each additional layer of depth involves one more recursive feature propagation, aggregating features from outermost tail entities into the current head entity. For example, the depth of knowledge graph exploration. At this time, only test cases that have historical interactions with the current power business scenario are recommended; At that time, we will explore scenarios such as "electricity business scenarios". To test cases To prompt word injection attack To test cases "Higher-order relational paths".
[0065] For example, in this embodiment, .
[0066] S3: Concatenate the feature representations of the entities corresponding to the power business scenario and the feature representations of the entities corresponding to each test case in each recursive propagation to obtain the fused features of the power business scenario and the fused features of each test case. Obtain the inner product of the fused features of the power business scenario and the fused features of each test case, and select the test cases corresponding to the largest number of inner products as the currently recommended test cases.
[0067] For example, a layer aggregation mechanism is used to concatenate the feature representations of entities corresponding to the power business scenario and the feature representations of entities corresponding to each test case in each recursive propagation into a single fusion vector, including:
[0068]
[0069] in, For power business scenarios The integration characteristics of power business scenarios For power business scenarios Feature representation in the 0th recursive propagation For power business scenarios The Feature representation in recursive propagation For test cases The test case fusion feature, For test cases Feature representation in the 0th recursive propagation For test cases The Feature representation in recursive propagation.
[0070] For example, calculate the inner product of the fused features of the power business scenario and the fused features of each test case:
[0071] in, for and The inner product of.
[0072] Specifically, according to For test case set Sort the test cases in descending order, and then select the top ones. Construct the current recommended set of test cases from 1 test case. It can also be updated in the preset test case recommendation knowledge graph. and The interaction relationships between the test cases. Among them, For the first The second recommendation One test case.
[0073] In summary, the power large-scale model test case recommendation method of this invention constructs state data containing attack success rate and recommendation latency, and utilizes the depth determined by reinforcement learning pre-training to adaptively select the optimal current knowledge graph exploration depth. This allows for dynamic adjustment of the knowledge graph's propagation range based on historical recommendation performance, ensuring sufficient capture of semantic information while effectively avoiding ineffective computation and excessively high recommendation latency caused by fixed depth or blind deep propagation. Furthermore, by employing a relation-aware attention mechanism in recursive propagation to weighted aggregate the neighboring tail entities of each head entity, it can project entity features under different relations... Semantic matching is performed in the corresponding relation space, which significantly improves the accuracy of the association between test cases and security requirements in complex power business scenarios. Combined with a bidirectional interactive aggregator, the features of the test case and the features of the neighboring area are fused by addition and multiplication, which further enhances the richness and interactivity of the feature expression. Finally, the deep features are concatenated into a fusion vector through a layer aggregation mechanism and the test cases are selected by inner product sorting. This allows the recommendation results to simultaneously integrate the hierarchical semantic information in multi-hop propagation, thereby achieving synergistic optimization of recommendation accuracy and response speed in the power large model test scenario, effectively supporting the rapid evaluation of the security performance of the power large model.
[0074] In one possible implementation, the map exploration depth determination model includes a benefit value prediction network and a risk value prediction network. For example, in some implementations, both the benefit value prediction network and the risk value prediction network are neural networks consisting of four fully connected layers connected sequentially. Specifically, the number of neurons in the four fully connected layers can be set to 5, 64, 128, and 15, respectively.
[0075] In one possible implementation, the step of calling a graph exploration depth determination model based on reinforcement learning pre-trained according to the state data to obtain the current graph exploration depth includes: The sampling probability distribution of the map exploration depth is obtained by the following formula:
[0076] in, for The sampling probability, To explore the depth of the currently calculated map, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. For state data, To predict the network parameters of the benefit value prediction network, To predict network parameters for risk values, Explore depth for any map. To explore deep sets for the map.
[0077] The current map exploration depth is obtained by randomly sampling based on the sampling probability distribution of the map exploration depth.
[0078] Explained in this embodiment, based on state data, a benefit value prediction network outputs a predicted benefit value, and a risk value prediction network outputs a predicted risk value. Dividing the predicted benefit value by one and adding the predicted risk value yields a risk-adjusted decision value. After exponential function and normalization processing, a sampling probability distribution of the map exploration depth is obtained. Random sampling is then performed based on this probability distribution to obtain the current map exploration depth. Through the dual-network architecture of the benefit value prediction network and the risk value prediction network, risk is introduced as a penalty in the decision-making process. This effectively suppresses high-benefit but high-risk map exploration depths, while low-risk and moderately beneficial map exploration depths receive a higher selection probability. This achieves adaptive matching between the map exploration depth and the current state, avoiding the problems of invalid computation and excessive recommendation latency caused by fixed depths or blindly deep exploration.
[0079] In one possible implementation, the benefit value prediction network and the risk value prediction network are trained in the following manner: Constructing experience samples and random sampling Based on a set of empirical samples, the network parameters of the benefit value prediction network and the risk value prediction network are updated using the following formula:
[0080]
[0081] in, For the first The status data of the second recommendation , For power business scenarios, For the first The attack success rate of the second recommended test case. for Recommended latency for recommended test cases. For the first The next recommended depth of current map exploration. For the first The second recommended calculated benefit value, For the first The next recommended calculation of the risk value, For the first The status data of the second recommendation; , , , and The first empirical samples , , , and ; For the network parameters to be optimized, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. and This is the preset discount factor.
[0082] For example, and Set it to 0.5.
[0083] Interpretive, reinforcement learning-based training employs temporal difference learning. It constructs empirical samples containing the current state, selected graph exploration depth, benefit value, risk value, and next state, and uses an experience replay mechanism to randomly sample small batches of samples to iteratively optimize the two prediction networks. Specifically, the benefit value prediction network updates with the discount sum between the immediate benefit value and the maximum predicted benefit value in the next state as its objective value, minimizing the mean square error between this objective value and the current predicted benefit value. This allows the network to accurately estimate the long-term cumulative benefit gained from choosing a certain exploration depth in the current state. Similarly, the risk value prediction network updates with the discount sum between the immediate risk value and the minimum predicted risk value in the next state as its objective value, minimizing the mean square error between this objective value and the current predicted risk value. This allows the network to accurately estimate the long-term cumulative risk incurred by choosing a certain exploration depth in the current state. Through independent optimization of this dual-network architecture, the benefit value prediction network and the risk value prediction network continuously adjust their parameters through ongoing interaction with the recommendation environment, gradually learning the optimal depth selection strategy for different states. This enables efficient adaptive decision-making regarding graph exploration depth based on the current state during the inference phase.
[0084] In one possible implementation, the first The second recommended calculation benefit value We obtain it from the following formula:
[0085] in, For the first The attack success rate of the second recommended test case. The preset importance coefficient for measuring recommended latency, For the first Recommended latency for the next recommended test case.
[0086] The interpretive, benefit-calculating method incorporates a pre-defined importance coefficient for measuring recommendation delay, treating it as a penalty in the benefit evaluation system. The attack success rate of the second recommended test case is used as a positive reward, and the product of the recommended latency of the second recommended test case and the preset importance coefficient is used as a negative penalty. The difference between the two is used to obtain the result. The calculation of the benefit value of the recommendation results in a higher benefit value for recommendations with shorter recommendation latency and higher attack success rate, while recommendations with excessively long recommendation latency will have their benefit value reduced due to latency penalty, even if the attack success rate is high.
[0087] In this way, the benefit value prediction network can take recommendation latency as one of the key factors affecting long-term cumulative benefits during the learning process, thereby guiding the reinforcement learning strategy to actively avoid exploration depth with high latency while pursuing a high attack success rate, and achieving synergistic optimization of recommendation accuracy and response speed.
[0088] In one possible implementation, the first The recommended calculation of risk value We obtain it from the following formula:
[0089] in, The number of levels quantified to determine the success rate of an attack. For the first A penalty factor that quantifies the success rate of an attack. For the first Each attack success rate is quantified into a single level.
[0090] For example, the attack success rate can be quantified into several levels using an average method.
[0091] Interpretively, by quantifying the attack success rate into multiple levels and configuring a corresponding penalty factor for each level, a quantitative assessment mechanism for risk level is constructed. Specifically, for the first level... The system compares the attack success rate of the recommended test cases with various attack success rate quantification levels, calculates the risk contribution value at each level using an exponential function, and ensures that when the attack success rate falls below a certain quantification level, the risk contribution value for that level increases exponentially. This risk contribution value is then multiplied by the corresponding level's penalty factor and summed to obtain the result. The next recommended risk value is calculated. In this way, the lower the attack success rate, the higher the calculated risk value, and the growth rate of the risk value accelerates non-linearly as the success rate decreases. This allows the risk value prediction network to accurately capture the high penalty signal brought by low success rate recommendation results during the learning process, guide the reinforcement learning strategy to actively avoid exploration depths that may lead to low attack success rates, and ensure the reliability of the recommendation results.
[0092] In one possible implementation, the weighted aggregation of each head entity's neighboring tail entities using a relation-aware attention mechanism, followed by fusion with each head entity via a bidirectional interactive aggregator, to obtain the feature representations of each entity in the current recursive propagation includes: The attention score for triples with each entity as the head entity is obtained using the following formula:
[0093] in, For triples Attention score In entity As the head entity, based on relationships For relationships between entities, based on entities For tail entities, for The transformation matrix, for Continuous eigenvectors, for Continuous eigenvectors, for Continuous eigenvectors, It is the hyperbolic tangent activation function.
[0094] The following formula will be used to... Normalization is performed:
[0095] in, For normalization , For The set of all triples of the head entity. For triples Attention score.
[0096] The following formula is used to weight and aggregate the neighboring tail entities of each head entity:
[0097] in, For the first Entity in the second recursive propagation neighborhood characteristics, For the first Entity in the second recursive propagation The characteristics are represented.
[0098] The feature representations of each entity in the current recursive propagation are obtained using the following formula:
[0099] in, For the first Entity in the second recursive propagation Feature representation, For leaky modified linear unit activation functions, and This is the pre-trained weight matrix; For the first Entity in the second recursive propagation Feature representation, This is an element-wise product operation.
[0100] Explanatory, in the knowledge graph for test case recommendation Before recursive propagation, since the knowledge graph for test case recommendation is stored in the form of graph data, that is, entities and relations are represented by discrete symbolic identifiers (such as entity ID and relation ID), they cannot directly participate in the computation of the neural network. Therefore, it is necessary to first map the entities and relations in the knowledge graph for test case recommendation into continuous feature vectors.
[0101] For example, an embedding layer mapping approach can be used, where a learnable embedding vector table is maintained for each entity and each relation. By looking up the embedding vector corresponding to the entity ID or relation ID, discrete symbolic identifiers are converted into continuous feature vectors of fixed dimensions. Alternatively, pre-trained knowledge graph embedding methods, such as TransE, TransR, or RotatE, can be used to pre-train vector representations of entities and relations on a large amount of graph data, and then use these as initial feature inputs to the model for fine-tuning. Another approach is to combine textual features such as entity names and descriptions, using a pre-trained language model to extract semantic vectors of entities as their initial feature representations. Through these mapping methods, graph data is transformed into a continuous vector space that can be processed by neural networks, providing a numerical foundation for subsequent attention calculations, feature aggregation, and recursive propagation.
[0102] Explanatory, in the In layered recursive propagation, for... Any triplet of the head entity Attention mechanism is used to compute tail entities Passed to Information weights, that is, the feature vectors of neighboring entities With head entity feature vector By transforming the matrix Projected into a specific relation space, and combined with relation feature vectors To calculate attention scores. In this implementation, the transformation matrix... For each relationship Independent settings, transformation matrix As trainable parameters, they can be trained together with the map exploration depth determination model during the training phase, and then solidified after training for use in the subsequent recommendation phase.
[0103] Explanatory This represents a modified linear unit activation function with leakage, used to introduce nonlinear mapping capabilities in feature aggregation.
[0104] Explained, this process achieves recursive propagation and updating of entity features in the knowledge graph through a relation-aware attention mechanism and a bidirectional interactive aggregator. Specifically, for each triple with any entity as the head entity, the feature vectors of the head entity and the tail entity are first projected onto the relation space corresponding to the current relation using the transformation matrix corresponding to the head entity. Combined with the relation feature vector of the relation, the attention score of the triple is calculated using the hyperbolic tangent activation function to measure the semantic importance of the tail entity to the head entity in the current relation. Subsequently, the attention scores of all triples starting from the same head entity are normalized to obtain the normalized attention weights of each neighboring tail entity. Based on this, the feature vectors of each neighboring tail entity are weighted and aggregated to form the neighborhood features of the head entity. On this basis, through the bidirectional interactive aggregator, the head entity's own features are added and fused with the neighborhood features, and the head entity's own features are multiplied and fused with the neighborhood features to capture the interactive synergistic effect between features. After being processed by the modified linear unit activation function with leakage, they are added together to obtain the updated feature representation of the entity in the current recursive propagation layer. In this way, the attention mechanism can dynamically adjust the aggregation weight of neighbor information according to different relationship types, so that the feature propagation process has the semantic matching ability of relationship awareness. The bidirectional interactive aggregator enhances the expressive ability of its own features and neighborhood features through addition and multiplication dual-path fusion, thereby achieving efficient updating of entity features and semantic enhancement in recursive propagation.
[0105] The following are embodiments of the apparatus of the present invention, which can be used to execute embodiments of the method of the present invention. For details not disclosed in the apparatus embodiments, please refer to the embodiments of the method of the present invention.
[0106] See Figure 2 In another embodiment of the present invention, a power large-scale model test case recommendation system is provided, which can be used to implement the above-mentioned power large-scale model test case recommendation method. Specifically, the power large-scale model test case recommendation system includes an exploration depth determination module, a recursive propagation module, and a test case recommendation module.
[0107] The module is divided into several parts: The exploration depth determination module obtains the attack success rate and recommendation latency of the previously recommended test cases, constructs state data based on the power business scenario, and calls a graph exploration depth determination model pre-trained using reinforcement learning based on the state data to obtain the current graph exploration depth. The recursive propagation module performs recursive propagation on the preset test case recommendation knowledge graph at the current graph exploration depth. In each recursive propagation: for triples with each entity as the head entity, a weighted aggregation of each head entity's neighboring tail entities is performed using a relation-aware attention mechanism, and then fused with each head entity through a bidirectional interactive aggregator to obtain the feature representation of each entity in the current recursive propagation. The test case recommendation module concatenates the feature representation of the entity corresponding to the power business scenario in each recursive propagation with the feature representation of the entity corresponding to each test case to obtain the fused feature of the power business scenario and the fused feature of each test case. It also obtains the inner product of the fused feature of the power business scenario and the fused feature of each test case, and selects the test case corresponding to the largest inner product from the previous preset number as the currently recommended test case.
[0108] In one possible implementation, the map exploration depth determination model includes a benefit value prediction network and a risk value prediction network.
[0109] The step of calling the graph exploration depth determination model based on reinforcement learning pre-training according to the state data to obtain the current graph exploration depth includes: obtaining the sampling probability distribution of the graph exploration depth through the following formula:
[0110] in, for The sampling probability, To explore the depth of the currently calculated map, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. For state data, To predict the network parameters of the benefit value prediction network, To predict network parameters for risk values, Explore depth for any map. To explore deep sets for the map.
[0111] The current map exploration depth is obtained by randomly sampling based on the sampling probability distribution of the map exploration depth.
[0112] In one possible implementation, the benefit value prediction network and the risk value prediction network are trained in the following manner: Constructing experience samples and random sampling Based on a set of empirical samples, the network parameters of the benefit value prediction network and the risk value prediction network are updated using the following formula:
[0113]
[0114] in, For the first The status data of the second recommendation , For power business scenarios, For the first The attack success rate of the second recommended test case. for Recommended latency for recommended test cases. For the first The next recommended depth of current map exploration. For the first The second recommended calculated benefit value, For the first The next recommended calculation of the risk value, For the first The status data of the second recommendation; , , , and The first empirical samples , , , and ; For the network parameters to be optimized, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. and This is the preset discount factor.
[0115] In one possible implementation, the first The second recommended calculation benefit value We obtain it from the following formula:
[0116] in, For the first The attack success rate of the second recommended test case. The preset importance coefficient for measuring recommended latency, For the first Recommended latency for the next recommended test case.
[0117] The first The recommended calculation of risk value We obtain it from the following formula:
[0118] in, The number of levels quantified to determine the success rate of an attack. For the first A penalty factor that quantifies the success rate of an attack. For the first Each attack success rate is quantified into a single level.
[0119] In one possible implementation, both the benefit value prediction network and the risk value prediction network consist of four fully connected layers connected in sequence.
[0120] In one possible implementation, the entities in the test case recommendation knowledge graph include power business scenarios, test cases, and test case semantics; the relationships between entities include interaction relationships and attribution relationships; wherein, the test case semantics include the large model attack type targeted by the test case and the risk type corresponding to the test case.
[0121] In one possible implementation, the weighted aggregation of each head entity's neighboring tail entities using a relation-aware attention mechanism, followed by fusion with each head entity via a bidirectional interactive aggregator, yields the feature representations of each entity in the current recursive propagation. This includes obtaining the attention score for the triples with each entity as the head entity using the following formula:
[0122] in, For triples Attention score In entity As the head entity, based on relationships For relationships between entities, based on entities For tail entities, for The transformation matrix, for Continuous eigenvectors, for Continuous eigenvectors, for Continuous eigenvectors, It is the hyperbolic tangent activation function.
[0123] The following formula will be used to... Normalization is performed:
[0124] in, For normalization , For The set of all triples of the head entity. For triples Attention score.
[0125] The following formula is used to weight and aggregate the neighboring tail entities of each head entity:
[0126] in, For the first Entity in the second recursive propagation neighborhood characteristics, For the first Entity in the second recursive propagation The characteristics are represented.
[0127] The feature representations of each entity in the current recursive propagation are obtained using the following formula:
[0128] in, For the first Entity in the second recursive propagation Feature representation, For leaky modified linear unit activation functions, and This is the pre-trained weight matrix; For the first Entity in the second recursive propagation Feature representation, This is an element-wise product operation.
[0129] All relevant content of each step involved in the aforementioned embodiments of the power large-scale model test case recommendation method can be referenced from the functional description of the corresponding functional module of the power large-scale model test case recommendation system in the embodiments of the present invention, and will not be repeated here.
[0130] The module division in this embodiment of the invention is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0131] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions from the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used for the operation of a power large-scale model test case recommendation method.
[0132] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the power large-scale model test case recommendation method in the above embodiments.
[0133] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0134] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0135] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0136] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for recommending test cases for a large-scale power model, characterized in that, include: The attack success rate and recommendation latency of the last recommended test case are obtained, and state data is constructed in combination with the power business scenario. Based on the state data, a graph exploration depth determination model based on reinforcement learning pre-training is called to obtain the current graph exploration depth. The knowledge graph recommended for the preset test cases is recursively propagated to the current graph exploration depth. In each recursive propagation: for triples with each entity as the head entity, the tail entities of each head entity are weighted and aggregated through a relation-aware attention mechanism and then fused with each head entity through a bidirectional interactive aggregator to obtain the feature representation of each entity in the current recursive propagation. The feature representations of the entities corresponding to the power business scenario and the feature representations of the entities corresponding to each test case are concatenated in each recursive propagation to obtain the fused features of the power business scenario and the fused features of each test case. The inner product of the fused features of the power business scenario and the fused features of each test case is obtained, and the test cases corresponding to the largest number of inner products are selected as the currently recommended test cases.
2. The method for recommending test cases for a large-scale power model according to claim 1, characterized in that, The map exploration depth determination model includes a benefit value prediction network and a risk value prediction network; The step of calling the graph exploration depth determination model based on reinforcement learning pre-training according to the state data to obtain the current graph exploration depth includes: obtaining the sampling probability distribution of the graph exploration depth through the following formula: in, for The sampling probability, To explore the depth of the currently calculated map, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. For state data, To predict the network parameters of the benefit value prediction network, To predict network parameters for risk values, Explore depth for any map. To explore deep sets for the map; The current map exploration depth is obtained by randomly sampling based on the sampling probability distribution of the map exploration depth.
3. The method for recommending test cases for a large-scale power model according to claim 2, characterized in that, The benefit value prediction network and risk value prediction network are trained in the following manner: by Constructing experience samples and random sampling Based on a set of empirical samples, the network parameters of the benefit value prediction network and the risk value prediction network are updated using the following formula: in, For the first The status data of the second recommendation , For power business scenarios, For the first The attack success rate of the second recommended test case. for Recommended latency for recommended test cases. For the first The next recommended depth of current map exploration. For the first The second recommended calculated benefit value, For the first The next recommended calculation of the risk value, For the first The status data of the second recommendation; , , , and The first empirical samples , , , and ; For the network parameters to be optimized, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. and This is the preset discount factor.
4. The method for recommending test cases for a large-scale power model according to claim 3, characterized in that, The first The second recommended calculation benefit value We obtain it from the following formula: in, For the first The attack success rate of the second recommended test case. The preset importance coefficient for measuring recommended latency, For the first Recommended latency for the next recommended test case; The first The recommended calculation of risk value We obtain it from the following formula: in, The number of levels quantified to determine the success rate of an attack. For the first A penalty factor that quantifies the success rate of an attack. For the first Each attack success rate is quantified into a single level.
5. The method for recommending test cases for a large-scale power model according to claim 2, characterized in that, Both the benefit value prediction network and the risk value prediction network consist of four fully connected layers connected in sequence.
6. The method for recommending test cases for a large-scale power model according to claim 1, characterized in that, The entities in the knowledge graph recommended by the test cases include power business scenarios, test cases, and test case semantics; the relationships between entities include interaction relationships and attribution relationships; among them, the test case semantics include the large model attack type targeted by the test case and the risk type corresponding to the test case.
7. The method for recommending test cases for a large-scale power model according to claim 1, characterized in that, The weighted aggregation of each head entity's neighboring tail entities through a relation-aware attention mechanism, followed by fusion with each head entity via a bidirectional interactive aggregator, yields the feature representations of each entity in the current recursive propagation, including: The attention score for triples with each entity as the head entity is obtained using the following formula: in, For triples Attention score In entity As the head entity, based on relationships For relationships between entities, based on entities For tail entities, for The transformation matrix, for Continuous eigenvectors, for Continuous eigenvectors, for Continuous eigenvectors, It is the hyperbolic tangent activation function; The following formula will be used to... Normalization is performed: in, For normalization , For The set of all triples of the head entity. For triples Attention score; The following formula is used to weight and aggregate the neighboring tail entities of each head entity: in, For the first Entity in the second recursive propagation neighborhood characteristics, For the first Entity in the second recursive propagation Feature representation; The feature representations of each entity in the current recursive propagation are obtained using the following formula: in, For the first Entity in the second recursive propagation Feature representation, For leaky modified linear unit activation functions, and This is the pre-trained weight matrix; For the first Entity in the second recursive propagation Feature representation, This is an element-wise product operation.
8. A power large-scale model test case recommendation system, characterized in that, include: The exploration depth determination module is used to obtain the attack success rate and recommendation latency of the previously recommended test cases, and to construct state data in combination with the power business scenario. Based on the state data, it calls the graph exploration depth determination model based on reinforcement learning pre-training to obtain the current graph exploration depth. The recursive propagation module is used to perform recursive propagation of the knowledge graph recommended by the preset test cases to the current graph exploration depth. In each recursive propagation: for triples with each entity as the head entity, the neighbor tail entities of each head entity are weighted and aggregated through the relation-aware attention mechanism and then fused with each head entity through the bidirectional interactive aggregator to obtain the feature representation of each entity in the current recursive propagation. The test case recommendation module is used to concatenate the feature representations of the entities corresponding to the power business scenario and the feature representations of the entities corresponding to each test case in each recursive propagation to obtain the fused features of the power business scenario and the fused features of each test case. It also obtains the inner product of the fused features of the power business scenario and the fused features of each test case, and selects the test case corresponding to the largest inner product of the preset number of test cases as the currently recommended test cases.
9. The power large-scale model test case recommendation system according to claim 8, characterized in that, The map exploration depth determination model includes a benefit value prediction network and a risk value prediction network; The step of calling the graph exploration depth determination model based on reinforcement learning pre-training according to the state data to obtain the current graph exploration depth includes: obtaining the sampling probability distribution of the graph exploration depth through the following formula: in, for The sampling probability, To explore the depth of the currently calculated map, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. For state data, To predict the network parameters of the benefit value prediction network, To predict network parameters for risk values, Explore depth for any map. To explore deep sets for the map; The current map exploration depth is obtained by randomly sampling based on the sampling probability distribution of the map exploration depth.
10. The power large-scale model test case recommendation system according to claim 9, characterized in that, The benefit value prediction network and risk value prediction network are trained in the following manner: by Constructing experience samples and random sampling Based on a set of empirical samples, the network parameters of the benefit value prediction network and the risk value prediction network are updated using the following formula: in, For the first The status data of the second recommendation , For power business scenarios, For the first The attack success rate of the second recommended test case. for Recommended latency for recommended test cases. For the first The next recommended depth of current map exploration. For the first The second recommended calculated benefit value, For the first The next recommended calculation of the risk value, For the first The status data of the second recommendation; , , , and The first empirical samples , , , and ; For the network parameters to be optimized, for The following is a prediction of benefit values based on a benefit value prediction network. for The following is a prediction of risk value based on a risk value prediction network. and This is the preset discount factor.
11. The power large-scale model test case recommendation system according to claim 10, characterized in that, The first The second recommended calculation benefit value We obtain it from the following formula: in, For the first The attack success rate of the second recommended test case. The preset importance coefficient for measuring recommended latency, For the first Recommended latency for the next recommended test case; The first The recommended calculation of risk value We obtain it from the following formula: in, The number of levels quantified to determine the success rate of an attack. For the first A penalty factor that quantifies the success rate of an attack. For the first Each attack success rate is quantified into a single level.
12. The power large-scale model test case recommendation system according to claim 9, characterized in that, Both the benefit value prediction network and the risk value prediction network consist of four fully connected layers connected in sequence.
13. The power large-scale model test case recommendation system according to claim 8, characterized in that, The entities in the knowledge graph recommended by the test cases include power business scenarios, test cases, and test case semantics; the relationships between entities include interaction relationships and attribution relationships; among them, the test case semantics include the large model attack type targeted by the test case and the risk type corresponding to the test case.
14. The power large-scale model test case recommendation system according to claim 8, characterized in that, The weighted aggregation of each head entity's neighboring tail entities through a relation-aware attention mechanism, followed by fusion with each head entity via a bidirectional interactive aggregator, yields the feature representations of each entity in the current recursive propagation, including: The attention score for triples with each entity as the head entity is obtained using the following formula: in, For triples Attention score In entity As the head entity, based on relationships For relationships between entities, based on entities For tail entities, for The transformation matrix, for Continuous eigenvectors, for Continuous eigenvectors, for Continuous eigenvectors, It is the hyperbolic tangent activation function; The following formula will be used to... Normalization is performed: in, For normalization , For The set of all triples of the head entity. For triples Attention score; The following formula is used to weight and aggregate the neighboring tail entities of each head entity: in, For the first Entity in the second recursive propagation neighborhood characteristics, For the first Entity in the second recursive propagation Feature representation; The feature representations of each entity in the current recursive propagation are obtained using the following formula: in, For the first Entity in the second recursive propagation Feature representation, For leaky modified linear unit activation functions, and This is the pre-trained weight matrix; For the first Entity in the second recursive propagation Feature representation, This is an element-wise product operation.
15. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the power large-scale model test case recommendation method as described in any one of claims 1 to 7.
16. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the power large-scale model test case recommendation method as described in any one of claims 1 to 7.