Safety suggestion generation method and device based on demand content, medium and computer

By automatically identifying key terms and security keywords in the requirements expression information, and combining pre-trained models and a security suggestion library, the system has achieved automated generation of security suggestions for internet healthcare and online financial platforms. This solves the problem of low efficiency in existing technologies and improves the efficiency and accuracy of security reviews.

CN120892015APending Publication Date: 2025-11-04KANG JIAN INFORMATION TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510998954.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

The security review process for internet healthcare platforms and online financial platforms during the requirements review phase relies on manual judgment, which is inefficient and prone to omissions, resulting in incomplete security advice information.

Method used

By automatically identifying key terms and security keywords in the information expressed in the requirements, a pre-trained precaution generation model is used to output security precaution information. Based on text similarity, corresponding security suggestions are matched and recommended in the security suggestion library, thereby realizing the automatic generation and labeling of security suggestions.

Benefits of technology

It significantly improves the efficiency of security reviews, reduces the cost of manual reading and communication, ensures the completeness and accuracy of security recommendations, and enhances the security and operational efficiency of software project development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892015A_ABST
    Figure CN120892015A_ABST
Patent Text Reader

Abstract

The invention discloses a safety suggestion generation method and device based on demand content, a medium and a computer, and relates to the technical field of internet finance and medical treatment. The method comprises the steps of obtaining demand expression information of a to-be-developed software project, and identifying theme vocabularies of the demand expression information and at least one security keyword contained in the demand expression information; inputting the theme vocabularies and the security keywords into a pre-trained matters needing attention generation model to obtain security matters needing attention information output by the matters needing attention generation model; based on the text similarity, determining preset attention matter information matched with the safety attention matter information in a preset safety suggestion library, and determining preset suggestion information stored in a mapping manner with the preset attention matter information as safety suggestion information; and marking the security suggestion information into the demand expression information to obtain a project development file of the to-be-developed software project. According to the method, the efficiency of setting the safety suggestion information for the to-be-developed software project can be remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of internet finance and medical technology, and in particular to a method, apparatus, medium, and computer for generating security suggestions based on demand content. Background Technology

[0002] With the deep integration of mobile internet with healthcare and online finance, the secure development of medical or financial software systems is receiving increasing attention. In the software development lifecycle, the security review during the requirements review phase is a crucial step in identifying potential security risks and proposing security recommendations. This phase requires identifying the risks involved in the software being developed and, based on these risks, proposing security recommendations to establish security advisory information for the software project, ensuring that developers can identify potential security risks at an early stage.

[0003] Currently, in the requirements review process of internet healthcare platforms and online financial platforms, the security review process still relies heavily on manual judgment. Security personnel need to read through the requirements document of the software project to be developed item by item, identify the risks involved, and communicate with the product manager through phone or group chat to confirm the relevant security precautions. The security recommendations corresponding to the security precautions are then set into the project development file of the software project to be developed, so that the developers can carry out project development based on the security recommendations.

[0004] However, this approach is not only inefficient, especially during periods of intensive demand releases, but also prone to incomplete security recommendations due to human oversight, resulting in low efficiency in setting security recommendations for software development projects. Summary of the Invention

[0005] In view of this, this application provides a method, apparatus, medium and computer for generating security recommendations based on requirements, with the main purpose of solving the technical problem of low efficiency in setting security recommendation information for software projects under development.

[0006] According to a first aspect of the present invention, a method for generating security recommendations based on demand content is provided, the method comprising:

[0007] Obtain the requirements expression information of the software project to be developed, and identify the subject vocabulary of the requirements expression information, as well as at least one security keyword contained in the requirements expression information;

[0008] The topic vocabulary and the security keywords are input into a pre-trained precaution generation model to obtain the security precaution information output by the precaution generation model.

[0009] determine preset attention information matching the safety attention information in a preset safety suggestion library based on text similarity, and determine preset suggestion information mapped and stored with the preset attention information as safety suggestion information;

[0010] mark the safety suggestion information into the requirement expression information to obtain a project development file of the software project to be developed.

[0011] According to a second aspect of the present application, a safety suggestion generation device based on requirement content is provided, which comprises:

[0012] a text processing module configured to acquire requirement expression information of a software project to be developed, and identify subject words of the requirement expression information and at least one safety keyword contained in the requirement expression information;

[0013] a model processing module configured to input the subject words and the safety keyword into a pre-trained attention information generation model to obtain safety attention information output by the attention information generation model;

[0014] an information generation module configured to determine preset attention information matching the safety attention information in a preset safety suggestion library based on text similarity, and determine preset suggestion information mapped and stored with the preset attention information as safety suggestion information;

[0015] a result output module configured to mark the safety suggestion information into the requirement expression information to obtain a project development file of the software project to be developed.

[0016] According to a third aspect of the present application, a medium having a computer program stored thereon is provided, the program being executed by a processor to implement the safety suggestion generation method based on requirement content.

[0017] According to a fourth aspect of the present application, a computer is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the program to implement the safety suggestion generation method based on requirement content.

[0018] The application provides a security suggestion generation method and device based on demand content, a medium and a computer, which automatically identifies theme words and security keywords in demand expression information, combines a pre-trained attention note generation model to output corresponding security attention note information, and matches and recommends corresponding security suggestions in a preset security suggestion library based on text similarity, so that the automatic generation and marking of security suggestions are realized. The technical solution provided by the application can effectively solve the problems of dependence on manual work, low efficiency and easy omission of the security review process of medical health software and online financial software in the demand review stage, reduce the cost of manual reading and communication of security personnel on demand documents, significantly improve the security review efficiency, and is especially suitable for development scenarios with intensive demand release. At the same time, through the synergistic effect of the model and the knowledge base, the missed or mistaken judgment of manual judgment is avoided, the efficiency of setting security suggestion information for the software project to be developed is improved, and the operation efficiency of the internet medical health platform and the online financial platform is improved.

[0019] The above description is only a summary of the technical solutions of the application. In order to enable the technical means of the application to be implemented more clearly according to the content of the description, and in order to enable the above and other purposes, characteristics and advantages of the application to be more obvious and easy to understand, the specific embodiments of the application are described below. BRIEF DESCRIPTION OF DRAWINGS

[0020] The drawings described herein are used to provide further understanding of the application, and form a part of the application. The schematic embodiments of the application and the description thereof are used to explain the application, and do not constitute an improper limitation on the application. In the drawings:

[0021] Figure 1 A flowchart of a security suggestion generation method based on demand content provided by an embodiment of the application is shown;

[0022] Figure 2 A flowchart of a theme word recognition method for demand expression information provided by an embodiment of the application is shown;

[0023] Figure 3 A flowchart of a security keyword recognition method for demand expression information provided by an embodiment of the application is shown;

[0024] Figure 4 A structural diagram of a security suggestion generation device based on demand content provided by an embodiment of the application is shown. DETAILED DESCRIPTION

[0025] Hereinafter, the application will be described in detail with reference to the drawings and in combination with the embodiments. It should be noted that the embodiments in the application and the features in the embodiments can be combined with each other without conflict.

[0026] Currently, in the demand review process of the Internet medical health platform and the online financial platform, there are still many problems of relying on manual judgment in the security review process. The security personnel needs to read the demand document of the software project to be developed item by item, identify the risk matters involved therein, and communicate with the product manager through telephone or group chat to confirm the relevant security matters, and set the security suggestions corresponding to the security matters in the project development file of the software project to be developed, so that the developers develop the project based on the security suggestions. However, this way is not only inefficient, especially time-consuming during the demand intensive release period, and is easy to cause incomplete security suggestions due to human negligence, thus resulting in low efficiency of setting security suggestion information for the software project to be developed.

[0027] In view of the above problems, in one embodiment, as shown in Figure 1 a security suggestion generation method based on demand content is provided. Taking the application of the computer device as an example, the method includes the following steps:

[0028] 101、Obtain the demand expression information of the software project to be developed, and identify the subject vocabulary of the demand expression information and at least one security keyword contained in the demand expression information.

[0029] The demand expression information can be the demand document and user story of the software project to be developed. The computer device running the method can connect to the project management tool or demand management system through the Application Programming Interface (API) interface provided by the project management tool or demand management system to obtain the demand expression information.

[0030] Further, the demand expression information can be demand description information (description), which can also include the demand number, submission time of the software project to be developed, and related modules (module) contained in the software project to be developed.

[0031] Specifically, the demand expression information can be text-recognized, and the article subject words of the demand expression information are recognized as subject words by a deep learning method of natural language processing (NLP), such as "login" and the like. Further, the demand expression information can be segmented, and each word contained in the demand expression information is obtained; further, a preset security keyword comparison table containing a plurality of preset security keywords is obtained, and each word is compared with the preset security keywords in the security keyword comparison table. When the word is the same as a preset security keyword, the word is determined as a security keyword, such as "password", "verification" and the like.

[0032] 102. Input the topic terms and the security keywords into the pre-trained precaution generation model to obtain the security precaution information output by the precaution generation model.

[0033] Here, the notice generation model can be a pre-trained large language model. Furthermore, the training method for the notice generation model can be as follows: First, acquire multiple model input data and the label information for each model input data. Each model input data includes a historical topic term and a historical safety keyword, and the label information can be pre-set safety notice information. Then, train the notice generation model based on each model input data and its label information to obtain a model capable of outputting safety notice information corresponding to the topic term and safety keyword. Furthermore, the model's foundation can be optimized simultaneously during training to improve its inference efficiency.

[0034] 103. Based on text similarity, determine the preset precaution information that matches the security precaution information in the preset security suggestion library, and determine the preset suggestion information that is mapped and stored with the preset precaution information as the security suggestion information.

[0035] The security advice library can be pre-configured with multiple preset precautions and corresponding preset advice for each. In actual work, problems encountered can be summarized, and each problem can be configured with a preset precaution. For each problem, preset advice is generated based on its solution and precautions. Furthermore, each preset advice and each preset precaution is aggregated to form the security advice library.

[0036] Specifically, the text vectors of the safety precautions information and the corresponding text vectors for each preset safety precaution in the safety advice library can be calculated. Here, deep learning methods based on word embeddings can be used to vectorize the safety precautions information and the preset safety precautions information into text vectors. For example, the Word2Vec model can be used to calculate the text vectors of the safety precautions information and the corresponding text vectors for each preset safety precaution.

[0037] Furthermore, the cosine similarity between the precaution text vector and each reference text vector is determined, and the highest cosine similarity is identified. Then, the preset precaution information of the reference text vector corresponding to the highest cosine similarity is identified as the target preset precaution information, and the preset suggestion information corresponding to the target preset precaution information is identified as the safety suggestion information.

[0038] 104. Mark the security recommendation information into the requirement expression information to obtain the project development document of the software project to be developed.

[0039] Specifically, security recommendations can be marked with security keywords in the requirements expression information to obtain project development documents.

[0040] The security recommendation generation method based on requirements provided in this embodiment can effectively solve the problems of reliance on manual processes, low efficiency, and easy omissions in the security review process of medical and health software and online financial software during the requirements review stage. It reduces the cost for security personnel to manually read and communicate each line of the requirements document, significantly improves the efficiency of security review, and is especially suitable for development scenarios with intensive requirements release, effectively improving the efficiency of setting security recommendation information for software projects under development.

[0041] In an optional embodiment, such as Figure 2 As shown, the subject vocabulary for identifying the information expressing the demand includes:

[0042] 201. The requirement expression information is processed in a structured manner to obtain a structured text file, and multiple semantic units are extracted from the structured text file.

[0043] The semantic units include titles and sentences. Natural Language Processing (NLP) techniques can be used to process the requirement information, transforming it into structured data for easier computer parsing and processing. Specifically, firstly, the text can be broken down into basic units through word segmentation and part-of-speech tagging to identify parts of speech such as nouns and verbs. Then, dependency parsing is used to determine the grammatical relationships between words and construct sentence structures. Next, key information is extracted, such as entity recognition (method names, program domain names, such as "password," "user," etc.) and relation extraction (such as the relationship between event subjects and behaviors). Semantic understanding can also be achieved using pre-trained models (such as BERT) to extract semantic features from the text. Finally, the extracted information is stored in a structured form, such as JSON, XML, or relational database tables, realizing the transformation of text from unstructured to structured, facilitating subsequent querying, analysis, and application.

[0044] Furthermore, after converting unstructured demand information into structured text files, the structured text files can be segmented according to sentence terminators such as periods, question marks, and exclamation marks to obtain multiple sentences as semantic units; and the file title can be extracted as a semantic unit. Here, Natural Language Processing (NLP) techniques can also be used, employing tools such as spaCy for sentence boundary detection and segmentation to obtain each semantic unit.

[0045] 202, determine a semantic unit vector of each semantic unit, and determine a text vector of the structured text file based on all the semantic unit vectors.

[0046] Specifically, the semantic unit vector of each semantic unit is calculated by the Word2Vec model, and the text vector of the structured text file is obtained by adding the semantic unit vectors of each semantic unit and dividing by the number of semantic units.

[0047] 203, compare the text vector with a plurality of theme word vectors in a preset theme word table.

[0048] The theme word table includes a plurality of preset theme words and a theme word vector corresponding to each preset theme word. The preset theme words included in the theme word table can be determined according to actual conditions, and the theme word vectors are obtained by vectorizing the preset theme words. Specifically, the text vector can be compared with each theme word vector to determine the cosine similarity between the text vector and each theme word vector.

[0049] 204, determine a theme word vector that satisfies a preset first similarity threshold with the text vector, and determine the preset theme word corresponding to the theme word vector as the theme vocabulary.

[0050] The value of the first similarity threshold can be determined according to actual conditions. Specifically, if the cosine similarity between a certain theme word vector and the text vector is greater than the first similarity threshold, the preset theme word corresponding to the theme word vector is determined as the theme vocabulary; if the cosine similarity between multiple theme word vectors and the text vector is greater than the first similarity threshold, the preset theme word corresponding to the theme word vector with the highest cosine similarity is determined as the theme vocabulary.

[0051] The embodiments provided in the present application can determine the theme word that can represent the theme of the demand expression information by combining the theme of the demand expression information and the context information of the document, thereby improving the relevance of the obtained suggestion and the demand expression information.

[0052] In an optional embodiment, the manner of determining the semantic unit vector of each semantic unit includes: first, determining whether the sentence is a first sentence of a paragraph or a last sentence of a paragraph, and determining the sentence as a high-weight sentence when the sentence is the first sentence of the paragraph or the last sentence of the paragraph, and determining other sentences except the high-weight sentence as ordinary-weight sentences. Specifically, whether the sentence is the first sentence of the paragraph arranged at the beginning of the paragraph or the last sentence of the paragraph arranged at the end of the paragraph can be determined according to the position of the decomposed sentence in the paragraph of the original text, and the first sentence of the paragraph arranged at the beginning of the paragraph and the last sentence of the paragraph arranged at the end of the paragraph are determined as high-weight sentences. Further, all sentences except the high-weight sentences are determined as ordinary-weight sentences.

[0053] Then, the title vector and the sentence vector of each sentence are determined. The title vector is adjusted based on a preset first weight coefficient to obtain a title weight vector. The sentence vectors corresponding to high-weight sentences are adjusted based on a preset second weight coefficient to obtain sentence weight vectors. The sentence vectors corresponding to ordinary-weight sentences are adjusted based on a preset third weight coefficient to obtain ordinary sentence vectors. The first weight coefficient is higher than the second weight coefficient, and the second weight coefficient is higher than the third weight coefficient. Their specific values ​​can be determined according to actual conditions. The sum of all the first, second, and third weight coefficients can be 1. Here, the title vector and the sentence vector of each sentence can be calculated using the Word2Vec model, and higher weights are assigned to the title vector and the sentence vectors corresponding to high-weight sentences.

[0054] Specifically, for each high-weight sentence, the sentence vector of the high-weight sentence can be multiplied by the second weight coefficient to obtain the sentence weight vector of each high-weight sentence; for each ordinary-weight sentence, the sentence vector of the ordinary-weight sentence can be multiplied by the third weight coefficient to obtain the ordinary sentence vector of each ordinary-weight sentence; and the title vector can be multiplied by the first weight coefficient to obtain the title weight vector of the title vector.

[0055] Furthermore, determining the text vector of the structured text file based on all the semantic unit vectors includes: determining the text vector of the structured text file based on the title weight vector, the sentence weight vector, and the ordinary sentence vector. Specifically, all sentence weight vectors, all ordinary sentence vectors, and the title weight vector can be added together, and the result can be divided by the sum of all weight coefficients to obtain the text vector.

[0056] The embodiments provided in this application can quickly calculate the text vector of a structured text file by combining the importance of the title and each sentence with the weight coefficients used as weight values, thereby improving the efficiency and relevance of generating security recommendations.

[0057] In an optional embodiment, such as Figure 3 As shown, the method for identifying security keywords contained in the demand expression information includes:

[0058] 301. Perform word segmentation on the structured text file to obtain multiple text words, and determine the text word vector of each text word.

[0059] Specifically, the structured text file can be segmented by using a natural language processing library such as NLTK (Natural Language Toolkit) or a professional segmentation tool such as Stanford NLP, to obtain a plurality of text words. Further, a text word vector of each text word can be determined by using a Word2Vec model.

[0060] 302, respectively determine the cosine similarity between any two text word vectors, and divide the text word vectors whose cosine similarity meets a preset similar word division threshold into a text word group.

[0061] Specifically, the cosine similarity between a text word vector and each of the other text word vectors can be calculated, and then the cosine similarity between any two text word vectors can be calculated. Further, if the cosine similarity between any two text word vectors in a plurality of text word vectors is higher than the similar word division threshold, it can be indicated that the semantics of the text words corresponding to these text word vectors are similar, and these text word vectors can be divided into a text word group.

[0062] Here, the number of text word vectors in each text word group can be determined, and if the number of text word vectors in a text word group is less than a preset number, the text word group can be deleted.

[0063] 303, determine the word vector mean of all text word vectors in each text word group, and compare the word vector mean with a plurality of safe word vectors in a preset safe word table.

[0064] The safe word table includes a plurality of preset safe words and a safe word vector corresponding to each preset safe word. Here, the preset safe words are vectorized to obtain the safe word vector corresponding to the preset safe word.

[0065] Specifically, for each text word group, each text word vector in the text word group can be added and averaged to obtain the word vector mean of the text word group. Further, for each word vector mean, the cosine similarity between the word vector mean and each safe word vector in the safe word table can be determined. Further, the cosine similarity between all word vector means and each safe word vector can be determined.

[0066] 304, determine the safe word vector whose similarity to the word vector mean meets a preset second similarity threshold, and determine the preset safe word corresponding to the safe word vector as the security keyword.

[0067] Specifically, if the cosine similarity between a word vector mean and a safety word vector is higher than a second similarity threshold, a preset safety word corresponding to the safety word vector is determined as a safety keyword. The embodiments provided in the present application can first converge the similar text words in the structured text file, and determine the safety keyword based on the word vector of the converged text words, so as to reduce the calculation amount when determining the safety keyword from the safety word table and improve the efficiency of determining the safety keyword.

[0068] In an optional embodiment, the inputting of the theme words and the safety keywords into the pre-trained safety notice generation model to obtain the safety notice information output by the safety notice generation model comprises:

[0069] Firstly, the theme words and the safety keywords are divided into a plurality of word input groups. Each word input group contains the theme words and a safety keyword, and each word input group contains different safety keywords.

[0070] Then, each word input group is input into the safety notice generation model respectively to obtain the safety notice information corresponding to each word input group output by the safety notice generation model.

[0071] Here, after the safety suggestion is generated, the safety notice generation model can be dynamically fed back and optimized according to the occurrence of the actual safety problem, so as to significantly improve the recognition accuracy of the model for the safety problem and the effectiveness of the safety suggestion, and enable the optimized model to generate more forward-looking and instructive safety suggestions, thereby providing more accurate safety protection suggestions for the user. The embodiments provided in the present application can generate a plurality of safety suggestion information when the safety keywords of the demand expression information are multiple, thereby improving the comprehensiveness of the safety suggestion.

[0072] In an optional embodiment, the safety suggestion library contains a plurality of preset safety notice information, a corresponding contrast text vector of each preset safety notice information, and the preset suggestion information stored in correspondence with the preset safety notice information. The contrast text vector can be a text vector of the preset safety notice information, and the preset suggestion information is a suggestion proposed for the preset safety notice information.

[0073] Further, the method of determining the preset safety notice information matching the safety notice information in the preset safety suggestion library based on the text similarity and determining the preset suggestion information stored in correspondence with the preset safety notice information as the safety suggestion information comprises:

[0074] Firstly, a caution text vector of the safety caution information is determined, and a cosine similarity between the caution text vector and each of the control text vectors in the safety suggestion library is calculated. Here, the caution text vector of the safety caution information can be calculated by a Word2Vec model, and then the cosine similarity between the caution text vector and each of the control text vectors in the safety suggestion library can be determined.

[0075] Then, the control text vector with the highest cosine similarity with the caution text vector is determined, and the preset suggestion information corresponding to the control text vector is determined as the safety suggestion information. Here, the calculated cosine similarities can be arranged in descending order, and the preset suggestion information corresponding to the control text vector arranged in the first position is determined as the safety suggestion information.

[0076] The embodiments provided in the application can quickly determine the preset caution information most similar to the caution information, and the preset suggestion information capable of solving the preset caution information is determined as the safety suggestion information, thereby improving the relevance of the safety suggestion information and the caution information.

[0077] In an optional embodiment, after the safety suggestion information is marked in the requirement expression information to obtain the project development file of the to-be-developed software project, the method further includes:

[0078] Firstly, a program code module marked with the safety suggestion information is acquired from a remote host computer, and preset input verification information and preset return information corresponding to the safety suggestion information are acquired.

[0079] The host computer can be a server or a system storing a written program code module. In an actual development process, if a program code module is developed for a safety suggestion information, the safety suggestion information can be marked in the program code module.

[0080] The program code module can be a program code developed for the project development file marked with the safety suggestion information, the preset input verification information can be input information of the program code module, and the preset return information can be information output by the program code module based on the preset input verification information when the safety suggestion of the program code module is implemented in the code.

[0081] As an example, if the safety suggestion information is "pay attention to malicious input filtering or interception", the preset input verification information can be "construct an attack Payload", and the preset return information can be "return an error (such as HTTP 400)".

[0082] Then, the input verification information is injected into an input interface of the program code module, and return information output by an output interface of the program code module is obtained;

[0083] Finally, it is determined whether the return information is the same as the preset return information, and when the return information is not the same as the preset return information, a safety warning information is sent to the host computer.

[0084] For example, if the program code module receives "construct attack Payload" and outputs "return error (such as HTTP 400)", it indicates that the security suggestion marked in the project development file has been implemented in the code. If the program code module receives "construct attack Payload" and outputs "return error (such as HTTP 400)", it indicates that the security suggestion marked in the project development file has not been implemented in the code, and at this time, a safety warning information can be sent to the host computer.

[0085] The embodiments provided in the application can verify whether the security suggestions marked in the requirement document have been implemented in the code during the development process or the code review stage. If it is found that some security suggestions have not been implemented, the system will remind the developer to supplement the relevant security measures, thereby ensuring the security of the final product.

[0086] The security suggestion generation method based on requirement content provided in the embodiment can automatically identify the subject words and security keywords in the requirement expression information, combine the pre-trained attention matters generation model to output the corresponding security attention matter information, and then match and recommend the corresponding security suggestion in the preset security suggestion library based on the text similarity, thereby realizing the automatic generation and marking of the security suggestion. It can effectively solve the problems existing in the requirement review stage of medical health software and online financial software, such as dependence on manual security review process, low efficiency, and easy omission, effectively reducing the cost of manual reading and communication of security personnel on the requirement document, and significantly improving the security review efficiency.

[0087] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the application are all information and data authorized by the user or authorized by all parties. In addition, the reference signs corresponding to the steps in the above embodiments only play a role in identification, and do not limit the execution order of the steps, and the execution order of the steps in each embodiment can be set according to the actual situation.

[0088] Further, as Figure 1 , Figure 2 and Figure 3In a specific implementation of the method, the embodiment provides a security suggestion generation device based on demand content, as shown in the figure Figure 4 The device includes a text processing module 41, a model processing module 42, an information generation module 43, and a result output module 44.

[0089] The text processing module 41 can be used to obtain demand expression information of a software project to be developed, identify topic words of the demand expression information, and identify at least one security keyword contained in the demand expression information.

[0090] The model processing module 42 can be used to input the topic words and the security keyword into a pre-trained security suggestion generation model to obtain security attention information output by the security suggestion generation model.

[0091] The information generation module 43 can be used to determine preset attention information matching the security attention information in a preset security suggestion library based on text similarity, and determine preset suggestion information mapped with the preset attention information as security suggestion information.

[0092] The result output module 44 can be used to mark the security suggestion information into the demand expression information to obtain a project development file of the software project to be developed.

[0093] In a specific application scenario, the text processing module 41 can be specifically used to perform structured processing on the demand expression information to obtain a structured text file, extract a plurality of semantic units in the structured text file, wherein the semantic units include titles and sentences, determine a semantic unit vector of each semantic unit, and determine a text vector of the structured text file based on all the semantic unit vectors. The text vector is compared with a plurality of topic word vectors in a preset topic word table, wherein the topic word table contains a plurality of preset topic words and a topic word vector corresponding to each preset topic word. A topic word vector satisfying a preset first similarity threshold with the text vector is determined, and a preset topic word corresponding to the topic word vector is determined as the topic word.

[0094] In a specific application scenario, the text processing module 41 can be further configured to determine whether the sentence is a first sentence of a paragraph or a last sentence of a paragraph, determine the sentence as a high-weight sentence when the sentence is the first sentence of the paragraph or the last sentence of the paragraph, and determine other sentences except the high-weight sentence as normal-weight sentences; determine a title vector of the title and a sentence vector of each of the sentences, adjust the title vector based on a preset first weight coefficient to obtain a title weight vector, adjust the sentence vector corresponding to the high-weight sentence based on a preset second weight coefficient to obtain a sentence weight vector, and adjust the sentence vector corresponding to the normal-weight sentence based on a preset third weight coefficient to obtain a normal sentence vector, wherein the first weight coefficient is higher than the second weight coefficient, and the second weight coefficient is higher than the third weight coefficient.

[0095] In a specific application scenario, the text processing module 41 can be further configured to determine a text vector of the structured text file based on the title weight vector, the sentence weight vector, and the normal sentence vector.

[0096] In a specific application scenario, the text processing module 41 can be further configured to perform word segmentation processing on the structured text file to obtain a plurality of text words, and determine a text word vector of each of the text words.

[0097] Cosine similarities between any two of the text word vectors are respectively determined, and text word vectors with a cosine similarity satisfying a preset similar word division threshold are divided into a text word group; a word vector mean of all text word vectors in each of the text word groups is determined, and the word vector mean is compared with a plurality of safe word vectors in a preset safe word table, wherein the safe word table includes a plurality of preset safe words and a safe word vector corresponding to each of the preset safe words; a safe word vector with a similarity to the word vector mean satisfying a preset second similarity threshold is determined, and a preset safe word corresponding to the safe word vector is determined as the security keyword.

[0098] In a specific application scenario, the model processing module 42 can be configured to divide the theme word and the plurality of security keywords into a plurality of word input groups, wherein each of the word input groups includes the theme word and one security keyword, and each of the word input groups includes a different security keyword; each of the word input groups is input into the attention item generation model to obtain security attention item information corresponding to each of the word input groups output by the attention item generation model.

[0099] In a specific application scenario, the security suggestion library includes a plurality of preset precautions information, each of which corresponds to a comparison text vector and the preset suggestion information stored in the mapping of the preset precautions information. The information generation module 43 can be specifically used to determine the precautions text vector of the security precautions information, and calculate the cosine similarity between the precautions text vector and each comparison text vector in the security suggestion library. The comparison text vector with the highest cosine similarity with the precautions text vector is determined, and the preset suggestion information corresponding to the comparison text vector is determined as the security suggestion information.

[0100] In a specific application scenario, the result output module 44 can be specifically used to obtain a program code module marked with the security suggestion information from a remote host computer, and obtain preset input verification information and preset return information corresponding to the security suggestion information. The input verification information is injected into the input interface of the program code module, and the return information output by the output interface of the program code module is obtained. It is determined whether the return information is the same as the preset return information. When the return information is different from the preset return information, a security alarm information is sent to the host computer.

[0101] It should be noted that other corresponding descriptions of the various functional units involved in the security suggestion generation device based on the demand content provided in the present embodiment can be referred to the corresponding descriptions in Figure 1 、 Figure 2 and Figure 3 , which will not be repeated here.

[0102] Based on the above method as shown in Figure 1 、 Figure 2 and Figure 3 , accordingly, the present embodiment also provides a medium, which is a storage medium, and has a computer program stored thereon. The program is executed by a processor to implement the above-mentioned security suggestion generation method based on the demand content as shown in Figure 1 、 Figure 2 and Figure 3 .

[0103] Based on such understanding, the technical solution of the present application can be embodied in the form of a software product. The to-be-identified software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.), and includes a plurality of instructions for causing a computer (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present application.

[0104] Based on the above method as shown in Figure 1 、 Figure 2 and Figure 3The method shown, and Figure 4 In order to achieve the above-mentioned purpose, the demand content-based security suggestion generation device embodiment shown also provides a demand content-based security suggestion generation computer, which can be a personal computer, a server, a smart phone, a tablet computer, a smart watch, or other network devices, etc., which includes a storage medium and a processor; the storage medium is used to store a computer program and an operating system; the processor is used to execute the computer program to realize the above-mentioned Figures 1 to 3 The method shown.

[0105] Optionally, the computer can also include an internal memory, a communication interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, a display, an input device such as a keyboard, etc. Optionally, the communication interface can also include a USB interface, a card reader interface, etc. The network interface can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0106] Those skilled in the art can understand that the computer structure provided by the embodiment for operation action recognition does not constitute a limitation on the computer, and can include more or fewer components, or combine certain components, or different component arrangements.

[0107] The storage medium can also include an operating system and a network communication module. The operating system is a program for managing the above-mentioned computer hardware and the software to be identified, supporting the running of information processing programs and other software and / or programs to be identified. The network communication module is used to realize the communication between the components in the storage medium, and the communication with other hardware and software in the information processing computer.

[0108] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software with a necessary general hardware platform, or by hardware. By applying the technical solutions of the present application, first, the requirement expression information of the software project to be developed is acquired, and the subject vocabulary of the requirement expression information and at least one safety keyword contained in the requirement expression information are identified; then, the subject vocabulary and the safety keyword are input into the pre-trained safety precautions generation model to obtain safety precautions information output by the safety precautions generation model; then, based on the text similarity, the preset precautions information matching the safety precautions information is determined in the preset safety suggestion library, and the preset suggestion information mapped and stored with the preset precautions information is determined as safety suggestion information; finally, the safety suggestion information is marked into the requirement expression information to obtain the project development file of the software project to be developed. Compared with the prior art, the efficiency of setting safety suggestion information for the software project to be developed can be significantly improved.

[0109] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or flows in the drawings are not necessarily essential for implementing the present application. Those skilled in the art can understand that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the description of the implementation scenario, or can be changed and located in one or more devices different from the implementation scenario. The modules of the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0110] The above application numbers are only for description, and do not represent the advantages and disadvantages of the implementation scenario. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any changes that those skilled in the art can think of should fall within the protection scope of the present application.

Claims

1. A method for generating security recommendations based on demand content, characterized in that, The method includes: Obtain the requirements expression information of the software project to be developed, and identify the subject vocabulary of the requirements expression information, as well as at least one security keyword contained in the requirements expression information; The topic vocabulary and the security keywords are input into a pre-trained precaution generation model to obtain the security precaution information output by the precaution generation model. Based on text similarity, preset precaution information that matches the security precaution information is determined in a preset security suggestion library, and preset suggestion information that is mapped and stored with the preset precaution information is determined as security suggestion information; The security recommendation information is marked into the requirement expression information to obtain the project development document of the software project to be developed.

2. The method according to claim 1, characterized in that, The topic vocabulary for identifying the demand expression information includes: The requirement expression information is processed in a structured manner to obtain a structured text file, and multiple semantic units are extracted from the structured text file, wherein the semantic units include titles and sentences; Determine the semantic unit vector for each semantic unit, and based on all the semantic unit vectors, determine the text vector of the structured text file; The text vector is compared with multiple topic word vectors in a preset topic word list, wherein the topic word list contains multiple preset topic words and topic word vectors corresponding to each preset topic word; Determine the topic word vector whose similarity to the text vector meets a preset first similarity threshold, and determine the preset topic word corresponding to the topic word vector as the topic vocabulary.

3. The method according to claim 2, characterized in that, The determination of the semantic unit vector for each semantic unit includes: Determine whether the sentence is the first or last sentence of a paragraph. If the sentence is the first or last sentence of a paragraph, the sentence is designated as a high-weight sentence, and all other sentences are designated as ordinary-weight sentences. The title vector and sentence vector of each sentence are determined. The title vector is adjusted based on a preset first weight coefficient to obtain a title weight vector. The sentence vectors corresponding to the high-weight sentences are adjusted based on a preset second weight coefficient to obtain sentence weight vectors. The sentence vectors corresponding to the ordinary-weight sentences are adjusted based on a preset third weight coefficient to obtain ordinary sentence vectors. The first weight coefficient is higher than the second weight coefficient, and the second weight coefficient is higher than the third weight coefficient. Determining the text vector of the structured text file based on all the semantic unit vectors includes: The text vector of the structured text file is determined based on the title weight vector, the sentence weight vector, and the ordinary sentence vector.

4. The method according to claim 2 or 3, characterized in that, The identification of at least one security keyword contained in the demand expression information includes: The structured text file is segmented to obtain multiple text words, and the text word vector of each text word is determined. Determine the cosine similarity between any two text word vectors, and classify text word vectors whose cosine similarity satisfies a preset similarity word segmentation threshold into a text word group; The average word vector of all text word vectors in each text vocabulary group is determined, and the average word vector is compared with multiple safe word vectors in a preset safe word list, wherein the safe word list contains multiple preset safe words and a safe word vector corresponding to each preset safe word; Determine safe word vectors whose similarity to the mean of the word vectors meets a preset second similarity threshold, and determine the preset safe words corresponding to the safe word vectors as the safe keywords.

5. The method according to claim 1, characterized in that, The step of inputting the topic terms and the security keywords into a pre-trained precaution generation model to obtain the security precaution information output by the precaution generation model includes: The topic vocabulary and the multiple security keywords are divided into multiple vocabulary input groups, wherein each vocabulary input group contains the topic vocabulary and a security keyword, and each vocabulary input group contains different security keywords; Each of the vocabulary input groups is input into the precaution generation model to obtain the safety precaution information corresponding to each of the vocabulary input groups output by the precaution generation model.

6. The method according to claim 1, characterized in that, The security advice library contains multiple preset precautions, a corresponding text vector for each preset precaution, and preset advice information that is mapped and stored with the preset precautions. The step of determining preset precaution information that matches the security precaution information in a preset security advice library based on text similarity, and determining the preset advice information mapped and stored with the preset precaution information as security advice information, includes: Determine the text vector of the safety precaution information, and calculate the cosine similarity between the text vector of the safety precaution and each of the reference text vectors in the safety advice library; The reference text vector with the highest cosine similarity to the mentioned precaution text vector is determined, and the preset suggestion information corresponding to the reference text vector is determined as the safety suggestion information.

7. The method according to claim 1, characterized in that, After marking the security recommendation information into the requirement expression information to obtain the project development documents for the software project to be developed, the method further includes: Obtain the program code module marked with the security suggestion information from the remote host computer, and obtain the preset input verification information and preset return information corresponding to the security suggestion information; The input verification information is injected into the input interface of the program code module, and the return information output by the output interface of the program code module is obtained. Determine whether the returned information is the same as the preset returned information. If the returned information is different from the preset returned information, issue a security alarm message to the host computer.

8. A security suggestion generation device based on demand content, characterized in that, The device includes: The text processing module is used to obtain the requirement expression information of the software project to be developed, and to identify the topic words of the requirement expression information, as well as at least one security keyword contained in the requirement expression information; The model processing module is used to input the topic vocabulary and the security keywords into a pre-trained precaution generation model to obtain the security precaution information output by the precaution generation model. The information generation module is used to determine, based on text similarity, preset precaution information that matches the security precaution information in a preset security suggestion library, and determine the preset suggestion information that is mapped and stored with the preset precaution information as security suggestion information; The result output module is used to mark the security suggestion information into the requirement expression information to obtain the project development documents of the software project to be developed.

9. A medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.