Code detection method and device, equipment, storage medium and product
By extracting the requirements keywords in the requirements task and the annotated keywords in the code file, and performing natural language processing and matching, the problem of not timely recording and notification of code changes is solved, and automatic detection and verification of the code changes content is realized, improving work efficiency and testing quality.
Patent Information
- Application Number
- CN202411653295.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-14
Smart Images

Figure CN119621526A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software development technology, and in particular to a code detection method, device, equipment, storage medium and product. Background Art
[0002] During the development of information system projects, it is necessary to ensure that the functions implemented by the system meet the expected requirements and are consistent with the requirements. Testing can further verify the implementation of the requirements and the correctness of the system functions. After the project completes program development, unit testing, and integration testing, the main program of the project has been developed and is delivered to the test team for functional testing. During the testing process, there may be a situation where the code changes cannot be found in the requirements documents and other materials, and the project team business team and test team have not been informed through formal channels. The test team cannot organize testing without understanding these changes.
[0003] In order to ensure the adequacy of the test, in the existing technology, the test team generally adopts the method of manually checking the code release content, listing the content of each code release, and checking one by one whether the changes in the release are known content, such as requirement optimization or defect repair. However, this method is inefficient and requires a lot of manpower. Summary of the invention
[0004] The present invention provides a code detection method, device, equipment, storage medium, product and vehicle to realize automatic detection of modified content in code.
[0005] According to one aspect of the present invention, there is provided a code detection method, comprising:
[0006] Obtaining demand tasks and extracting demand keywords in the demand tasks;
[0007] Scanning a code file to extract comment keywords in the code file;
[0008] The requirement keywords are matched with the annotation keywords, and the code detection results are determined according to the matching results.
[0009] Further, obtaining the demand task and extracting the demand keywords in the demand task include:
[0010] Obtaining a requirement document as the requirement task;
[0011] Decomposing the requirement document to obtain at least one requirement item, wherein each requirement item corresponds to a requirement keyword;
[0012] The demand keywords are extracted respectively according to each of the demand items.
[0013] Further, the code file is scanned to extract comment keywords in the code file, including:
[0014] If a modification submission record is found in the code file, extracting a target modification file according to the modification submission record;
[0015] The comment keywords in the target modified file are extracted.
[0016] Furthermore, matching the demand keywords with the annotation keywords includes:
[0017] In combination with natural language processing technology, determine the similarity between the demand keyword and the annotation keyword;
[0018] If the similarity is greater than a preset similarity threshold, the matching result is determined to be a successful match; otherwise, the matching result is determined to be a failed match.
[0019] Further, the code detection result is determined according to the matching result, including:
[0020] If the match is successful, the code detection result is determined as no difference between the requirement and the code;
[0021] If the match fails, the code detection result is determined as a difference between the requirement and the code.
[0022] Furthermore, after determining the matching result as the detection result, the method further includes:
[0023] The detection results are saved, and processing suggestions are generated according to the detection results.
[0024] According to another aspect of the present invention, there is provided a code detection device, comprising:
[0025] A demand keyword extraction module is used to obtain demand tasks and extract demand keywords in the demand tasks;
[0026] An annotation keyword extraction module, used to scan code files and extract annotation keywords in the code files;
[0027] The code detection result determination module is used to match the requirement keywords with the annotation keywords and determine the code detection result according to the matching result.
[0028] Optionally, the demand keyword extraction module is also used to:
[0029] Obtaining a requirement document as the requirement task;
[0030] Decomposing the requirement document to obtain at least one requirement item, wherein each requirement item corresponds to a requirement keyword;
[0031] The demand keywords are extracted respectively according to each of the demand items.
[0032] Optionally, the annotation keyword extraction module is also used to:
[0033] If a modification submission record is found in the code file, extracting a target modification file according to the modification submission record;
[0034] The comment keywords in the target modified file are extracted.
[0035] Optionally, the code detection result determination module is further used to:
[0036] In combination with natural language processing technology, determine the similarity between the demand keyword and the annotation keyword;
[0037] If the similarity is greater than a preset similarity threshold, the matching result is determined to be a successful match; otherwise, the matching result is determined to be a failed match.
[0038] Optionally, the code detection result determination module is further used to:
[0039] If the match is successful, the code detection result is determined as no difference between the requirement and the code;
[0040] If the match fails, the code detection result is determined as a difference between the requirement and the code.
[0041] Optionally, the device further includes a processing suggestion generating module, which is used to save the detection result and generate a processing suggestion according to the detection result.
[0042] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0043] at least one processor; and
[0044] a memory communicatively connected to the at least one processor; wherein,
[0045] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the code detection method described in any embodiment of the present invention.
[0046] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the code detection method described in any embodiment of the present invention when executed.
[0047] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of the code detection method described in any embodiment of the present invention are implemented.
[0048] The code detection method disclosed in the present invention first obtains the requirement task and extracts the requirement keywords in the requirement task; then scans the code file and extracts the comment keywords in the code file; finally, the requirement keywords are matched with the comment keywords, and the code detection result is determined according to the matching result. The code detection method disclosed in the present invention can automatically detect the consistency between the modified content of the code file and the requirement content by extracting the requirement keywords and the comment keywords respectively and matching them, and assists the project management personnel to check whether the code modification content is a known modification, thereby improving work efficiency and improving the test quality and production quality.
[0049] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0051] Figure 1 is a flowchart of a code detection method provided according to Embodiment 1 of the present invention;
[0052] Figure 2 is a flow chart of a code detection method provided according to Embodiment 2 of the present invention;
[0053] Figure 3 is a structural diagram of a code detection device provided according to Embodiment 3 of the present invention;
[0054] Figure 4 It is a structural schematic diagram of an electronic device for implementing the code detection method of the fourth embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0057] Embodiment 1
[0058] Figure 1 This is a flowchart of a code detection method provided in the first embodiment of the present invention. This embodiment is applicable to the case of checking the modified content in the code file. The method can be executed by a code detection device, which can be implemented in the form of hardware and / or software, and the code detection device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0059] S110: Obtain demand tasks, and extract demand keywords in the demand tasks.
[0060] An information system project is an independent, temporary work that organizes human resources to provide a unique software and hardware service product. In the construction of an information system project, it is necessary to clarify the requirements and achieve the correct and comprehensive implementation of the requirements through requirements management. Among them, the requirements are the conditions or capabilities information required by users to solve problems or achieve goals, or the conditions or capabilities information required by systems or system components to meet contracts, standards, specifications or other formally specified documents.
[0061] In this embodiment, the demand task is each specific task related to the demand, and the demand keyword is the keyword describing the demand corresponding to the demand task.
[0062] Preferably, in order to realize the correct and comprehensive realization of the requirements, it is necessary to first analyze and clarify the requirements. The method of clarifying the requirements can be to extract the corresponding requirement keywords from the requirement tasks. Among them, the requirement tasks can be obtained from the requirement documents. The requirement document is a document that records in detail the functions, performance, limitations and constraints that the system, software or product needs to meet. Its main function is to ensure that the development team, business-related personnel, users and other relevant stakeholders reach a consensus on the requirements before the project starts, and provide a basis and guidance for the development and implementation of the entire project. Based on the analysis of the requirement document, the requirement tasks can be extracted one by one from the requirement document to obtain the itemized requirement task information, and then the requirement task information can be processed using technologies such as natural language processing to obtain the requirement keywords in the requirement tasks.
[0063] S120: Scan the code file and extract comment keywords in the code file.
[0064] The code files are all the code files generated during the development of the information system project, including each version of the code files for each code modification. The comment keywords are the keywords of the code comment information marked in the modified content of the code files.
[0065] In this embodiment, in order to find out the code changes that occurred in the code file, a code scanning tool can be used to scan the code file once every preset time. Generally, when a code file is modified each time, a commit record is generated in the code file, and these commit records can be extracted by scanning the code file. Then, based on the commit record, the modified part of the code file can be extracted, and then the annotation keywords can be extracted from the modified part.
[0066] S130: Match the requirement keywords with the annotation keywords, and determine the code detection result according to the matching result.
[0067] In this embodiment, after obtaining the requirement keywords and annotation keywords, the two can be matched. If the contents of the two are consistent, the match is successful, indicating that the code file is consistent with the project development requirements, and the detection result can be "no difference, known modified content"; if the contents of the two are inconsistent, the match fails, indicating that there are unknown changes in the code file that do not meet the project development requirements, and the detection result can be "differences exist, and there are unknown modified content."
[0068] Furthermore, after determining the matching result as the detection result, you can also: save the detection result, and generate processing suggestions based on the detection result.
[0069] Specifically, after obtaining the test results, the test results can be sent to relevant staff such as project managers. Furthermore, if the test result is "differences exist, unknown modifications exist", further processing suggestions can be generated, such as suggesting communication with project development engineers.
[0070] The code detection method provided by the embodiment of the present invention first obtains the requirement task and extracts the requirement keywords in the requirement task; then scans the code file and extracts the comment keywords in the code file; finally, the requirement keywords are matched with the comment keywords, and the code detection result is determined according to the matching result. The code detection method disclosed in the present invention can automatically detect the consistency between the modified content of the code file and the requirement content by extracting the requirement keywords and the comment keywords respectively and matching them, and assists the project management personnel to check whether the code modification content is a known modification, thereby improving work efficiency and improving the test quality and production quality.
[0071] Embodiment 2
[0072] Figure 2 Flow chart of a code detection method provided in Embodiment 2 of the present invention. This embodiment is a refinement of the above embodiment. Figure 2 As shown, the method includes:
[0073] S210, obtaining a requirement document as a requirement task, disassembling the requirement document to obtain at least one requirement item, and extracting requirement keywords according to each requirement item.
[0074] Among them, each requirement item corresponds to a requirement keyword.
[0075] In this embodiment, a requirement document can be obtained as a requirement task, and the requirement document can be decomposed into specific requirement items using natural language processing and other technologies, and each requirement item corresponds to a requirement keyword. Then, the corresponding requirement keywords are extracted and processed according to each requirement item using natural language processing and other technologies.
[0076] Preferably, the requirement document can be imported into the itemized management tool by using the itemized management tool, and the requirement document can be structured and stored and managed. Then the requirement document can be processed based on natural language processing technology. The specific processing steps may include but are not limited to the steps of requirement data acquisition, Chinese NLP preprocessing, text representation, etc., to decompose the requirements into structured and itemized requirement contents, i.e., requirement items. Each requirement item corresponds to a unique ID and requirement keywords.
[0077] Furthermore, based on the extracted demand keywords, expert opinions after manual inspection can be obtained, and the demand keywords can be revised based on the expert opinions to improve the accuracy of the demand keywords.
[0078] S220: If a modification submission record is found in the scanned code file, a target modification file is extracted according to the modification submission record.
[0079] The modification submission record is the record information generated after each code modification, which records the content of each code modification. The target modification file is the part of the content that has been modified in the code file.
[0080] In this embodiment, a scanning tool may be used to scan the code file at preset time intervals. If a modification submission record is found in the code branch, the target modified file is extracted from the submission record.
[0081] S230: Extract comment keywords in the target modified file.
[0082] In this embodiment, the specific changes in the target modification file are generally annotated and indicated by a set symbol (such as @). After obtaining the target modification file, the target modification file can be traversed, the annotations in the target modification file can be extracted, and disassembled into keywords, i.e., annotation keywords.
[0083] S240. Determine the similarity between the demand keyword and the annotation keyword by combining natural language processing technology. If the similarity is greater than a preset similarity threshold, determine the matching result as a successful match; otherwise, determine the matching result as a failed match.
[0084] Among them, Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can enable effective communication between humans and computers using natural language.
[0085] In this embodiment, after obtaining the demand keywords and the annotation keywords, the demand keywords and the annotation keywords can be matched using natural language processing technology, and the similarity between the two can be analyzed to obtain a specific similarity score. According to a preset similarity threshold, if the similarity score obtained by analysis is greater than the preset similarity threshold, the matching result is determined to be a successful match, otherwise the matching result is determined to be a failed match.
[0086] S250. If the match is successful, the code detection result is determined as no difference between the requirement and the code; if the match fails, the code detection result is determined as a difference between the requirement and the code.
[0087] In this embodiment, if the matching result of the requirement keywords and the annotation keywords is a successful match, it can be considered that the code file is consistent with the project development requirements, and the output code detection result is "no difference, known modified content"; if the match fails, it can be considered that the code file is inconsistent with the project development requirements, and the output code detection result is "differences exist, and unknown modified content exists".
[0088] Furthermore, if the code detection result determines that there is a difference between the requirements and the code, processing suggestions can be further generated, for example, it can be suggested to communicate with the project development engineer.
[0089] The code detection method disclosed in the present invention first obtains a requirement document as a requirement task, disassembles the requirement document to obtain at least one requirement item, extracts requirement keywords according to each requirement item, and if a modification submission record is scanned in the code file, extracts the target modification file according to the modification submission record, and then extracts the annotation keywords in the target modification file, and then combines the natural language processing technology to determine the similarity between the requirement keyword and the annotation keyword. If the similarity is greater than a preset similarity threshold, the matching result is determined to be a successful match, otherwise the matching result is determined to be a failed match. If the match is successful, the code detection result is determined to be that there is no difference between the requirement and the code; if the match fails, the code detection result is determined to be that there is a difference between the requirement and the code. The code detection method disclosed in the present invention can automatically detect the consistency between the modified content of the code file and the requirement content by extracting the requirement keywords and the annotation keywords respectively and matching them, and assists project managers in checking whether the code modification content is a known modification, thereby improving work efficiency and improving test quality and production quality.
[0090] Embodiment 3
[0091] Figure 3 A schematic diagram of the structure of a code detection device provided in Embodiment 3 of the present invention is shown in FIG. Figure 3 As shown, the device includes: a requirement keyword extraction module 310, an annotation keyword extraction module 320 and a code detection result determination module 330.
[0092] The demand keyword extraction module 310 is used to obtain demand tasks and extract demand keywords from the demand tasks.
[0093] The comment keyword extraction module 320 is used to scan the code file and extract the comment keywords in the code file.
[0094] The code detection result determination module 330 is used to match the requirement keywords with the annotation keywords and determine the code detection result according to the matching result.
[0095] Optionally, the demand keyword extraction module 310 is further used for:
[0096] A requirement document is obtained as a requirement task; the requirement document is disassembled to obtain at least one requirement item; each requirement item corresponds to a requirement keyword; and the requirement keywords are extracted respectively according to each requirement item.
[0097] Optionally, the annotation keyword extraction module 320 is further used for:
[0098] If a modification submission record is found in the scanned code file, the target modification file is extracted according to the modification submission record; and comment keywords in the target modification file are extracted.
[0099] Optionally, the code detection result determination module 330 is further used to:
[0100] Combined with natural language processing technology, the similarity between the demand keywords and the annotation keywords is determined; if the similarity is greater than the preset similarity threshold, the matching result is determined to be a successful match, otherwise the matching result is determined to be a failed match.
[0101] Optionally, the code detection result determination module 330 is further used to:
[0102] If the match is successful, the code detection result is determined as no difference between the requirement and the code; if the match fails, the code detection result is determined as a difference between the requirement and the code.
[0103] Optionally, the device further includes a processing suggestion generating module 340, which is used to save the detection results and generate processing suggestions according to the detection results.
[0104] The code detection device provided in the embodiment of the present invention can execute the code detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0105] Embodiment 4
[0106] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0107] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0108] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0109] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a code detection method.
[0110] In some embodiments, the code detection method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the code detection described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the code detection method in any other appropriate manner (e.g., by means of firmware).
[0111] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0112] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0113] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (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 foregoing.
[0114] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0115] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0116] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0117] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0118] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A code detection method, characterized in that: include: Obtaining demand tasks and extracting demand keywords in the demand tasks; Scanning a code file to extract comment keywords in the code file; The requirement keywords are matched with the annotation keywords, and the code detection results are determined according to the matching results.
2. The method according to claim 1, characterized in that Obtaining the required tasks and extracting the required keywords in the required tasks, including: Obtaining a requirement document as the requirement task; Decomposing the requirement document to obtain at least one requirement item, wherein each requirement item corresponds to a requirement keyword; The demand keywords are extracted respectively according to each of the demand items.
3. The method according to claim 1, characterized in that Scan the code file and extract the comment keywords in the code file, including: If a modification submission record is found in the code file, extracting a target modification file according to the modification submission record; The comment keywords in the target modified file are extracted.
4. The method according to claim 1, characterized in that: Matching the requirement keyword with the annotation keyword includes: In combination with natural language processing technology, determine the similarity between the demand keyword and the annotation keyword; If the similarity is greater than a preset similarity threshold, the matching result is determined to be a successful match; otherwise, the matching result is determined to be a failed match.
5. The method according to claim 4, characterized in that The code detection result is determined based on the matching result, including: If the match is successful, the code detection result is determined as no difference between the requirement and the code; If the match fails, the code detection result is determined as a difference between the requirement and the code.
6. The method according to claim 1, characterized in that After the matching result is determined as the detection result, it also includes: The detection results are saved, and processing suggestions are generated according to the detection results.
7. A code detection device, characterized in that: include: A demand keyword extraction module is used to obtain demand tasks and extract demand keywords in the demand tasks; An annotation keyword extraction module, used to scan code files and extract annotation keywords in the code files; The code detection result determination module is used to match the requirement keywords with the annotation keywords and determine the code detection result according to the matching result.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the code detection method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the code detection method according to any one of claims 1 to 6 when executed.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the code detection method according to any one of claims 1 to 6 are implemented.