Program development auxiliary method, storage medium and device based on AIGC
By building a sensitive word library and a large language model to identify suspected sensitive words, and combining Kafka and Flink tools for real-time auditing, the problem of sensitive information leakage in AIGC model interactions was solved, and data security and program development efficiency were improved.
Patent Information
- Application Number
- CN202310814622.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2043-07-04
AI Technical Summary
In the existing technology, when program developers use the AIGC model, it is difficult to solve problems quickly and accurately, there is a risk of sensitive information leakage, and sensitive information cannot be intercepted in real time.
By building a sensitive word library, using a large language model to identify suspected sensitive words in prompt words, and conducting compliance audits before identifying sensitive words, we control the AIGC model to generate compliance information, and combine Kafka and Flink tools to match and identify suspected sensitive words in real time to prevent information leakage.
It ensures real-time data security during AIGC model interaction, avoids sensitive information leakage, simplifies program development processes, and improves work efficiency.
Smart Images

Figure CN116991990B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology, and in particular relates to a program development auxiliary method, storage medium and device based on AIGC. Background Art
[0002] With the current boom in ChatGPT, various AIGC (AI Generated Content) have also become prevalent. Currently, developers often use search engines to assist in solving problems encountered during program development. However, the answers found in this way often do not match the current needs and cannot quickly and accurately solve the problem.
[0003] With the current boom of ChatGPT, various AIGCs (AI Generated Content) have also developed. Program developers can quickly solve problems by simply entering keywords to accurately match the scenarios encountered in current needs.
[0004] However, current AIGC-based program implementation solutions are prone to content leakage risks. Many current programs only record logs during the user's interaction with the AIGC model and provide post-audit functions. They are unable to intercept sensitive information in real time and may still cause sensitive information leakage problems. Summary of the Invention
[0005] The present application provides an AIGC-based program development assistance method, storage medium, and device for assisting program development based on AIGC and avoiding the leakage of sensitive information during interaction with the AIGC model.
[0006] In a first aspect, an embodiment of the present application provides a program development assistance method based on AIGC, comprising: collecting prompt words input by users into a pre-trained AIGC model; matching the prompt words with a preset sensitive information library to confirm whether the prompt words are compliant; and when confirming that the prompt words are compliant, controlling the AIGC model to generate information that matches the prompt words.
[0007] In one implementation of the first aspect, the method further includes training the AIGC model; training the AIGC model includes: obtaining a prompt word data training set; using an attention mechanism to assign weights to the prompt word training data in the prompt word data training set to form weighted label training data; inputting the weighted label training data into a network model for training to obtain the AIGC model that can generate information matching the prompt word.
[0008] In an implementation of the first aspect, the network model adopts a generative adversarial network model, a variational self-coding network model, a diffusion model or a Transformer neural network model.
[0009] In an implementation of the first aspect, training the AIGC model further includes: prompt word fine-tuning training; the prompt word fine-tuning training includes: obtaining prompt word data from a prompt word data training set; converting the prompt word data into prompt words containing empty slots based on a preset template library; inputting the prompt words containing empty slots and an answer data set into a network model for training, and obtaining the AIGC model that can search for answer data filling the empty slots from the answer data set.
[0010] In an implementation of the first aspect, controlling the AIGC model to generate information matching the prompt word includes: converting the prompt word into a prompt word including an empty slot based on a preset template library; searching, by the AIGC model, for answer data matching the empty slot from an answer data set; mapping the answer data to the corresponding empty slot to form an optimized prompt word; and controlling the AIGC model to generate information matching the optimized prompt word.
[0011] In an implementation of the first aspect, matching the prompt word with a preset sensitive information library to confirm whether the prompt word is compliant includes: inputting the prompt word into a pre-trained large language model, and having the large language model perform text recognition on the prompt word to obtain suspected sensitive words in the prompt word; matching the suspected sensitive words with sensitive words in a sensitive word library, and when there are sensitive words in the sensitive words that match the suspected sensitive words, obtaining the corresponding sensitive words in the sensitive word library and the classification label corresponding to the sensitive words; determining whether the suspected sensitive words in the prompt word are compliant based on the suspected sensitive words, the acquired sensitive words in the sensitive word library, the classification label, and the pre-configured compliance policy, and outputting an audit result of whether they are compliant.
[0012] In an implementation of the first aspect, it also includes any one or more of the following: detecting the program code input by the user, and when an abnormality is detected in the code, issuing an alarm and searching for optimization suggestions; detecting the SQL database corresponding to the program code, and when an abnormality is detected in the SQL database, issuing an alarm and searching for optimization suggestions; generating a test program that executes the corresponding test function based on the test data input by the user.
[0013] In an implementation of the first aspect, the method further includes: collecting log information during the interaction between the user and the AIGC model in real time.
[0014] In a second aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the program development assistance method based on AIGC as described in any one of the first aspects of the present application is implemented.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory storing a computer program; and a processor communicatively connected to the memory, for executing the AIGC-based program development assistance method described in any one of the first aspects of the present application when calling the computer program.
[0016] The AIGC-based program development assistance method provided in this application can help program developers reduce repetitive work and simplify program development work based on the AIGC model, while also avoiding the leakage of sensitive information during the interaction with the AIGC model. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 Shown is a schematic diagram of the application principle of the program development assistance method based on AIGC in one embodiment of the present application.
[0018] Figure 2 Shown is a flowchart of a program development assistance method based on AIGC according to an embodiment of the present application.
[0019] Figure 3 Shown is a flowchart of training an AIGC model in an AIGC-based program development assistance method according to an embodiment of the present application.
[0020] Figure 4 Shown is a schematic diagram of the principle of using the attention mechanism to assign weights to the prompt word training data in the prompt word data training set in the AIGC-based program development assistance method according to one embodiment of the present application.
[0021] Figure 5 Shown is a flowchart of the prompt word fine-tuning training in the program development assistance method based on AIGC according to an embodiment of the present application.
[0022] Figure 6 Shown is a flowchart of controlling the AIGC model to generate information matching the prompt word in the AIGC-based program development assistance method according to an embodiment of the present application.
[0023] Figure 7 Shown is a schematic diagram of the implementation and application of the program development assistance method based on AIGC according to an embodiment of the present application.
[0024] Figure 8 Shown is a schematic diagram of the implementation principle of the program development assistance method based on AIGC according to an embodiment of the present application.
[0025] Figure 9 Shown is a schematic diagram of the implementation process of the program development assistance method based on AIGC according to an embodiment of the present application.
[0026] Figure 10 Shown is a structural schematic diagram of an electronic device in one embodiment of the present application.
[0027] Component number description
[0028] 100 electronic devices
[0029] 101 Memory
[0030] 102 processors
[0031] 103 Display
[0032] Steps S100 to S300
[0033] Steps S310 to S340
[0034] Steps S401 to S403
[0035] Steps S410 to S430 DETAILED DESCRIPTION
[0036] The following describes the embodiments of the present application through specific examples. Those skilled in the art can easily understand the other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0037] The program codes generated by existing technologies have low usability and cannot be used accurately. The user experience is poor and it is impossible to get the desired answer through simple keywords. In addition, it is easy to directly expose the company's sensitive information, causing information security risks.
[0038] The embodiment of the present application provides an AIGC-based program development assistance method for assisting program development based on AIGC and avoiding leakage of sensitive information during interaction with the AIGC model.
[0039] Figure 1 The following is a schematic diagram showing the application principle of the program development assistance method based on AIGC according to an embodiment of the present application. Figure 1As shown, the program development assistance method based on AIGC in this embodiment pre-builds a sensitive word library. Users use the AIGC model to assist in program development, helping program developers reduce repetitive work and simplify program development. In the process of assisting program development based on the AIGC model, keywords are input into the AIGC model, and information communicated between users and the AIGC model is collected through the Kafka tool. The Flink tool provides matching and identification of suspected sensitive words with sensitive words in the sensitive word library at the second level. Determine whether the suspected sensitive words in the prompt words are compliant. If not, prompt the user with risk information. If compliant, call the AIGC model, and the AIGC model generates information matching the prompt words. This embodiment can ensure the security of data input by the user in real time, limit the return of sensitive information, and avoid information leakage.
[0040] The following is a combination of the appended examples of the present application Figure 1 To the attached Figure 10 The technical solutions of the program development assisting method, storage medium, and device based on AIGC in the embodiments of the present application are described in detail, so that those skilled in the art can understand the program development assisting method, storage medium, and device based on AIGC in the embodiments without creative work.
[0041] Figure 2 Shown is a flowchart of the program development assistance method based on AIGC in an embodiment of the present application. Figure 2 As shown, the program development assistance method based on AIGC provided in the embodiment of the present application includes the following steps S100 to S400.
[0042] Step S100, collecting prompt words input by the user into the pre-trained AIGC model;
[0043] Step S200: matching the prompt word with a preset sensitive information database to confirm whether the prompt word is compliant;
[0044] Step S300: When it is confirmed that the prompt word is compliant, the AIGC model is controlled to generate information matching the prompt word.
[0045] The following describes in detail steps S100 to S300 of the program development assistance method based on AIGC in this embodiment.
[0046] Step S100: collecting prompt words input by the user into the pre-trained AIGC model.
[0047] This embodiment assists program development based on the AIGC model, which can help program developers reduce repetitive work and simplify program development work.
[0048] This embodiment encapsulates large paragraphs of text and only exposes the prompt word entrance to the user.
[0049] In this embodiment, the prompt word specification input by the user is predetermined:
[0050] 1) Prompt word format: directly issue instructions or use question-and-answer mode.
[0051] 2) Prompt word elements:
[0052] 2-1) Instructions: Specific tasks or instructions that you want the model to perform.
[0053] 2-2) Context: Contains external information or additional contextual information, which helps the language model respond better.
[0054] 2-3) Input data: content or questions entered by the user.
[0055] 2-4) Output prompt: Specify the output type or format.
[0056] 3) Prompt style:
[0057] 3-1) Precise Instructions: The more precise the instructions and the more detailed the requirements, the more the answers will meet the requirements.
[0058] 3-2) Role prompt: In this application, it is set as: If you are a software development engineer, xxxx.
[0059] 3-3) Zero-sample prompt: directly ask questions without giving any pre-questions.
[0060] 3-4) Single sample prompt: When asking a question, give an example first, and the model will understand based on the given example.
[0061] 3-5) Few-sample prompts: Compared with single-sample prompts, multiple examples are given before asking questions.
[0062] In one implementation of this embodiment, the method further includes training the AIGC model to return information and content that meets user needs. Figure 3 The flowchart of the AIGC model training in the program development auxiliary method based on AIGC in one embodiment of the present application is shown. Figure 3 As shown, training the AIGC model includes:
[0063] Step S410, obtaining a prompt word data training set;
[0064] Step S420: using an attention mechanism to assign weights to the prompt word training data in the prompt word data training set to form weighted label training data.
[0065] Figure 4The figure shows the principle of using the attention mechanism to assign weights to the prompt word training data in the prompt word data training set in the program development assistance method based on AIGC in one embodiment of the present application. The attention mechanism (attention) assigns different weights to the different importance of input data. Its advantage of parallel processing enables it to train on larger data sets, accelerates the development of large pre-trained models such as GPT, and can be used to complete translation between different languages. The main body of the attention mechanism includes Encoder and Decoder, which respectively encode the source language and convert the encoded information into text in the target language.
[0066] Step S430: Input the weight label training data into the network model for training to obtain the AIGC model that can generate information matching the prompt word.
[0067] In this embodiment, the network model adopts but is not limited to a generative adversarial network (GAN) model, a variational self-encoding network model, a diffusion model or a Transformer neural network model.
[0068] In one implementation of this embodiment, training the AIGC model further includes: prompt word fine-tuning training. Prompt word fine-tuning training can improve the accuracy of prompt word recognition and greatly simplify the communication cost during the user-AI interaction process. Figure 5 The flowchart of the prompt word fine-tuning training in the program development auxiliary method based on AIGC in one embodiment of the present application is shown. The prompt word fine-tuning training includes:
[0069] Step S401, obtaining prompt word data in a prompt word data training set;
[0070] Step S402: converting the prompt word data into prompt words containing empty slots based on a preset template library;
[0071] Step S403: Input the prompt word and answer data set containing the empty slots into the network model for training, and obtain the AIGC model that can search for answer data filling the empty slots from the answer data set.
[0072] Specifically, one implementation method for fine-tuning the model in this embodiment is as follows:
[0073] 1) Template Design: Templates are manually or automatically designed to form a preset template library. Input x (e.g., optimizing a sorting algorithm) is transformed into X (e.g., I'm a software developer. Help me write a low-time sorting algorithm ____). Typically, X contains empty slots, which the trained network model fills in to infer y(). The preset template library is designed flexibly and adapts to specific needs. The appropriate template is selected based on the downstream task and pre-trained language model.
[0074] 2) Answer data search: After obtaining X through the template, the trained network model searches the answer dataset to find the most suitable answer data to fill the empty slot. For example, by calculating the matching score, the answer data value with the highest score is found and filled into the corresponding empty slot.
[0075] Answer Mapping: After obtaining the corresponding fill values for empty slots through answer search, the slot values of some tasks are used as the final results, while the slot values of some tasks need to be converted to map the slot values to the final output label y (a low-time-complexity sorting algorithm). This embodiment, through model fine-tuning, can convert the prompt words entered by the user into prompt words that the AIGC model can more easily understand and match the results, effectively improving the accuracy and efficiency of the AIGC prompt words.
[0076] Step S200: Match the prompt word with a pre-set sensitive information database to confirm whether the prompt word is compliant. By conducting a security audit on the prompt word to confirm whether it is compliant, the leakage of sensitive information during the program development process and the interaction with AI can be avoided.
[0077] In one implementation of this embodiment, matching the prompt word with a preset sensitive information database to confirm whether the prompt word is compliant includes:
[0078] 1) Input the prompt word into a pre-trained large language model, and the large language model performs text recognition on the prompt word to obtain suspected sensitive words in the prompt word. Large language model (LLM) refers to a deep learning model trained using a large amount of text data. It can generate natural language text or understand the meaning of language text. It is a natural language processing model with large parameters and complex structure built based on deep learning technology. Large language model can handle a variety of natural language tasks, such as text classification, question answering, dialogue, etc., and is an important path to artificial intelligence.
[0079] In this embodiment, before the prompt word is input into the pre-trained large language model, it also includes preprocessing the text, encoding the preprocessed training set to form encoded text, and then inputting the encoded text into the large language model for text recognition to obtain suspected sensitive words in the prompt word.
[0080] In one possible implementation, the text is preprocessed, including but not limited to removing punctuation marks, stop words and other irrelevant information, and performing operations such as stemming or lemmatization to reduce noise and standardize the text.
[0081] In one possible implementation, the preprocessed training set is encoded to form encoded text. The preprocessed prompt words are converted into an input encoding form acceptable to the model, including but not limited to segmenting the prompt words into words or subwords and mapping them into vector representations. The encoding methods used include but are not limited to word embeddings such as Word2Vec or GloVe, and subword embeddings such as BERT or FastText.
[0082] In one implementation, the method further includes training the large language model; and training the large language model includes:
[0083] 1) Obtain a training set containing sensitive words.
[0084] Among them, the sources of sensitive words in the training set include but are not limited to sensitive words that have passed historical review (such as community dynamics, searches, columns, etc.), sensitive word libraries (sensitive word libraries constructed by manual word expansion, machine learning model generation, etc.), sensitive words entered by users and any one or more combinations of their variants.
[0085] 2) Adding a bypass matrix including a dimensionality reduction matrix and a dimensionality increase matrix to the original open source large language model, using the training set to train the open source large language model and fine-tune and optimize the bypass matrix.
[0086] The large language model itself is a generative language model whose primary goal is to generate natural language responses related to the input, with good semantic understanding capabilities. In this embodiment, the original open source large language models used include but are not limited to ChatGLM, StableVicuna, and other large language models. The large language model in this embodiment is an open source large language model, in which the code and dataset are open source and licensed.
[0087] During the training phase, the open source large language model is trained using a labeled training set and the bypass matrix is fine-tuned and optimized. The training output of the open source large language model and the optimized output of the bypass matrix are then superimposed and output.
[0088] Using a content security-sensitive vocabulary and a historically reviewed dataset, we fine-tuned the parameters of the ChatGLM-6B large language model using LoRA from the HuggingFace peft library. During LoRA implementation, we freeze the matrix parameters of a large language model and replace them with reduced and increased dimensionality matrices. During model training, we only update these matrices.
[0089] In a possible implementation, a random Gaussian distribution is used to initialize the dimension-reduced matrix, and an all-zero matrix is used to initialize the dimension-increased matrix.
[0090] In one possible implementation, the optimization parameters in the bypass matrix include any one or more combinations of loading pre-trained model weights, adding training data, and adjusting hyperparameters of the model.
[0091] During fine-tuning, you can adjust the learning rate, number of training iterations, and other parameters. After fine-tuning, you can evaluate and optimize the performance of the large language model. Use a variety of evaluation metrics to measure the performance of the large language model on specific domain tasks. If the large language model performs poorly, you can further optimize it by adjusting training parameters, increasing the dataset size, or performing more fine-tuning.
[0092] 3) The training output of the open source large language model and the optimized output of the bypass matrix fine-tuning optimization are superimposed and output.
[0093] The specific principles of training a large language model in this embodiment are as follows:
[0094] 1) Add a bypass matrix next to the original large language model, including a dimensionality reduction matrix and a dimensionality increase matrix. By performing a dimensionality reduction and then dimensionality increase operation including the dimensionality reduction matrix and the dimensionality increase matrix, the so-called intrinsic rank is simulated.
[0095] 2) During training, the parameters of the open-source large language model remain unchanged, and only the dimensionality reduction and dimensionality increase matrices are trained. That is, the optimizer only optimizes the parameters of the right path.
[0096] 3) The input and output dimensions of the original large language model remain unchanged. The original large language model and the bypass matrix share the input training set. When outputting, the output of the original large language model and the bypass matrix are superimposed.
[0097] 4) Initialize the reduced-dimensionality matrix with a random Gaussian distribution and the increased-dimensionality matrix with an all-zero matrix. Initializing the increased-dimensionality matrix with all zeros ensures that the bypass matrix results are close to zero during the initial training period. The superimposed output essentially comes from the original large language model, that is, the calculation result of the original parameters of the large language model. This ensures that the starting point of model optimization is consistent with the original large model.
[0098] In this embodiment, the large language model is trained based on sensitive words that have passed historical review, the sensitive word library, sensitive words input by users and their variants, so that the large language model can conduct deep learning and semantic understanding of prompt words, identify sensitive words expressed in variants and metaphors, and input the identified sensitive words into the sensitive words. The sensitive word library can also be regularly updated and maintained according to actual conditions and user feedback to expand the data in the sensitive word library, so as to update and expand the sensitive word library in real time to cope with newly emerging sensitive words.
[0099] The trained large language model is capable of deep learning and semantic understanding of prompt words, accurately identifying variants and metaphorical expressions of sensitive words. The encoded prompt words are input into the large language model for semantic analysis and classification. The trained large language model then performs prompt word recognition on the prompt words, obtaining suspected sensitive words from the prompt words.
[0100] 2) Matching the suspected sensitive word with sensitive words in a sensitive word library. When there is a sensitive word in the sensitive word library that matches the suspected sensitive word, obtaining the corresponding sensitive word in the sensitive word library and the classification label corresponding to the sensitive word.
[0101] In this embodiment, a sensitive word library containing various sensitive words is pre-built. The sensitive word library can be maintained and updated by professionals or specialized institutions specializing in sensitive vocabulary. The sensitive word library should contain various types of sensitive words, such as sensitive words, company core codes, and database table names.
[0102] In this embodiment, the prompt word is analyzed for part of speech and semantics using a large language model, and then matched against a sensitive word library to improve efficiency. The sensitive word library contains various types of sensitive words and their corresponding classification labels.
[0103] In this embodiment, the suspected sensitive words in the prompt words are matched with keywords in the sensitive word library.
[0104] Among them, the string matching algorithm is used to match keywords in the sensitive word library to obtain matching results and part-of-speech tagging results.
[0105] Match the prompt word with the keywords in the sensitive word library. You can use a string matching algorithm, such as the KMP algorithm, to match keywords in the sensitive word library. Traverse each word in the prompt word and compare it with the keywords in the sensitive word library one by one. If a match is found, the prompt word is determined to contain sensitive words.
[0106] 3) Determine whether the suspected sensitive words in the prompt words are compliant based on the suspected sensitive words, the acquired sensitive words in the sensitive word library, the classification labels, and the pre-configured compliance policies, and output an audit result of whether the suspected sensitive words are compliant.
[0107] Specifically, in this embodiment, the pre-configured compliance policy includes any one or a combination of the following:
[0108] 1) Audit rules based on, but not limited to, the number of sensitive word matches, weights of sensitive words, thresholds, and context; audit rules can be regular expressions, pattern matching rules, etc.
[0109] 2) Audit models built based on any one or more machine learning algorithms including, but not limited to, decision trees, random forests, support vector machines, and neural networks.
[0110] The evaluation factors of the audit rules include but are not limited to any one or more combinations of the following:
[0111] 1) Severity and weighting of sensitive words: Different weightings and handling strategies are assigned to different sensitive words. Some sensitive words may pose a greater threat to platform security and user experience and require more stringent handling measures.
[0112] 2) Contextual Analysis and Understanding: Audit decisions must consider the contextual information and language of prompt words provided by the natural language processing module to avoid misjudging legitimate prompt words. Comprehensive judgments are made on prompt words based on semantic relationships and sentiment analysis within the context.
[0113] 3) Threshold Setting: For some metrics, such as the number of sensitive word matches or confidence scores, thresholds are set to determine whether content is considered illegal. Based on user needs and risk tolerance, thresholds can be adjusted to balance false positives and false negatives.
[0114] In this embodiment, the prompt word is judged to be in violation of the rules based on the matching results and the classification information of the sensitive words. Different review levels and handling measures can also be set, such as warning, deletion, and ban.
[0115] In this embodiment, a sensitive information library (e.g., including sensitive words, company core codes, and database table names) needs to be created in advance. For example, the Kafka tool is used to collect information communicated between users and the AIGC model, and the Flink tool provides second-level matching and identification of suspected sensitive words with sensitive words in the sensitive word library. Determine whether the suspected sensitive words in the prompt words are compliant. If not, the user is prompted with risk information. If compliant, the AIGC model is called, and the AIGC model generates information matching the prompt words. This embodiment can ensure the security of data input by the user in real time, limit the return of sensitive information, and avoid information leakage.
[0116] Step S300: When it is confirmed that the prompt word is compliant, the AIGC model is controlled to generate information matching the prompt word.
[0117] Figure 6 A flowchart of controlling the AIGC model to generate information matching the prompt word in the program development assistance method based on AIGC according to one embodiment of the present application is shown. In this embodiment, controlling the AIGC model to generate information matching the prompt word includes:
[0118] Step S310, converting the prompt word into a prompt word containing an empty slot based on a preset template library;
[0119] Step S320: the AIGC model searches for answer data matching the empty slot from the answer data set;
[0120] Step S330: Map the answer data to corresponding empty slots to form optimized prompt words; and control the AIGC model to generate information matching the optimized prompt words.
[0121] Therefore, the trained AIGC model in this embodiment can quickly generate matching information based on the prompt words input by the user, effectively helping program developers reduce repetitive work, improve work efficiency, and simplify program development work.
[0122] In addition, in one implementation of this embodiment, any one or more of the following is also included:
[0123] 1) Detects user-entered program code. When anomalies are detected, an alarm is issued and optimization suggestions are searched. Specifically, by using pre-set coding standards, the system detects non-compliance with user-written code and potential bugs in real time, and provides optimization suggestions.
[0124] 2) Detect the SQL database corresponding to the program code. When an anomaly is detected in the SQL database, an alarm prompt is issued and optimization suggestions are searched for.
[0125] 3) Generate a test program for executing the corresponding test function based on the test data input by the user, wherein the test data includes but is not limited to test variables, test methods, etc.
[0126] In one implementation of this embodiment, the method further includes: collecting log information of the user's interaction with the AIGC model in real time. This embodiment provides a post-audit function through log recording to ensure that sensitive information is not leaked.
[0127] Figure 7Shown is a schematic diagram of the implementation and application of the program development assistance method based on AIGC in one embodiment of the present application. It should be noted that the program development assistance method based on AIGC can be applied to various types of hardware devices in the client part. The hardware device is, for example, a controller, such as an ARM (Advanced RISC Machines) controller, an FPGA (Field Programmable Gate Array) controller, a SoC (System on Chip) controller, a DSP (Digital Signal Processing) controller, or an MCU (Microcontroller Unit) controller, etc. The hardware device can also be, for example, a computer including components such as a memory, a storage controller, one or more processing units (CPUs), a peripheral interface, an RF circuit, an audio circuit, a speaker, a microphone, an input / output (I / O) subsystem, a display, other output or control devices, and external ports; the computer includes but is not limited to personal computers such as desktop computers, laptops, tablet computers, smart phones, smart TVs, and personal digital assistants (PDAs). In other implementations, the hardware device may also be a server, which may be deployed on one or more physical servers based on various factors such as function and load, or may be composed of a distributed or centralized server cluster, which is not limited in this embodiment.
[0128] In one embodiment, the AIGC-based program development assistance method may display a graphical user interface (GUI) on the client's electronic terminal, and display the related AIGC-based program development assistance data in the GUI.
[0129] In one embodiment, the electronic terminal may be a fixed terminal, such as a server, a desktop computer, etc.; or a mobile terminal, such as a notebook computer, a smart phone, or a tablet computer, etc.
[0130] In one embodiment, the electronic terminal may be capable of displaying the program development assistance method data of the AIGC in an offline or online state.
[0131] In one example, the electronic terminal may not be connected to the Internet, and a client APP is installed on it. The customer can log in to the client APP through the pre-registered account information. The client APP can authenticate itself and provide AIGC program development assistance data related to the account information after the authentication is passed; and if there is an update of the program development assistance method data based on AIGC, the customer can update it according to the offline data package. The delivery method of the offline data package includes: for example, on-site update service; or, providing online download of the offline data package, so that the customer can download it through a terminal that can access the Internet, and then update the offline system; or, providing a USB flash drive or mobile hard disk containing the offline data package for update.
[0132] Optionally, the electronic terminal is installed with client software, and the client software of the electronic terminal can generate a graphical user interface (GUI). In addition, the electronic terminal can also have a browser to display the customer service graphical interface; based on the B / S architecture, the hardware and software requirements for the customer's electronic terminal can be greatly reduced. The customer's electronic terminal does not need to install client software, but only needs to have a web browser, which can greatly improve the customer's user experience.
[0133] In an embodiment of the present application, the graphical user interface is entered through a web page browsed by a browser loaded on a user terminal; wherein, the user terminal includes a PC; or the graphical user interface is entered through an interface provided by integrated service platform software loaded on the user terminal; wherein, the user terminal includes a mobile terminal and a PC; the mobile terminal includes a smart phone or a tablet computer; the integrated service platform software includes WeChat and / or Alipay.
[0134] It should be noted that the graphical user interfaces displayed by different types of electronic terminals may also be different.
[0135] Specifically, in some embodiments, if the electronic terminal is a PC terminal, it can browse the web through a loaded browser (including but not limited to IE, Google, 360, QQ, Sogou, Baidu, Maxthon, UC, Firefox, Cheetah, 2345, Opera, etc. browsers), and use the web page as an interface to access a specific web page by accessing a predetermined URL, and display a graphical user interface on the specific web page.
[0136] In some other embodiments, if the electronic terminal is a mobile terminal (such as a smart phone or tablet computer), it can access the graphical user interface through web pages or web applets, or IDE plug-ins in integrated platform software such as WeChat or Alipay.
[0137] The WeChat Mini Program provides an interface for entering the graphical user interface. Users can add the WeChat Mini Program by scanning a QR code or searching for the WeChat Mini Program, and then operate (for example, click) the WeChat Mini Program to enter the graphical user interface. Compared with the interface on the PC, the interface on the mobile terminal can be simpler.
[0138] This embodiment implements the specific functions of the AIGC-based program development assistance method at the business layer, including code prompts, code exception alerts, SOL optimization suggestions, unit test writing, detecting whether user-entered prompt words contain sensitive information and masking sensitive information, logging for security audits, and AIGC model content generation. At the service layer, log monitoring, AIGC model training, and tools such as Flink, ODPS, Kafka, and DataWorks are provided to implement the AIGC-based program development assistance method. For example, MySQL and NebutaGraph databases are used to store data involved in the AIGC-based program development assistance method.
[0139] Figure 8 Shown is a schematic diagram of the implementation principle of the program development assistance method based on AIGC in this embodiment. Figure 9 The diagram shows the implementation process of the program development auxiliary method based on AIGC in this embodiment. Figure 8 and Figure 9 As shown, in this embodiment, in actual application, the program development assistance method based on AIGC generates an application program that implements the program development assistance method based on AIGC through programming. The user uses the application as an AIGC program development assistant. When using it, the user selects the application and enters a prompt word. Then the application verifies the compliance of the content of the prompt word in real time to determine whether the suspected sensitive words in the prompt word entered by the user are compliant. If not, the user is prompted with risk information. If compliant, the AIGC model is called, and the AIGC model performs prompt word feature matching to generate information matching the prompt word, and the content results generated by the AIGC model are displayed to the user.
[0140] The scope of protection of the AIGC-based program development assistance method described in the embodiment of the present application is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, subtracting, or replacing steps in the prior art based on the principles of the present application are included in the scope of protection of the present application.
[0141] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the program development assistance method based on AIGC provided in any embodiment of the present application is implemented.
[0142] In the embodiment of the present application, any combination of one or more storage media can be used. The storage medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by an instruction execution system, device or device or used in combination with it.
[0143] An embodiment of the present application also provides an electronic device. Figure 8 The following is a schematic diagram of the structure of the electronic device 100 provided in an embodiment of the present application. In some embodiments, the electronic device can be a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or other terminal devices. The embodiment of the present application does not impose any restrictions on the specific application scenarios of the program development assistance method based on AIGC.
[0144] like Figure 10 As shown, the electronic device 100 provided in an embodiment of the present application includes a memory 101 and a processor 102 .
[0145] The memory 101 is used to store computer programs; preferably, the memory 101 includes: ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk, etc., various media that can store program codes.
[0146] Specifically, the memory 101 may include a computer system readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory. The electronic device 100 may further include other removable / non-removable, volatile / non-volatile computer system storage media. The memory 101 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0147] The processor 102 is connected to the memory 101 and is used to execute the computer program stored in the memory 101 so that the electronic device 100 executes the program development assistance method based on AIGC provided in any embodiment of the present application.
[0148] Optionally, the processor 102 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0149] Optionally, the electronic device 100 in this embodiment may further include a display 103. The display 103 is communicatively connected to the memory 101 and the processor 102, and is configured to display a GUI interaction interface related to the program development assistance method based on AIGC.
[0150] In summary, the AIGC-based program development assistance method provided by this application not only helps program developers reduce repetitive work and simplify program development based on the AIGC model, but also prevents the leakage of sensitive information during interaction with the AIGC model. Therefore, this application effectively overcomes the shortcomings of the existing technology and has high industrial application value.
[0151] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical concepts disclosed in this application shall be covered by the claims of this application.
Claims
1. A program development assistance method based on AIGC, characterized in that: include: Collect prompt words from user input into the pre-trained AIGC model; Matching the prompt word with a preset sensitive information database to confirm whether the prompt word is compliant; When confirming that the prompt word is compliant, controlling the AIGC model to generate information matching the prompt word; Training the AIGC model includes: Obtain the prompt word data training set; Using an attention mechanism to assign weights to the prompt word training data in the prompt word data training set to form weighted label training data; Inputting the weighted label training data into a network model for training to obtain the AIGC model capable of generating information matching the prompt word; The step of matching the prompt word with a preset sensitive information database to confirm whether the prompt word is compliant includes: Inputting the prompt word into a pre-trained large language model, and having the large language model perform text recognition on the prompt word to obtain suspected sensitive words in the prompt word; Matching the suspected sensitive word with sensitive words in a sensitive word library, and if there is a sensitive word among the sensitive words that matches the suspected sensitive word, obtaining the corresponding sensitive word in the sensitive word library and the classification label corresponding to the sensitive word; Based on the suspected sensitive words, the acquired sensitive words in the sensitive word library, the classification labels and the pre-configured compliance policies, it is determined whether the suspected sensitive words in the prompt words are compliant, and an audit result of whether they are compliant is output.
2. The program development assistance method based on AIGC according to claim 1, characterized in that: The network model adopts a generative adversarial network model, a variational self-coding network model, a diffusion model or a Transformer neural network model.
3. The program development assistance method based on AIGC according to claim 1, characterized in that: Training the AIGC model further includes: prompt word fine-tuning training; the prompt word fine-tuning training includes: Obtain prompt word data from the prompt word data training set; Converting the prompt word data into prompt words containing empty slots based on a preset template library; The prompt words and answer data set containing the empty slots are input into the network model for training to obtain the AIGC model that can search for answer data filling the empty slots from the answer data set.
4. The program development assistance method based on AIGC according to claim 3, characterized in that: The controlling the AIGC model to generate information matching the prompt word includes: Converting the prompt word into a prompt word containing an empty slot based on a preset template library; The AIGC model searches for answer data matching the empty slot from the answer data set; Mapping the answer data to corresponding empty slots to form optimized prompt words; The AIGC model is controlled to generate information matching the optimization prompt word.
5. The program development assistance method based on AIGC according to claim 1, characterized in that: Also includes any one or more of the following: Detect the program code entered by the user. When an anomaly is detected in the code, an alarm will be issued and optimization suggestions will be searched for. Detect the SQL database corresponding to the program code. When anomalies are detected in the SQL database, an alarm will be issued and optimization suggestions will be searched for. Generates a test program that executes the corresponding test function based on the test data input by the user.
6. The program development assistance method based on AIGC according to claim 1, characterized in that: Also includes: Collect log information during the user's interaction with the AIGC model in real time.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the program development assistance method based on AIGC according to any one of claims 1 to 6 is implemented.
8. An electronic device, characterized in that: The electronic device comprises: a memory storing a computer program; A processor is communicatively connected to the memory, and executes the program development assistance method based on AIGC according to any one of claims 1 to 6 when calling the computer program.
Citation Information
Patent Citations
Sensitive information detection method, device, apparatus and system
CN111159354A
Text auditing method, text auditing model, equipment and storage medium
CN112487149A