Code auditing system and method, electronic equipment and storage medium
The code review system's receiving, reviewing, and feedback modules solve the problem of developers being unable to discover vulnerabilities and non-standard coding, ensuring the smooth progress of development.
Patent Information
- Application Number
- CN202511733522.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-10
AI Technical Summary
In the traditional development review process, developers cannot find vulnerabilities or non-standard coding problems in their own work, and the review results are difficult to accurately summarize.
A code review system is provided, including a receiving module, a review module, and a feedback module. The system receives target code, reviews it, generates feedback results, and sends the feedback results to the target object, thereby avoiding vulnerabilities and non-standard coding that developers may encounter during self-review.
This system shifts the review process from developers to the code review system, avoiding vulnerabilities and non-standard coding issues, and ensuring the smooth progress of development.
Smart Images

Figure CN121501675A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of code review, and particularly relates to a code review system and method, an electronic device and a storage medium. BACKGROUND
[0002] The software divides the design into several important designs, including application service design, development architecture design, data architecture design, application detailed design, work package pushing and a plurality of subsystems. Different systems need to be developed respectively.
[0003] In the traditional development review process, the review is usually performed locally by the developer. However, since the developer performs the review himself, the developer cannot find the vulnerabilities in the developed code and the non-standard coding in the development process, and the review result is difficult to accurately count. SUMMARY
[0004] The present application provides a code review system and method, an electronic device and a storage medium to solve the problem that the developer cannot find the vulnerabilities in the developed code and the non-standard coding in the development process.
[0005] According to an aspect of the present application, a code review system is provided, which comprises a receiving module, a review module and a feedback module, wherein:
[0006] The receiving module is configured to receive target code of a target object.
[0007] The review module is configured to review the target code, generate a feedback result, and send the feedback result to the feedback module.
[0008] The feedback module is configured to feed back the feedback result to the target object.
[0009] According to another aspect of the present application, a code review method is provided, which comprises:
[0010] Receiving target code of a target object.
[0011] Reviewing the target code, generating a feedback result.
[0012] Feeding back the feedback result to the target object.
[0013] According to another aspect of the present application, an electronic device is provided, which comprises:
[0014] At least one processor; and
[0015] A memory in communication connection with the at least one processor; wherein
[0016] 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 to enable the at least one processor to execute the code auditing system of any of the embodiments of the present application.
[0017] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to implement the code auditing system of any of the embodiments of the present application when executed by the processor.
[0018] The technical solution of the embodiments of the present application is that the receiving module is configured to receive target code of a target object; the auditing module is configured to audit the target code, generate a feedback result, and send the feedback result to the feedback module; and the feedback module is configured to feed back the feedback result to the target object. The auditing work can be transferred from the developer to the code auditing system, so that the problems that the developer cannot find the developed vulnerabilities and non-standard coding in the development process during the auditing process are avoided, and the development progress of the target object is ensured by sending the feedback result to the target object in time during the auditing process.
[0019] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0021] Figure 1 is a flowchart of a code auditing system according to the first embodiment of the present application;
[0022] Figure 2 is a structural schematic diagram of a code auditing method according to the second embodiment of the present application;
[0023] Figure 3 is a structural schematic diagram of an electronic device for implementing the code auditing method of the present application. DETAILED DESCRIPTION
[0024] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application, so that those skilled in the art can better understand the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work should belong to the protection scope of the present application.
[0025] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Embodiment one
[0027] Figure 1 The embodiment of the present application provides a structural block diagram of a code auditing system. The embodiment can be applicable to the case of auditing java code. The code auditing system can be realized in the form of hardware and / or software. The code auditing system can be configured in an electronic device with data processing capability. As shown in the figure, the code auditing system of the embodiment can include a receiving module 110, an auditing module 120 and a feedback module 130. Among them: Figure 1
[0028] The receiving module 110 is used for receiving the target code of the target object.
[0029] The auditing module 120 is used for auditing the target code, generating a feedback result, and sending the feedback result to the feedback module.
[0030] The feedback module 130 is used for feeding back the feedback result to the target object.
[0031] The code auditing system can be a system running on a remote server or a local server. The code auditing system can be used to upload the target code written by the target object and then audited by the auditor or the large model.
[0032] The receiving module can be installed in the server to receive the target code uploaded by the target object. The target code can be an actual code or a complete Java project.
[0033] The target object can upload the target code through local software. The auditing module can be used to audit the target code uploaded by the target object. The auditing process can be to audit whether the coding of the target code conforms to the preset coding rules, or to audit whether the target code can complete the function or effect claimed by the target code. The auditing process can be implemented by manual auditing or based on pre-trained artificial intelligence. After the auditing of the target code is completed, an auditing result is generated. If the auditing is passed, a feedback result of passing the auditing is fed back to the target object. If the auditing is not passed, a feedback result of not passing the auditing can be fed back to the target object.
[0034] Optionally, the target code is audited based on a pre-constructed code auditing model.
[0035] The construction process of the code auditing model includes:
[0036] A code sample is constructed, wherein the code sample includes code conforming to the specification and code not conforming to the specification.
[0037] An initial model is selected, and the initial model is iteratively trained based on the code sample to generate the code auditing model.
[0038] The initial model can be a logistic regression, an SVM, a deep learning model (CNN, LSTM), etc., and the present application does not limit this.
[0039] During the training process, it can be predicted whether the code segment violates the specification (binary classification) or which type of rule is violated (multi-classification). Finally, the model is verified in terms of accuracy and recall rate, and the identification ability for common violations is optimized.
[0040] On the basis of the above embodiments, the auditing module can include a rule checking unit.
[0041] The rule checking unit is used to audit the target code based on the preset rules to obtain a feedback result, and send the feedback result to the feedback module.
[0042] In the process of auditing the target code, in order to ensure the accuracy of the auditing process and avoid omissions during the auditing, the specific rules that the target code needs to comply with can be constructed in advance when auditing the target code, and the preset rules are obtained. The target code is audited by the preset rules to determine whether the target code complies with the preset rules. When the target code complies with the preset rules, it is determined that the target code passes the audit. When the target code does not comply with the preset rules, it can be further determined that the target code does not comply with the specific provisions in the preset rules, thereby providing a basis for the modification of the target code.
[0043] On the basis of the above embodiment, optionally, the preset rule is a writing specification of the target code.
[0044] The writing specification refers to the formulated unified coding rules and conventions. It includes the format, naming, structure, annotation, design pattern, etc. of the code, which can ensure the code quality, improve the readability, reduce the maintenance cost, and ensure that the code style written by team members is consistent and the logic is clear, facilitating collaboration and subsequent maintenance.
[0045] On the basis of the above embodiment, optionally, the feedback result at least includes an audit result and an audit feedback, and the audit feedback is used to explain the generation reason of the audit result.
[0046] Considering that multiple contents may need to be audited in the auditing process, therefore, when the feedback result only includes whether it passes the audit, in the case of failing the audit, the target object cannot accurately and clearly determine that there is a problem with the target code, which further causes the target object to spend a lot of time on proofreading the target code, affecting the work efficiency of the target object.
[0047] Therefore, the audit feedback is added to the feedback result, so that the target object can quickly determine the reason for passing or failing the audit after receiving the feedback result.
[0048] For example, whether the target code A complies with clauses A, B and C is audited.
[0049] When it is determined that the target code A does not comply with clause A, but complies with clauses B and C, the audit result can be "failed", and the audit feedback can be "does not comply with clauses B and C".
[0050] Further, the specific code that fails the audit can be written in the audit feedback.
[0051] On the basis of the above embodiment, optionally, it further includes a task construction module.
[0052] The task construction module is configured to construct a to-be-audited task and send the to-be-audited task to the auditing module.
[0053] Since the system can need to audit different target codes of different target objects, direct uploading by the target object can cause various target codes to be contained in the system and be difficult to distinguish, at this time, the to-be-audited tasks can be pre-constructed for different target codes, and the target object can select a to-be-audited task corresponding to the target object in each to-be-audited task and complete uploading of the corresponding target code.
[0054] Optionally, the method further includes a task statistics module.
[0055] The task statistics module is configured to count the auditing progress of the target code according to the feedback result.
[0056] The auditing progress of different target codes needs to be determined, which can be whether a single target code meets each clause in the preset rule or whether each target code of the target object uploaded is completed.
[0057] The technical solution of the present application receives the target code of the target object through the receiving module, audits the target code through the auditing module, generates a feedback result, and sends the feedback result to the feedback module; the feedback module feeds back the feedback result to the target object, which can transfer the auditing work from the developer to the code auditing system, thereby avoiding the problems that the developer cannot find the vulnerabilities in the developed code and non-standard coding in the development process, and ensuring the development progress of the target object by sending the feedback result to the target object in time during the auditing process.
[0058] Embodiment Two
[0059] Figure 2 A flowchart of a code auditing method is provided for the second embodiment of the present application, the present embodiment can be applicable to the case of auditing java code, the method can be executed by a code auditing device, the code auditing device can be realized in the form of hardware and / or software, and the code auditing device can be configured in an electronic device with data processing capability. As shown in the figure, the method includes: Figure 2 S210, receiving the target code of the target object.
[0060] S220, auditing the target code to generate a feedback result.
[0061] S230, feeding back the feedback result to the target object.
[0062] S230, feeding back the feedback result to the target object.
[0063] By adopting the technical scheme of the present application, the target code of the target object is received, the target code is audited, a feedback result is generated, and the feedback result is fed back to the target object, which can avoid the problems that the developer cannot find the vulnerabilities in the developed code and the non-standard coding in the development process, and the feedback result is sent to the target object in a timely manner in the auditing process, thereby ensuring the development progress of the target object.
[0064] Embodiment 3
[0065] Figure 3 A structural schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present application described and / or claimed in this document.
[0066] As shown in Figure 3 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11, wherein the memory stores a computer program that can be executed by the at least one processor. 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.
[0067] A plurality 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, a speaker, etc.; a storage unit 18, such as a magnetic 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.
[0068] The processor 11 can be various general-purpose and / or special-purpose 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 specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, and the like. The processor 11 performs various methods and processes described above, such as the code review system.
[0069] In some embodiments, the code review system can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the code review system described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the code review system by any other suitable means, such as by means of firmware.
[0070] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0071] Computer programs used to implement the methods of the application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor of the machine, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0072] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0073] To provide for interaction with a user, the systems and techniques described here can 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 a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0074] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can 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.
[0075] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can 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 large management difficulty and weak business scalability in traditional physical host and VPS service.
[0076] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.
[0077] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A code review system, characterized in that, It includes a receiving module, an approval module, and a feedback module, among which: The receiving module is used to receive the target code of the target object; The review module is used to review the target code, generate feedback results, and send the feedback results to the feedback module. The feedback module is used to send the feedback result back to the target object.
2. The system according to claim 1, characterized in that, The audit module includes a rule verification unit; The rule verification unit is used to review the target code based on preset rules, obtain feedback results, and send the feedback results to the feedback module.
3. The system according to claim 2, characterized in that, The preset rules are the writing specifications for the target code.
4. The system according to claim 1, characterized in that, The feedback results include at least the audit results and audit feedback, wherein the audit feedback is used to explain the reasons for the generation of the audit results.
5. The system according to claim 1, characterized in that, It also includes a task building module; The task construction module is used to construct tasks to be reviewed and send the tasks to be reviewed to the review module.
6. The system according to claim 1, characterized in that, It also includes a task statistics module; The task statistics module is used to calculate the review progress of the target code based on the feedback results.
7. A code review method, characterized in that, include: Receive the target code of the target object; The target code is reviewed, and feedback results are generated. The feedback result is then sent back to the target object.
8. The method according to claim 7, characterized in that, The target code is reviewed, and feedback results are generated, including: The target code is reviewed based on preset rules, and feedback results are obtained.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the code review system of any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the code review system of any one of claims 1-6.