Method and system for extracting temporal logic in requirement data
Patent Information
- Application Number
- CN202211288970.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2042-10-20
AI Technical Summary
用以解决相关技术中存在的,需要业务人员人工处理每种自然语言技术下的需求数据所导致的开发效率不高的问题
[0039] This application involves acquiring the requirement data to be analyzed and segmenting it into multiple requirement data sentences using natural language processing (NLP) technology. Multiple fields within each requirement data sentence are labeled with relationships, resulting in multiple sets of field relationships, each containing at least two fields. Based on a pre-defined set of extraction rules, matching extraction rules are determined for each set of field relationships, and at least one target field is extracted from each set of field relationships based on these rules, resulting in a target field set expressed using STL formulas. Based on the target field set, the requirement data fields to be extracted from the requirement data to be analyzed are determined. By applying the technical solution of this application, a complete technical solution for extracting key fields and automatically mining logical properties from requirement data using NLP technology can be achieved. This eliminates the need for manual reading and understanding of large amounts of NLP requirement data. This application, leveraging NLP technology and formal methods, fully automates the mining and analysis of properties in requirement data, quickly identifying errors and inconsistencies, improving the quality of requirement data, and significantly ensuring the timeliness of subsequent business processing.
Smart Images

Figure CN115617311B_ABST
Abstract
Description
Technical Field
[0001] This application relates to data processing technology, and in particular to a method and system for extracting temporal logic from demand data. Background Technology
[0002] In practice, requirements engineers typically use natural language to describe requirements. However, natural language is highly susceptible to influences from geographical location, socio-cultural factors, and even the subjective intent of the speaker. Furthermore, its inherent ambiguity means that when development engineers interpret requirements, ambiguity and the overlooking of implicit requirements can frequently arise, ultimately leading to errors in the design and development process. Natural Language Processing (NLP) is an important branch of computer science and artificial intelligence that utilizes computers to process, understand, and apply human language.
[0003] The primary task of Natural Language Processing (NLP) is to represent natural language in a computer using linguistic knowledge, including the analysis and processing of characters, words, sentences, paragraphs, and texts. Meanwhile, in recent years, STL has been widely used to describe complex time-series data in fields such as automotive electronics and industrial control. STL is a lightweight specification language; its application in the verification of highly reliable systems can help engineers evaluate the complex real-time safety performance of control software and provide information on the quality of the design.
[0004] Therefore, converting natural language requirement data into formal specifications can avoid inconsistencies in the understanding of requirement data between requirement data engineers and development engineers, and also prepares the ground for subsequent design model inspection and verification. This can greatly improve development efficiency and has practical significance for ensuring the correctness and security of software. Summary of the Invention
[0005] This application provides a method and system for extracting temporal logic from requirement data. It addresses the problem of low development efficiency caused by the need for business personnel to manually process requirement data for each natural language processing technique in related technologies.
[0006] According to one aspect of the embodiments of this application, a method for extracting temporal logic from demand data is provided, comprising:
[0007] Obtain the requirement data to be analyzed, and use natural language processing technology to segment the requirement data into multiple requirement data sentence structures;
[0008] For each requirement data sentence, the multiple fields contained in it are labeled with their relationships, resulting in multiple sets of field relationships, where each set of field relationships contains at least two fields;
[0009] Based on a preset set of extraction rules, a matching extraction rule is determined for each group of field relationships, and based on the corresponding extraction rule, at least one target field is extracted from each group of field relationships to obtain a set of target fields expressed in STL formulas.
[0010] Perform a requirement data consistency check on the target field set expressed by the STL formula, and determine the temporal logic extraction result of the requirement data based on the check result.
[0011] Optionally, in another embodiment based on the method described above in this application, obtaining the requirement data to be analyzed includes:
[0012] Obtain initial requirement data and determine the domain to which each field in the initial requirement data belongs;
[0013] Based on the domain to which each field belongs, the two adjacent fields in the initial requirement data are pre-processed to obtain the requirement data to be analyzed;
[0014] The preset processing includes:
[0015] If at least two adjacent fields belong to the same domain, then the at least two fields are merged.
[0016] If at least two adjacent fields belong to different fields, the at least two fields are connected by a preset symbol.
[0017] Optionally, in another embodiment based on the method described above in this application, the step of segmenting the demand data to be analyzed into multiple demand data sentence structures using natural language processing technology includes:
[0018] Part-of-speech tagging is performed on each field in the data to be analyzed;
[0019] Based on the hierarchical segmentation strategy, the required data to be analyzed is segmented into multiple required data sentence structures.
[0020] Optionally, in another embodiment based on the method described above in this application, after dividing the demand data to be analyzed into multiple demand data phrases according to the hierarchical segmentation strategy, the method further includes:
[0021] Based on the part-of-speech tagging corresponding to each field contained in each demand data sentence, the corresponding association relationship tagging is performed on at least two adjacent fields in each demand data sentence to obtain the multiple sets of field association relationships;
[0022] Each set of field associations includes at least two fields, as well as an association relationship that reflects the part-of-speech relationship between the at least two fields.
[0023] Optionally, in another embodiment based on the method described above in this application, after annotating the relationships between at least two adjacent fields in each requirement data sentence to obtain the multiple sets of field relationships, the method further includes:
[0024] Obtain the extraction rule set;
[0025] The extraction rule set includes time extraction rules, logic extraction rules, connector extraction rules, and noun extraction rules.
[0026] Optionally, in another embodiment based on the method described above in this application, after obtaining the extraction rule set, the method further includes:
[0027] Based on the part-of-speech tagging of each field, the part-of-speech type corresponding to each field in each group of field associations is determined sequentially;
[0028] Count the number of each type of part of speech in each group of field associations, and determine the matching extraction rules based on the part of speech type with the highest number of occurrences.
[0029] Based on the corresponding extraction rules, at least one target field is extracted from each group of field relationships to obtain an STL formula for representing the target field set.
[0030] Optionally, in another embodiment based on the method described above in this application, after obtaining the STL formula for characterizing the target field set, the method further includes:
[0031] Perform conjunction operations on STL formulas and convert the conjunction formulas into conjunction automata;
[0032] Perform a null check on the conjunctive automaton; and perform a minimum inconsistency subset check on the conjunctive automaton;
[0033] If the minimum inconsistency subset check is passed, the target field contained in the STL formula is taken as the requirement data field to be extracted from the requirement data to be analyzed.
[0034] According to another aspect of the embodiments of this application, a system for extracting temporal logic from demand data is provided, characterized in that it includes:
[0035] The acquisition module is configured to acquire the requirement data to be analyzed and to segment the requirement data to be analyzed into multiple requirement data sentences using natural language technology;
[0036] The annotation module is configured to annotate the relationships between multiple fields contained in each requirement data sentence, resulting in multiple sets of field relationships, where each set of field relationships contains at least two fields;
[0037] The matching module is configured to determine the matching extraction rule for each group of field relationships based on a preset set of extraction rules, and extract at least one target field from each group of field relationships based on the corresponding extraction rule, so as to obtain a set of target fields expressed in STL formula.
[0038] The determination module is configured to perform a requirement data consistency check on the target field set expressed by the STL formula, and determine the temporal logic extraction result of the requirement data based on the check result.
[0039] This application involves acquiring the requirement data to be analyzed and segmenting it into multiple requirement data sentences using natural language processing (NLP) technology. Multiple fields within each requirement data sentence are labeled with relationships, resulting in multiple sets of field relationships, each containing at least two fields. Based on a pre-defined set of extraction rules, matching extraction rules are determined for each set of field relationships, and at least one target field is extracted from each set of field relationships based on these rules, resulting in a target field set expressed using STL formulas. Based on the target field set, the requirement data fields to be extracted from the requirement data to be analyzed are determined. By applying the technical solution of this application, a complete technical solution for extracting key fields and automatically mining logical properties from requirement data using NLP technology can be achieved. This eliminates the need for manual reading and understanding of large amounts of NLP requirement data. This application, leveraging NLP technology and formal methods, fully automates the mining and analysis of properties in requirement data, quickly identifying errors and inconsistencies, improving the quality of requirement data, and significantly ensuring the timeliness of subsequent business processing.
[0040] The technical solution of this application will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0041] The accompanying drawings, which form part of this specification, illustrate embodiments of this application and, together with the description, serve to explain the principles of this application.
[0042] This application can be more clearly understood with reference to the accompanying drawings and the following detailed description, wherein:
[0043] Figure 1 This illustration shows a method for extracting temporal logic from demand data according to an embodiment of this application;
[0044] Figure 2 A flowchart illustrating a method for extracting temporal logic from demand data according to an embodiment of this application is shown.
[0045] Figure 3 This illustration shows a flowchart of a method for checking the consistency of demand data in another method for extracting temporal logic from demand data according to an embodiment of this application.
[0046] Figure 4 This illustration shows a schematic diagram of a system structure for extracting temporal logic from demand data according to an embodiment of this application;
[0047] Figure 5 This illustration shows a schematic diagram of the structure of an electronic device according to an embodiment of this application;
[0048] Figure 6 A schematic diagram of a storage medium provided in one embodiment of this application is shown. Detailed Implementation
[0049] Various exemplary embodiments of this application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this application.
[0050] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0051] The following description of at least one exemplary embodiment is merely illustrative and is not intended to limit the scope of this application or its application or use.
[0052] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0053] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0054] Furthermore, the technical solutions of the various embodiments of this application can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by this application.
[0055] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0056] The following is combined with Figures 1-3 This application describes a method for extracting temporal logic from demand data according to exemplary embodiments thereof. It should be noted that the following application scenarios are shown only to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way. Rather, the embodiments of this application can be applied to any applicable scenario.
[0057] This application also proposes a method and system for extracting temporal logic from demand data.
[0058] Figure 1 A schematic flowchart illustrating a method for extracting temporal logic from demand data according to an embodiment of this application is shown. Figure 1 As shown, the method includes:
[0059] S101, acquire the requirement data to be analyzed, and use natural language processing technology to segment the requirement data to be analyzed into multiple requirement data sentences.
[0060] S102, mark the relationships between multiple fields contained in each requirement data sentence to obtain multiple sets of field relationships, where each set of field relationships contains at least two fields.
[0061] S103, based on the preset set of extraction rules, determine the matching extraction rules for each group of field relationships, and extract at least one target field from each group of field relationships based on the corresponding extraction rules, to obtain a set of target fields expressed by STL formula.
[0062] S104, Based on the target field set, determine the required data fields that need to be extracted from the required data to be analyzed.
[0063] The following combination Figure 2 The method for extracting temporal logic from the required data proposed in this application is described in detail below:
[0064] Step S11: Preprocessing of demand data;
[0065] In the continuous method, step S11 includes:
[0066] Step S11-1: Automatically correct spelling and grammar errors in the required data.
[0067] Furthermore, embodiments of this application can use automated programs to check and help correct spelling and grammatical errors in various fields of the required data.
[0068] As an example, word spelling and sentence grammar can be checked and corrected in the semantic units (words and sentences) of the English text contained in the demand data.
[0069] Step S11-2: Transform entity words or phrases in the required data for a specific domain;
[0070] Furthermore, in this embodiment of the application, fields belonging to a specific domain can be combined into a single field based on the domain to which each field in the requirement data belongs.
[0071] In addition, for fields that appear in different fields, preset symbols (such as "_") can be used to connect two or more fields to make them a whole.
[0072] Optionally, embodiments of this application may also modify specific fields to use all uppercase or all lowercase as the standard, so that they are treated as an entity word during natural language processing.
[0073] Step S11-3: Convert special symbols or arithmetic expressions.
[0074] In one approach, symbols and expressions appearing in the requirement data in this application embodiment will be replaced with corresponding English expressions, and will be replaced as much as possible with specialized terminology. For example, if "x>y" appears in the requirement data text, it will be replaced and corrected to "x_Greater_Than_y"; similarly, if... It will be replaced with "Right_Arrow".
[0075] Step S12: Perform natural language preprocessing on the data to be analyzed.
[0076] In one embodiment of this application, step S12 includes:
[0077] Step S12-1: Use natural language processing technology to perform part-of-speech tagging on each field contained in the required data.
[0078] In one approach, embodiments of this application may employ the Pennsylvania Treebank to code-annotate English words, assigning each word a corresponding part of speech (POS), such as noun, verb, adjective, etc.
[0079] Step S12-2: Based on the hierarchical segmentation strategy, the requirement data to be analyzed is segmented into multiple requirement data sentence structures;
[0080] Specifically, the hierarchical relationship of the structure is determined by calculating the relative distance to the leftmost base point; that is, the farther away from the base point, the higher the level. The level is directly proportional to the distance from the base point.
[0081] Step S12-3: Based on the part-of-speech tagging of each field contained in each requirement data sentence, perform corresponding association tagging on at least two adjacent fields in each requirement data sentence to obtain multiple sets of field association relationships.
[0082] In one approach, an application can use dependencyRelation(head, dependent) to define a relationship, where dependencyRelation represents the relationship between words, head is called the "dominant word" which represents the word being modified in the relationship, and dependent is the "subordinate word" which is a modifier.
[0083] For example, in a requirement data sentence, if the three adjacent fields are "I and you", then the first field "I" is a noun, the second field "and" is a conjunction, and the third field "you" is a noun. Furthermore, these three fields can form a set of field relationships.
[0084] Understandably, this includes three fields, as well as an association to reflect the part-of-speech relationship between the three fields, namely, first noun - conjunction - second noun.
[0085] Step S13: Obtain the extraction rule set;
[0086] In one embodiment of this application, an STL formula is represented by a prefix expression. According to the extraction rules, the prefix expression tree of the STL formula is obtained from the association tree, and finally the prefix expression is converted into an STL formula (infix expression form).
[0087] Specifically, the symbol ":=" is defined to indicate that the left-hand side of an expression can be replaced by the right-hand side.
[0088] The first type of content extraction is time extraction rules, which correspond to extracting time operators from the demand data text. It mainly extracts by identifying the time pattern word "patternWord" in the association relationship. The extraction result is an action identified by the tense operator, represented as head:=temporalOp(head).
[0089] In one embodiment, this application includes extraction rules for three tense operators: Global, Eventually, and Until. This primarily involves identifying adverbs or phrases related to time attributes within the association relationship to extract the tense operators corresponding to the "actions," i.e., the predicates they connect.
[0090] The second type of content extraction is logical extraction rules, which correspond to extracting logical operators. They mainly identify the types of connectors in dependencyRelation, such as "neg", "conj:and", and "conj:or", to extract logical operators.
[0091] The third type of content extraction is the connector extraction rule, which corresponds to the extraction of comparison operators. When extracting time information from association relationships, this is mainly achieved by identifying the time unit "timeUnit" and the time value "timeNum" within the association relationship. Because tense operators are bound to their corresponding "operation" heads when extracting tense operators, the association chain of head→timeUnit→timeNum allows the tense operators to be mapped to their corresponding time intervals when extracting time information.
[0092] The fourth type of content extraction is noun extraction rules, which correspond to extracting information about the ownership relationship of nouns. For example, in "the value of s", "value" is the information point, and "s" is a modifier of it. The ownership relationship brought by "of" is replaced by a whole word after extraction, and the two words are connected by "_", such as "s_value".
[0093] In one approach, implicit operators are extracted by mining adverbial clauses modified by conditional words such as "if" and "whenever"; other logical operators are extracted using common conjunctions such as "and" and "or". Similarly, comparison operators are extracted from the requirement data, with the "=" operator requiring special handling. Based on common expressions, the extraction rules for the "=" operator are divided into two forms: active and passive, such as "a equals b" and "a is set to b".
[0094] When extracting time information, three cases are considered: the upper boundary ([0,timeNum]), the lower boundary ([timeNum,+∞)) of the extraction time interval, and the simultaneous acquisition of both upper and lower boundaries ([timeNum_1,timeNum_2]). When extracting noun possession relationships, possession relationships represented by the preposition "of" and the possessive "'s" are identified respectively.
[0095] Furthermore, all extracted expressions obtained through the extraction rules in this application need to be combined to obtain a complete STL formula. For this combination, the order of combination is from left to right according to (Dominion_)(=,<,>)(Negation)(Global,Eventually)(Conjunction,Disjunction)(Implication,Until), with the combination priority gradually decreasing. Operators within parentheses have the same combination priority. That is, the combination priority of the Dominion relation is greater than that of newly added binary operators, and then to unary operators; the combination priority of "AND" and "OR" is greater than that of "Implication" and "Until". Time information appears following the timing operator; if no time information is extracted, the default time interval is [0,+∞). In addition, it should be noted that an extracted expression cannot be combined with itself, and if there are no other extracted expressions to combine with at the end, then the expression at this point is the STL parse expression.
[0096] Step S14: Automatically convert the requirement data into a set of temporal logic formulas based on the processing results and extraction rules;
[0097] Specifically, the algorithm preprocesses the input natural language requirement dataset RS using the preprocessing (RS) method, decomposing each "paragraph-level" requirement data text into multiple requirement data sentence patterns, performing error checking and correction on each requirement data sentence pattern, and finally obtaining requirement data sentence patterns that are suitable for subsequent part-of-speech tagging and syntactic analysis.
[0098] Next, the processing and extraction work is carried out on a unit basis for individual requirement data sentences. More specifically, stanfordParser(req) is first called to perform part-of-speech tagging on each field of the requirement data sentence and complete the correlation analysis to obtain multiple sets of field correlation relationships dependencyRel.
[0099] Then, each set of field relationships is used to match a pre-defined extraction rule R. In one approach, this can be achieved using matchRule(R,dr).
[0100] Understandably, if a match is successful, at least one target field in the required data sentence is extracted according to the corresponding extraction rules to obtain an STL formula for representing the target field set, and then added to the STL set.
[0101] Furthermore, after obtaining the STL formula extracted from the requirement data sentence, the field elements contained in these STLs can be extracted one by one and merged into an STL prefix expression according to the merging rules. matchPri(element) checks whether there is an STL property element with higher priority than element in the set STLEle. If not, element is merged into the current STL prefix expression. This process is repeated until all elements in STLEle are merged.
[0102] Finally, the STL prefix expression is converted into an equivalent STL formula and added to the final set of input formulas. This part of the operation corresponds to the preToMid() method in the algorithm.
[0103] Step S15: Use model checking methods to check the consistency of the generated formulas with the required data;
[0104] In one embodiment of this application, step S15 includes:
[0105] Step S15-1: Perform a conjunction operation on the extracted STL formula and convert the conjunction formula into a Büchi automaton;
[0106] Specifically, the satisfiability of a single STL formula can be checked using the method of transforming an equivalent Büchi automaton. However, for multiple STL formulas, each corresponding to different requirement data, checking for inconsistencies among multiple STL formulas is equivalent to checking for inconsistencies between different requirement data. This involves performing a conjunction operation on multiple STL formulas and then converting the conjunctiond STL into a Büchi automaton. This requires searching all acceptable state sets along the paths in the migration system to construct a complete conjunction automaton, i.e., a Büchi automaton.
[0107] Step S15-2: Perform a null check on the automaton;
[0108] Specifically, an empty Büchi automaton is defined as one that contains no acceptable states that can be visited an infinite number of times from the initial state. An automaton's acceptable language is checked to be non-empty if and only if there exists an acceptable state in a cycle. Given a strongly connected component with acceptable states, a cycle through this acceptable state can always be found. A depth-first search algorithm is used to detect the presence of connected components. The `isempty` method is designed to start from each initial state, calling the outer depth-first search algorithm `outerDFS` for each state. If a cycle is found in any of the initial states, `outerDFS` terminates the loop. If no cycle is found in any of the initial states, it returns `False`, indicating that no cycle exists. The `outerDFS` depth-first search recursively searches from the list of already visited states, searching all direct successors not yet visited in the first depth-first search. When it backtracks, if the current state is acceptable, it calls a nested `innerDFS`. When performing a depth-first traversal, InnerDFS recursively searches for each state, starting from the list of states visited during the first and second depth-first traversals.
[0109] Step S15-3: Perform a minimum inconsistency subset check on the conjunction automaton;
[0110] Specifically, Figure 3 The principle of minimum inconsistency subset checking is given. For each STL formula, instead of performing a full permutation of all values, a heuristic check is used. Given a set of inconsistencies S to be checked, its subsets are decomposed. For each subset, an automaton null value check is performed. After obtaining the inconsistent subsets, S is updated. This process is repeated until the minimum inconsistency subset is found.
[0111] Step S16: Obtain feedback information after the inspection and analyze the feedback information;
[0112] Specifically, by checking for null values in the automata and identifying the minimum inconsistent subset, multiple STL formulas are traced back to their corresponding original requirement data. Furthermore, the satisfiability of individual STL formulas is determined using automata theory. A system model is built using a model-checking method to determine if it satisfies a certain property. If not, a counterexample is provided as feedback. It provides an executable path that satisfies the property but not the system model. When the minimum inconsistent subset represents multiple contradictory requirement data, an assumption method is used, followed by a series of calculations to determine if the assumptions are true. The contradictory requirement data is then output, along with detailed solutions. That is, within the minimum inconsistent subset, assuming certain STL formulas are correct, the contradictory requirement data properties are easily determined. Finally, feedback information is output using a keyword-based language, such as "Satisfiable," "Inconsistent," and "Compatible," along with corresponding requirement data and modification suggestions.
[0113] Therefore, by using natural language processing technology and methods for mining the properties of demand data, the signal timing logic formula is output downwards. After consistency checks, the feedback information is output upwards. The entire process is continuously repeated until the demand data reaches a certain processing effect.
[0114] First, the method in this application combines natural language processing techniques with linear temporal logic, proposing a novel approach from natural language to formal language. Second, the method utilizes automata-based model checking techniques to verify the consistency of multiple requirements data properties and provides valuable feedback to requirements data analysts, significantly reducing the workload of relevant personnel and minimizing inconsistencies in requirements data. Finally, the method in this application proposes a framework for mining and consistency checking methods based on the properties of requirements data, making the entire approach more complete and automated.
[0115] This application involves acquiring the requirement data to be analyzed and segmenting it into multiple requirement data sentences using natural language processing (NLP) technology. Multiple fields within each requirement data sentence are labeled with relationships, resulting in multiple sets of field relationships, each containing at least two fields. Based on a pre-defined set of extraction rules, matching extraction rules are determined for each set of field relationships, and at least one target field is extracted from each set of field relationships based on these rules, resulting in a target field set expressed using STL formulas. Based on the target field set, the requirement data fields to be extracted from the requirement data to be analyzed are determined. By applying the technical solution of this application, a complete technical solution for extracting key fields and automatically mining logical properties from requirement data using NLP technology can be achieved. This eliminates the need for manual reading and understanding of large amounts of NLP requirement data. This application, leveraging NLP technology and formal methods, fully automates the mining and analysis of properties in requirement data, quickly identifying errors and inconsistencies, improving the quality of requirement data, and significantly ensuring the timeliness of subsequent business processing.
[0116] Optionally, in another embodiment based on the method described above in this application, obtaining the requirement data to be analyzed includes:
[0117] Obtain initial requirement data and determine the domain to which each field in the initial requirement data belongs;
[0118] Based on the domain to which each field belongs, two adjacent fields in the initial requirement data are pre-processed to obtain the requirement data to be analyzed;
[0119] The preset processing includes:
[0120] If at least two adjacent fields belong to the same domain, then the at least two fields are merged.
[0121] If at least two adjacent fields belong to different fields, the at least two fields are connected by a preset symbol.
[0122] Optionally, in another embodiment based on the method described above in this application, the step of segmenting the demand data to be analyzed into multiple demand data sentence structures using natural language technology includes:
[0123] Part-of-speech tagging is performed on each field in the data to be analyzed;
[0124] Based on the hierarchical segmentation strategy, the required data to be analyzed is segmented into multiple required data sentence structures.
[0125] Optionally, in another embodiment based on the method described above in this application, after dividing the demand data to be analyzed into multiple demand data phrases according to the hierarchical segmentation strategy, the method further includes:
[0126] Based on the part-of-speech tagging corresponding to each field contained in each demand data sentence, the corresponding association relationship tagging is performed on at least two adjacent fields in each demand data sentence to obtain the multiple sets of field association relationships;
[0127] Each set of field associations includes at least two fields, as well as an association relationship that reflects the part-of-speech relationship between the at least two fields.
[0128] Optionally, in another embodiment based on the method described above in this application, after annotating the relationships between at least two adjacent fields in each requirement data sentence to obtain the multiple sets of field relationships, the method further includes:
[0129] Obtain the extraction rule set;
[0130] The extraction rule set includes time extraction rules, logic extraction rules, connector extraction rules, and noun extraction rules.
[0131] Optionally, in another embodiment based on the method described above in this application, after obtaining the extraction rule set, the method further includes:
[0132] Based on the part-of-speech tagging of each field, the part-of-speech type corresponding to each field in each group of field associations is determined sequentially;
[0133] Count the number of each type of part of speech in each group of field associations, and determine the matching extraction rules based on the part of speech type with the highest number of occurrences.
[0134] Based on the corresponding extraction rules, at least one target field is extracted from each group of field relationships to obtain an STL formula for representing the target field set.
[0135] Optionally, in another embodiment based on the method described above in this application, after obtaining the STL formula for characterizing the target field set, the method further includes:
[0136] Perform conjunction operations on STL formulas and convert the conjunction formulas into conjunction automata;
[0137] Perform a null check on the conjunctive automaton; and perform a minimum inconsistency subset check on the conjunctive automaton;
[0138] If the minimum inconsistency subset check is passed, the target field contained in the STL formula is taken as the requirement data field to be extracted from the requirement data to be analyzed.
[0139] Optionally, the method for extracting temporal logic from demand data provided in this application has the following additional technical features:
[0140] Automatically correct spelling and grammar errors in the required data; convert entity words or phrases in specific fields; convert special symbols or arithmetic expressions.
[0141] Additionally, it may include using natural language processing (NLP) techniques to perform part-of-speech tagging on the demand data; using NLP techniques to perform dynamic syntactic analysis on the demand data; and using NLP techniques to perform dependency parsing on the demand data.
[0142] One approach involves defining extraction rules from demand data to temporal logic formulas, including:
[0143] The basic extraction mode is defined according to the four extraction types; the merging rules are defined according to the STL operator priority.
[0144] In one approach, the extraction rule set includes:
[0145] Develop a pattern for extracting temporal operators from demand data;
[0146] Define a pattern for extracting logical operators and comparison operators from the requirements data;
[0147] Develop a model for extracting time information from demand data;
[0148] Develop a pattern for extracting noun ownership relationships from demand data.
[0149] One approach involves defining a pattern for extracting temporal operators from demand data, including:
[0150] Define extraction rules for three timing operators: Global, Eventually, and Until.
[0151] One approach involves defining a pattern for extracting logical operators and comparison operators from demand data, including:
[0152] Define the extraction rules for the four logical operators: Implication, Negation, Conjunction, and Disjunction.
[0153] Define the extraction rules for the three comparison operators =, >, and <.
[0154] One approach involves developing a pattern for extracting time information from demand data, including:
[0155] If the required data only contains the upper boundary of time information, extract the upper boundary of the time interval;
[0156] If the required data only contains the lower boundary of time information, extract the lower boundary of the time interval;
[0157] If the required data contains upper and lower boundaries of time information, extract the double boundaries of the time interval.
[0158] In one approach, the root is obtained as a set of target fields expressed as an STL formula, including:
[0159] Design an automatic generation algorithm to automatically analyze and extract the required data.
[0160] In one approach, a requirement data consistency check is performed on the target field set expressed by the STL formula, including:
[0161] Perform a conjunction operation on the extracted STL formula and convert the conjunction formula into a conjunction automaton;
[0162] Perform a null check on the draw-out automaton;
[0163] Perform a minimum inconsistency subset check on the conjunction automaton.
[0164] In one approach, obtaining feedback information after the inspection and analyzing the feedback information includes:
[0165] Obtain feedback information using the consistency check results;
[0166] Reprocessing feedback that is difficult to judge or contradictory;
[0167] Output straightforward and concise feedback information.
[0168] In one approach, the automatic mining and analysis method for temporal logic in requirement data based on natural language processing (NLP) technology provided in this application eliminates the need for manual reading and understanding of large amounts of natural language requirement data. By leveraging NLP technology and formal methods, it fully automates the mining and analysis of properties within the requirement data, quickly identifying errors and inconsistencies, improving the quality of the requirement data, and significantly ensuring the security and reliability of the software. First, NLP technology is used to parse the original requirement data statements. Through our defined formula extraction rules, the parsed dependency syntax relations are mapped and transformed to obtain the final signal temporal logic formula. Second, model checking technology based on automata principles is used to analyze and check the correctness and consistency of the extracted requirement data properties. Furthermore, a minimum inconsistency subset checking principle is proposed to modify and improve the original requirement data based on the feedback information after the check. Finally, a technical framework combining requirement data property mining and consistency checking is proposed.
[0169] Optionally, in another embodiment of this application, such as Figure 4 As shown, this application also provides a system for extracting temporal logic from demand data. This includes:
[0170] The acquisition module 201 is configured to acquire the demand data to be analyzed and to use natural language processing technology to segment the demand data to be analyzed into multiple demand data sentences.
[0171] The annotation module 202 is configured to annotate the relationships between multiple fields contained in each requirement data sentence, resulting in multiple sets of field relationships, wherein each set of field relationships contains at least two fields;
[0172] The matching module 203 is configured to determine the matching extraction rule for each group of field relationships based on a preset set of extraction rules, and extract at least one target field from each group of field relationships based on the corresponding extraction rule, so as to obtain a set of target fields expressed by STL formula.
[0173] The determination module 204 is configured to perform a requirement data consistency check on the target field set expressed by the STL formula, and determine the temporal logic extraction result of the requirement data based on the check result.
[0174] By applying the technical solution of this application, a complete technical solution for extracting key fields and automatically mining logical properties from natural language processing (NLP) requirement data can be achieved. This eliminates the need for manual reading and understanding of large amounts of NLP requirement data. This application utilizes NLP technology and formal methods to fully automate the mining and analysis of properties in requirement data, quickly identifying errors and inconsistencies, improving the quality of requirement data, and significantly ensuring the timeliness of subsequent business processing.
[0175] In another embodiment of this application, the steps configured to be executed by the acquisition module 202 include:
[0176] Obtain initial requirement data and determine the domain to which each field in the initial requirement data belongs;
[0177] Based on the domain to which each field belongs, two adjacent fields in the initial requirement data are pre-processed to obtain the requirement data to be analyzed;
[0178] The preset processing includes:
[0179] If at least two adjacent fields belong to the same domain, then the at least two fields are merged.
[0180] If at least two adjacent fields belong to different fields, the at least two fields are connected by a preset symbol.
[0181] In another embodiment of this application, the steps configured to be executed by the acquisition module 202 include: performing part-of-speech tagging on each field in the data to be analyzed;
[0182] Based on the hierarchical segmentation strategy, the required data to be analyzed is segmented into multiple required data sentence structures.
[0183] In another embodiment of this application, the steps configured to be executed by the acquisition module 202 include:
[0184] Based on the part-of-speech tagging corresponding to each field contained in each demand data sentence, the corresponding association relationship tagging is performed on at least two adjacent fields in each demand data sentence to obtain the multiple sets of field association relationships;
[0185] Each set of field associations includes at least two fields, as well as an association relationship that reflects the part-of-speech relationship between the at least two fields.
[0186] In another embodiment of this application, the steps configured to be executed by the acquisition module 202 include: acquiring the extraction rule set;
[0187] The extraction rule set includes time extraction rules, logic extraction rules, connector extraction rules, and noun extraction rules.
[0188] In another embodiment of this application, the steps configured to be executed by the acquisition module 202 include: determining the part-of-speech type corresponding to each field in each group of field associations based on the part-of-speech tag of each field;
[0189] Count the number of each type of part of speech in each group of field associations, and determine the matching extraction rules based on the part of speech type with the highest number of occurrences.
[0190] Based on the corresponding extraction rules, at least one target field is extracted from each group of field relationships to obtain an STL formula for representing the target field set.
[0191] In another embodiment of this application, the steps configured to be executed by the acquisition module 202 include: performing a conjunction operation on the STL formula and converting the conjunction formula into a conjunction automaton;
[0192] Perform a null check on the conjunctive automaton; and perform a minimum inconsistency subset check on the conjunctive automaton;
[0193] If the minimum inconsistency subset check is passed, the target field contained in the STL formula is taken as the requirement data field to be extracted from the requirement data to be analyzed.
[0194] This application also provides an electronic device for performing the above-described method for extracting temporal logic from demand data. Please refer to... Figure 5 This illustrates a schematic diagram of an electronic device provided by some embodiments of this application. For example... Figure 5 As shown, the electronic device 5 includes: a processor 300, a memory 301, a bus 302, and a communication interface 303. The processor 300, the communication interface 303, and the memory 301 are connected via the bus 302. The memory 301 stores a computer program that can run on the processor 300. When the processor 300 runs the computer program, it executes the method for extracting temporal logic from demand data provided in any of the foregoing embodiments of this application.
[0195] The memory 301 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this device network element and at least one other network element is achieved through at least one communication interface 303 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network.
[0196] Bus 302 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 301 is used to store programs. After receiving an execution instruction, the processor 300 executes the program. The data recognition method disclosed in any of the foregoing embodiments of this application can be applied to the processor 300, or implemented by the processor 300.
[0197] The processor 300 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 300 or by instructions in software form. The processor 300 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 301. The processor 300 reads the information in memory 301 and, in conjunction with its hardware, completes the steps of the above method.
[0198] The electronic device provided in this application embodiment and the data identification method provided in this application embodiment are based on the same inventive concept and have the same beneficial effects as the methods they adopt, operate or implement.
[0199] This application also provides a computer-readable storage medium corresponding to the data recognition method provided in the foregoing embodiments. Please refer to... Figure 6 The computer-readable storage medium shown is an optical disc 40, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it executes the method for extracting temporal logic from the required data provided in any of the foregoing embodiments.
[0200] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.
[0201] The computer-readable storage medium provided in the above embodiments of this application and the data identification method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0202] It should be noted that:
[0203] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known structures and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0204] Similarly, it should be understood that, for the sake of brevity and to aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of this application, various features of this application are sometimes grouped together in a single embodiment, figure, or description thereof. However, this disclosure should not be construed as reflecting a schematic diagram in which the claimed application requires more features than expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.
[0205] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of this application and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.
[0206] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for extracting temporal logic from demand data, characterized in that, include: Obtain the requirement data to be analyzed, and use natural language processing technology to segment the requirement data into multiple requirement data sentence structures; For each requirement data sentence, the multiple fields contained in it are labeled with their relationships, resulting in multiple sets of field relationships, where each set of field relationships contains at least two fields; Based on a preset set of extraction rules, a matching extraction rule is determined for each group of field relationships, and based on the corresponding extraction rule, at least one target field is extracted from each group of field relationships to obtain a set of target fields expressed in STL formulas. Perform a requirement data consistency check on the target field set expressed by the STL formula, and determine the temporal logic extraction result of the requirement data based on the check result; The step of performing a requirement data consistency check on the target field set expressed by the STL formula, and determining the temporal logic extraction result of the requirement data based on the check result, includes: Perform conjunction operations on STL formulas and convert the conjunction formulas into conjunction automata; Perform a null check on the conjunctive automaton; and perform a minimum inconsistency subset check on the conjunctive automaton; If the minimum inconsistency subset check is passed, the target field contained in the STL formula is taken as the requirement data field to be extracted from the requirement data to be analyzed.
2. The method as described in claim 1, characterized in that, The acquisition of the data to be analyzed includes: Obtain initial requirement data and determine the domain to which each field in the initial requirement data belongs; Based on the domain to which each field belongs, the two adjacent fields in the initial requirement data are pre-processed to obtain the requirement data to be analyzed; The preset processing includes: If at least two adjacent fields belong to the same domain, then the at least two fields are merged. If at least two adjacent fields belong to different fields, the at least two fields are connected by a preset symbol.
3. The method as described in claim 1, characterized in that, The process of segmenting the demand data to be analyzed into multiple demand data sentence structures using natural language processing technology includes: Part-of-speech tagging is performed on each field in the data to be analyzed; Based on the hierarchical segmentation strategy, the required data to be analyzed is segmented into multiple required data sentence structures.
4. The method as described in claim 3, characterized in that, After dividing the required data to be analyzed into multiple required data phrases according to the hierarchical segmentation strategy, the method further includes: Based on the part-of-speech tagging corresponding to each field contained in each demand data sentence, the corresponding association relationship tagging is performed on at least two adjacent fields in each demand data sentence to obtain the multiple sets of field association relationships; Each set of field associations includes at least two fields, as well as an association relationship that reflects the part-of-speech relationship between the at least two fields.
5. The method as described in claim 4, characterized in that, After labeling the relationships between at least two adjacent fields in each requirement data sentence to obtain the multiple sets of field relationships, the method further includes: Obtain the extraction rule set; The extraction rule set includes time extraction rules, logic extraction rules, connector extraction rules, and noun extraction rules.
6. The method as described in claim 5, characterized in that, After obtaining the extraction rule set, the method further includes: Based on the part-of-speech tagging of each field, the part-of-speech type corresponding to each field in each group of field associations is determined sequentially; Count the number of each type of part of speech in each group of field associations, and determine the matching extraction rules based on the part of speech type with the highest number of occurrences. Based on the corresponding extraction rules, at least one target field is extracted from each group of field relationships to obtain an STL formula for representing the target field set.
7. A system for extracting temporal logic from demand data, characterized in that, include: The acquisition module is configured to acquire the requirement data to be analyzed and to use natural language processing technology to segment the requirement data to be analyzed into multiple requirement data sentences; The annotation module is configured to annotate the relationships between multiple fields contained in each requirement data sentence, resulting in multiple sets of field relationships, where each set of field relationships contains at least two fields; The matching module is configured to determine the matching extraction rule for each group of field relationships based on a preset set of extraction rules, and extract at least one target field from each group of field relationships based on the corresponding extraction rule, so as to obtain a set of target fields expressed in STL formula. The determination module is configured to perform a requirement data consistency check on the target field set expressed by the STL formula, and determine the temporal logic extraction result of the requirement data based on the check result; The determining module is specifically configured as follows: Perform conjunction operations on STL formulas and convert the conjunction formulas into conjunction automata; Perform a null check on the conjunctive automaton; and perform a minimum inconsistency subset check on the conjunctive automaton; If the minimum inconsistency subset check is passed, the target field contained in the STL formula is taken as the requirement data field to be extracted from the requirement data to be analyzed.
Citation Information
Patent Citations
Information extraction method and device, equipment and storage medium
CN112269884A
Transaction type function point structured extraction method and system of software requirement document
CN112817561A