Code compiling method and device, electronic equipment and storage medium
By obtaining login information and determining user permissions on the target webpage, analyzing code change types, and performing automated compilation, the problem of cross-regional team collaboration is solved, code compilation efficiency and integration transparency are improved, and the needs of modern agile development are met.
Patent Information
- Application Number
- CN202610498893.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-15
- Publication Date
- 2026-07-10
Smart Images

Figure CN122363703A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software code compilation technology, and more specifically, to a code compilation method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of technology, automated software integration can reduce the possibility of human error and improve the efficiency of code integration, thus shortening the software development cycle. However, existing automated integration solutions are mostly based on local scripts. While this improves efficiency to some extent, it cannot solve the problem of cross-regional team collaboration. Furthermore, collaboration between personnel with different functions is difficult, and these personnel can only operate through specific physical servers or virtual machines. This results in an opaque software code integration process, high management costs, and difficulty in meeting the needs of modern agile development. Therefore, improving code compilation efficiency has become an urgent problem to be solved. Summary of the Invention
[0003] In view of this, embodiments of this application propose a code compilation method, apparatus, electronic device, and storage medium to improve the above-mentioned problems.
[0004] According to a first aspect of the embodiments of this application, a code compilation method is provided, the method comprising: obtaining login information on a target webpage, and determining the logged-in user as a first user based on the login information; obtaining target code uploaded by the first user under the first user's first permissions, wherein, when the first user has the first permissions, the first permissions are configured to: support code submission and local automatic compilation; if the target code is analyzed and determined to be a logical change, then the target code is compiled to generate a target file; if the target code is analyzed and determined to be an interface change, then review prompt information is generated based on the target code, and the target code is compiled based on the review feedback; the review feedback is determined based on the review prompt information.
[0005] In some embodiments, compiling the target code based on the review feedback includes: if the review feedback indicates that the target code has passed the review, compiling the target code to generate a target file; if the review feedback indicates that the target code has not passed the review, generating a modification prompt message and prompting the first user based on the modification prompt message.
[0006] In some embodiments, compiling the target code to generate a target file includes: obtaining a compilation environment and base code; compiling the target code and base code in the compilation environment to obtain a compilation result; generating an error message if the compilation result indicates that the target code has not been compiled successfully; and generating the target file if the compilation result indicates that the target code has been compiled successfully.
[0007] In some embodiments, the review prompt information includes the target time zone of the location of the person to be reviewed. After generating the review prompt information based on the target code, the method further includes: determining the sending method of the review prompt information based on the target time zone and the timestamp corresponding to the review prompt information; obtaining the notification priority of the review prompt information, and determining the prompting method of the review prompt information based on the notification priority, wherein the prompting method includes at least one or a combination of SMS prompts, email prompts, and message prompts; and sending the review prompt information to the person to be reviewed through the prompting method and the sending method.
[0008] In some embodiments, determining the sending method of the review prompt based on the target time zone and the timestamp corresponding to the review prompt information includes: if the current time is determined to be the working time of the person to be reviewed based on the target time zone and the timestamp corresponding to the review prompt information, then the sending method is determined to be immediate sending; if the current time is determined to be the non-working time of the person to be reviewed based on the target time zone and the timestamp corresponding to the review prompt information, then the sending method is determined to be scheduled sending, wherein the scheduled sending is sent during the working time of the person to be reviewed.
[0009] In some embodiments, after obtaining the login information on the target webpage, the method further includes: if the logged-in user is determined to be a second user based on the login information, then determining whether a review prompt message has been received under the second user's second permissions, wherein when the second user has the second permissions, the second permissions are configured to: support viewing code, remote collaborative compilation, and local automatic compilation; if a review prompt message is received, then displaying the code to be reviewed based on the review prompt message; responding to the second user's review operation, generating review feedback, and prompting the user who uploaded the code to be reviewed based on the review feedback.
[0010] In some embodiments, after determining the user permissions of the target user based on the login information, the method further includes: if the login user is determined to be a third user based on the login information, then displaying target content in response to the third user's viewing operation on the target webpage according to the third permission, wherein when the third user has the third permission, the third permission is configured to support viewing code.
[0011] According to a second aspect of the embodiments of this application, a code compilation apparatus is provided, the apparatus comprising: a user determination module, configured to acquire login information on a target webpage and determine the logged-in user as a first user based on the login information; a target code acquisition module, configured to acquire target code uploaded by the first user under the first user's first permissions, wherein, when the first user has the first permissions, the first permissions are configured to support code submission and local automatic compilation; a first compilation module, configured to compile the target code to generate a target file if the analysis of the target code determines that the change type of the target code is a logical change; and a second compilation module, configured to generate review prompt information based on the target code and compile the target code based on the review feedback if the analysis of the target code determines that the change type of the target code is an interface change; wherein the review feedback is determined based on the review prompt information.
[0012] According to a third aspect of the embodiments of this application, an electronic device is provided, including: a processor; and a memory storing computer-readable instructions, wherein when the computer-readable instructions are executed by the processor, they implement the code compilation method described above.
[0013] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which computer-readable instructions are stored, which, when executed by a processor, implement the code compilation method described above.
[0014] In this application's solution, the login user's identity is first determined based on the login information obtained from the target webpage. When identifying the first user as the primary user, the target code uploaded by the primary user is obtained based on their primary permissions. This allows for analysis of the target code to determine its modification type. If the modification type is determined to be a logical change, the target code can be automatically compiled to generate a target file; alternatively, if the modification type is determined to be an interface change, an audit prompt is generated, and the target code is compiled based on the audit feedback. This application's embodiments can automatically compile target code based on different modification types uploaded by the primary user under their primary permissions, improving the compilation efficiency of the target code.
[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit the embodiments of this application. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0017] Figure 1 This is a schematic diagram of a code compilation system according to an embodiment of this application;
[0018] Figure 2 This is a schematic flowchart illustrating a code compilation method according to an embodiment of this application; Figure 3 This is a flowchart illustrating a code compilation method according to another embodiment of this application; Figure 4 This is a schematic diagram illustrating the automatic compilation process of code according to an embodiment of this application; Figure 5 This is a flowchart illustrating a code compilation method according to another embodiment of this application; Figure 6 This is a schematic diagram of a code compilation method according to another embodiment of this application; Figure 7 This is a schematic diagram illustrating a code compilation method according to an embodiment of this application; Figure 8 This is a schematic diagram illustrating user permissions for different users according to an embodiment of this application; Figure 9 This is a schematic diagram illustrating the process of sending a notification on a target webpage according to an embodiment of this application; Figure 10 This is a block diagram of a code compilation apparatus according to an embodiment of this application; Figure 11 This is a hardware structure diagram of an electronic device according to an embodiment of this application.
[0019] The accompanying drawings have illustrated specific embodiments of the present application. More detailed descriptions will follow. These drawings and descriptions are not intended to limit the scope of the present application's embodiments in any way, but rather to illustrate the concepts of the present application's embodiments to those skilled in the art through specific embodiments. Detailed Implementation
[0020] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0021] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0022] Please see Figure 1 , Figure 1 This application illustrates a code compilation system provided by an embodiment of the present application, such as... Figure 1 As shown below, the code compilation system implements a code compilation method with an example.
[0023] In one alternative implementation, the code compilation system includes a front-end presentation layer 110, a business logic layer 120, a build execution layer 130, and a data storage layer 140, wherein the front-end presentation layer 110, the business logic layer 120, the build execution layer 130, and the data storage layer 140 refer to software units or modules.
[0024] For example, the front-end presentation layer 110 is used to display relevant content corresponding to the operation of the target webpage, and the business logic layer 120 is used to analyze the target code uploaded by the first user through the target webpage to determine the change type of the target code. When the change type of the target code is determined to be a logic change, the target code is compiled by the execution layer 130 to generate a target file, and finally the target file is stored by the data storage layer 140. Alternatively, when the business logic layer 120 determines that the change type of the target code is an interface change, it generates a review prompt message based on the target code, and then compiles the target code by the execution layer 130 after the review feedback indicates that the target code has passed the review.
[0025] Figure 1 The code compilation system in [the document] can be used to implement the following Figure 2 Please refer to the code compilation method described. Figure 2 , Figure 2 This application illustrates a code compilation method according to an embodiment of the present application. In a specific embodiment, this code compilation method can be applied to, for example... Figure 10The code compilation device 600 and the electronic device 700 configured with the code compilation device 600 are shown. Figure 11 The specific process of this embodiment will be described below. Of course, it is understood that this method can be executed by an electronic device with computing power, such as a vehicle-mounted server, a cloud server, or other processors. The following will focus on... Figure 2 The process shown is described in detail, and the code compilation method may specifically include the following steps 210-240.
[0026] Step 210: Obtain login information on the target webpage and determine the logged-in user as the first user based on the login information.
[0027] As an alternative approach, to facilitate collaboration among staff with different functions through a unified platform and avoid the inefficiency of software code integration and compilation caused by staff with different functions needing to use different platforms to perform their respective tasks, a remote automated software integration platform can be pre-set. For example, a webpage can be set up specifically for different users to interact across regions, allowing staff with different functions to log in to their unique accounts to perform different tasks, thereby enabling staff with different functions to collaborate across regions.
[0028] In some alternative embodiments, the target webpage may adopt a layered architecture, comprising four main layers: a front-end presentation layer, a business logic layer, a build execution layer, and a data storage layer. The core design of the target webpage may include: a Vue.js-based front-end interactive interface, a Django-based back-end business processing system, a Jenkins-based automated build pipeline, and a PostgreSQL database and Redis caching system. The backend business processing system based on the Django framework can include core modules such as a project management system, a task management system, a user management system, and an API (Application Programming Interface) system. The PostgreSQL database can include core data models such as user tables, project tables, task tables, code submission tables, and build configuration tables, and can create database indexes to optimize query performance and set data backup strategies to ensure data security. The Vue.js-based web frontend interface can achieve responsive design to adapt to different terminal devices. This interface can include a user login authentication module, a project management interface, a task monitoring panel, and a code submission page. This allows personnel with different functions to log in and authenticate through the user login authentication module, then access project management functions through the project management interface, task monitoring functions through the task monitoring panel, and code submission through the code submission page. Optionally, the Element-UI component library can be integrated to provide a consistent user experience for different users, and frontend routing can be configured to implement page navigation logic.
[0029] In other embodiments, the target webpage can also be built using Spring Boot in combination with React. High-performance backend services are built using the Spring Boot framework of the Java ecosystem, and a modern user interface is built using the React frontend framework, forming a complete system with a unified technology stack and type safety, thereby enabling cross-regional collaborative work among personnel with different functions.
[0030] Optionally, when a user accesses the target webpage, an access request can be generated through the user interface built by the Vue frontend. Then, the access request is received by Nginx, which obtains static resources and performs reverse proxy based on the access request. The reverse proxy then sends an API request to the backend Django. After receiving the API request, Django authenticates and authorizes the user's login information. After successful authentication and authorization, the user's login information on the target webpage is obtained.
[0031] Optionally, different users may have different login information such as usernames, passwords, or authentication credentials, which can be used to identify the user performing actions on the target webpage. To ensure differentiation between users, corresponding identifiers can be pre-set for each user, which can then be used to determine the user's permissions.
[0032] Step 220: Under the first user's first permission, obtain the target code uploaded by the first user, wherein when the first user has the first permission, the first permission is configured to support code submission and local automatic compilation.
[0033] As an alternative approach, to ensure that staff with different functions can collaborate through a unified platform, different user permissions can be pre-set for personnel with different functions. When identifying a specific user through login information on the target webpage, the user's permissions can be obtained through the corresponding permission identifier. The first user could be an application engineer, who would have limited first-level permissions such as code submission, local automatic code compilation, viewing projects, and viewing corresponding tasks.
[0034] In some embodiments, since the first permission only supports the first user to submit code and automatically compile code locally, when the first user logs in to the corresponding account on the target webpage, a code submission and automatic compilation component is displayed on the target webpage based on the first permission. This allows the target code uploaded by the first user under the first permission to be obtained by responding to the selection operation of the code submission component. Optionally, to ensure that the first user can upload the corresponding code on the target webpage, a code upload interface can be developed on the target webpage, supporting C files, H files, and compressed file formats for uploading. This allows code to be uploaded through the code upload interface.
[0035] Optionally, different permissions can be set for different roles. For example, for users with the role of integration engineer, since integration engineers need to connect different systems to ensure that data and control flow are transmitted correctly, reliably, and efficiently between different applications or systems, and their work spans multiple teams and technology stacks, their user permissions can be set to all permissions. On the other hand, for observers who have the function of understanding project progress and project results, in order to avoid major errors caused by observers manipulating code, their user permissions can be set to read-only permissions.
[0036] Step 230: If the analysis of the target code determines that the change type of the target code is a logical change, then the target code is compiled to generate a target file.
[0037] As an alternative approach, after obtaining the target code uploaded by the first user, the target code can be intelligently analyzed through the target webpage to determine whether the target code uploaded by the first user has changed compared to the historical code saved on the target webpage. If a change is found, the type of change can be determined, so that subsequent processes can be determined based on the specific type of change.
[0038] In some alternative embodiments, the type of code change can be automatically identified by setting keyword matching and syntax analysis in the target webpage, and the file verification mechanism can be implemented in the target webpage to check the format, size and integrity of the files uploaded by the user.
[0039] Optionally, since the logical changes to the code occur within the functions of the code, thereby changing the algorithm, process, or data processing method, they are transparent to the caller. The caller does not need to modify the code. Therefore, the target code can be compiled directly through the local automatic compilation process of the target webpage to generate the corresponding file. Then, the software application corresponding to the target code can be updated through the corresponding file. There is no need for other engineers to review the code, which improves the compilation and integration efficiency of the code.
[0040] Step 240: If the analysis of the target code determines that the change type of the target code is an interface change, then an audit prompt message is generated based on the target code, and the target code is compiled based on the audit feedback; the audit feedback is determined based on the audit prompt message.
[0041] As an optional approach, after obtaining the target code, the type of change to the target code can be determined by checking whether the externally exposed signature or contract has changed, analyzing whether the caller needs to modify the code, and examining whether data format or protocol changes are involved. If it is determined that the externally exposed signature or contract of the target code has changed, the caller needs to modify the code, or it is determined that data format or protocol changes are involved, then the type of change to the target code can be determined to be an interface change.
[0042] Optionally, if it is determined that the similarity between the target code and the historical code in the target webpage is less than the similarity threshold, the target code can be determined to be a completely new code. In this case, in order to ensure that the code runs normally, it can be determined that the target code needs to be reviewed and approved before it can be automatically compiled. Therefore, the change type of the target code can be determined to be an interface change.
[0043] In some optional embodiments, to ensure the normal operation of the target code, when the change type is determined to be an interface change, it is determined that an integration engineer needs to review the target code with the interface change to determine whether the changed interface complies with the corresponding rules. Therefore, to improve the efficiency of automatic code generation, after determining that the change type of the target code is an interface change, a review prompt message for the target code can be generated to prompt the personnel to be reviewed.
[0044] Optionally, the review prompt information may include information about the person to be reviewed, the review type, and the user information of the user who uploaded the code. This allows the review prompt information to be provided to the person to be reviewed based on the information in the review prompt information. After the person to be reviewed reviews the target code, corresponding review feedback is generated, and the user who uploaded the target code is notified through the review feedback.
[0045] Optionally, after the review feedback indicates that the target code has passed the review, the target code can be compiled through the local automatic compilation process of the target webpage to generate the corresponding file, and then the software application corresponding to the target code can be updated through the corresponding file.
[0046] In some alternative embodiments, if the review feedback indicates that the target code has failed the review, the user who uploaded the target code can be prompted to make modifications based on the review feedback, thereby avoiding the compilation and integration of erroneous code. Optionally, to improve the compilation efficiency of the target code, the reviewer can input an error message for the target code and add it to the review feedback, so that the user who uploaded the target code can make precise modifications based on the review feedback. The error message may include the type of interface error in the target code or the reason for the error in the target code.
[0047] In the embodiments of this application, the identity of the logged-in user is first determined based on the login information obtained from the target webpage. When the first user is identified as the first user, the target code uploaded by the first user is obtained based on the first user's first permissions. This allows for analysis of the target code to determine the type of change. If the change type is determined to be a logical change, the target code can be automatically compiled to generate a target file; or if the change type is determined to be an interface change, an audit prompt message is generated, and the target code is compiled based on the audit feedback. The embodiments of this application can automatically compile the target code according to different change types uploaded by the first user under their first permissions, improving the compilation efficiency of the target code.
[0048] Please see Figure 3 , Figure 3 This illustration shows a code compilation method provided by an embodiment of this application. The following will focus on... Figure 3 The process shown is described in detail, and the code compilation method may specifically include the following steps 310-350.
[0049] Step 310: Obtain login information on the target webpage, and determine the logged-in user as the first user based on the login information.
[0050] Step 320: Under the first user's first permission, obtain the target code uploaded by the first user, wherein when the first user has the first permission, the first permission is configured to support code submission and local automatic compilation.
[0051] Step 330: If the analysis of the target code determines that the change type of the target code is an interface change, then an audit prompt message is generated based on the target code.
[0052] The specific steps of steps 310-330 can be found in steps 210-240, and will not be repeated here.
[0053] Step 340: If the review feedback indicates that the target code has passed the review, then the target code is compiled to generate a target file.
[0054] As an alternative approach, once the review feedback indicates that the target code has passed the review, the target webpage can initiate an automatic compilation process based on the review feedback. This automatic compilation process can then be used to automatically integrate and compile the target code, thereby improving the compilation efficiency of the target code.
[0055] In some optional embodiments, after receiving the review feedback indicating that the review has been approved, the target webpage can first obtain the compilation environment that has been pre-set in the target webpage, and then automatically compile the target code in the corresponding compilation environment to obtain the target file.
[0056] Optionally, to monitor the compilation process of the target code and facilitate understanding of the compilation progress for all users, a development log streaming function can be pre-built into the target webpage. This allows logs to be pushed to the front-end interface in real time, which users can then view. Additionally, a progress calculation algorithm can be set in the target webpage to estimate and display the completion percentage based on the build stage and time, enabling users to understand the corresponding code compilation progress by viewing the percentage.
[0057] In some embodiments, step 340 includes: obtaining a compilation environment and base code; compiling the target code and the base code in the compilation environment to obtain a compilation result; generating an error message if the compilation result indicates that the target code has not been compiled successfully; and generating the target file if the compilation result indicates that the target code has been compiled successfully.
[0058] As an optional approach, when the target webpage initiates the automatic compilation function for the target code, it can first obtain the compilation environment and basic code, thereby enabling the compilation of the target code within the compilation environment. The basic code refers to the core components of the firmware or software corresponding to the target code. This basic code serves as the foundation of the firmware or software and is not frequently modified. It may include low-level drivers, hardware abstraction layer, real-time operating system, build system files, basic middleware, startup code, and common utility functions.
[0059] As an alternative approach, after obtaining the compilation environment and base code, the base code and target code can be compiled within the compilation environment to obtain the corresponding compilation results. This can be achieved by first replacing the application-layer code in the base code with the target code, then running an integration script to generate intermediate files, and finally executing the compilation to obtain the final compilation result.
[0060] Optionally, the corresponding compilation result can be determined by obtaining the return code of the compilation command of the target webpage. If the compilation is successful, the corresponding return code is a fixed value (e.g., 0); if the compilation fails, the corresponding return code is another value (e.g., 1).
[0061] Optionally, to facilitate developers' understanding of the compilation status, if the compilation result indicates that the target code failed to compile, an error message is generated, allowing developers to check and correct the target code based on the error message. If the compilation result indicates that the target code compiled successfully, a corresponding target file can be generated and stored to ensure that updates to the target code can be viewed later.
[0062] As an alternative approach, after obtaining the compilation environment and basic code, such as Figure 4As shown, it can be first determined whether the target code needs to integrate new application software (ASW). If it is determined that a new ASW file needs to be integrated, integration is performed, and the build script is updated to ensure that the new ASW is linked only to the final firmware or software. If not, the integration process is skipped. Next, the corresponding compilation operation is performed according to the project type of the target code, and the corresponding compilation result is obtained. If the compilation result indicates successful compilation, the target file is generated, and the target file is tested and verified. The test and verification results are then archived to obtain the archived result. If the compilation result indicates compilation failure, the error message is recorded to facilitate developers to view and modify it.
[0063] Please continue reading. Figure 3 Step 350: If the review feedback indicates that the target code has not passed the review, a modification prompt message is generated, and the first user is prompted based on the modification prompt message.
[0064] As an optional approach, when the review feedback indicates that the target code has not passed the review, in order to improve the compilation efficiency of the target code, a modification prompt message can be generated accordingly. This modification prompt message can then be used to prompt the first user to make modifications, so that the first user can promptly modify the target code after receiving the modification prompt message.
[0065] In some optional embodiments, in order to improve the efficiency of the first user modifying the target code, after the reviewer reviews the target code, corresponding error information can be added. This way, when generating the review feedback, the corresponding error information is added to the review feedback, thereby ensuring that the first user can quickly and accurately correct the target code based on the error information in the review feedback.
[0066] In this embodiment, after the target code is reviewed, the system determines whether to automatically compile the target code or require modification by the first user based on the specific instructions in the review feedback. This ensures the accuracy of the target code that is automatically compiled. In this way, on the basis of automation, remote collaboration and centralized management further reduce the waiting and communication costs of personnel, resulting in a qualitative leap in the overall development and integration efficiency.
[0067] Please see Figure 5 , Figure 5 This illustration shows a code compilation method provided by an embodiment of this application. The following will focus on... Figure 5 The process is described in detail. The review prompt information includes the target time zone of the location of the person to be reviewed. The code compilation method may specifically include the following steps 410-460.
[0068] Step 410: Obtain login information on the target webpage, and determine the logged-in user as the first user based on the login information.
[0069] Step 420: Under the first user's first permission, obtain the target code uploaded by the first user, wherein when the first user has the first permission, the first permission is configured to support code submission and local automatic compilation.
[0070] Step 430: If the analysis of the target code determines that the change type of the target code is an interface change, then an audit prompt message is generated based on the target code.
[0071] The specific steps of steps 410-430 can be found in steps 210-240, and will not be repeated here.
[0072] Step 440: Determine the method of sending the review prompt information based on the target time zone and the timestamp corresponding to the review prompt information.
[0073] As an optional approach, in order to accurately and promptly notify the reviewer, the method of sending the review notification can be determined first based on the target time zone of the reviewer's location and the timestamp corresponding to the review notification information. This ensures that the review notification information can be sent to the reviewer through the corresponding sending method, thereby guaranteeing that the reviewer can receive the corresponding review notification information based on the corresponding sending method to review the target code.
[0074] In some optional embodiments, to avoid the audit notification being sent to the auditee outside of their working hours, thus preventing the auditee from receiving the notification in a timely manner, the system can first determine whether the timestamp corresponding to the audit notification falls within the auditee's working hours based on the target time zone and the timestamp corresponding to the notification. The notification can then be sent during the auditee's working hours. Optionally, the sending method can include immediate sending and scheduled sending.
[0075] In some embodiments, step 440 includes: if it is determined that the current time is the working time of the person to be reviewed based on the target time zone and the timestamp corresponding to the review prompt information, then the sending method is determined to be immediate sending; if it is determined that the current time is the non-working time of the person to be reviewed based on the target time zone and the timestamp corresponding to the review prompt information, then the sending method is determined to be scheduled sending, wherein the scheduled sending is sent during the working time of the person to be reviewed.
[0076] As an optional approach, the first time zone offset of the region where the first user uploading the target code is located can be determined based on the timestamp corresponding to the review prompt information. Simultaneously, the second time zone offset of the region corresponding to the target time zone can be determined. Based on the timestamp, the first time zone offset, and the second time zone offset, the current time of the region where the person to be reviewed is located can be determined. This allows for the determination of whether it is the working time for the review. Specifically, the current time can be determined by summing the difference between the second and first time zone offsets with the corresponding timestamp.
[0077] In some optional embodiments, the working time period of the person to be reviewed can be obtained first. Then, after determining the current time of the region where the person to be reviewed is located, it can be determined whether the current time is within the working time period. If it is determined that it is within the working time period, the review prompt information can be sent to the person to be reviewed immediately, so that the person to be reviewed can review the target code in a timely manner based on the received review prompt information.
[0078] Optionally, if it is determined that the current time of the region where the person to be reviewed is located is not within the working hours based on the timestamp, the first time zone offset, and the second time zone offset, then the sending time of the review prompt message is set according to the current time and the working hours of the person to be reviewed. The review prompt message is sent regularly based on this sending time to remind the person to be reviewed, thereby avoiding sending the corresponding review prompt message outside of working hours and causing the person to be reviewed to miss the corresponding review prompt.
[0079] Step 450: Obtain the notification priority of the review prompt information, and determine the prompting method of the review prompt information according to the notification priority, wherein the prompting method includes at least one or a combination of SMS prompts, email prompts and message prompts.
[0080] As an optional approach, to address the varying urgency levels of target code, when the first user uploads the target code, they can select the urgency level. The notification priority for review notifications can then be determined based on this selected urgency level, allowing the notification method to be tailored accordingly. Alternatively, the notification priority can also be determined by assessing the project urgency of the target code's parent project.
[0081] In some optional embodiments, after determining the notification priority of the review prompt information, in order to ensure that the person to be reviewed can understand the urgency of the target code in a timely manner, different prompting methods of the review prompt information can be determined based on the notification priority. In this way, the person to be reviewed can be notified through different prompting methods, and thus the person to be reviewed can review the target code based on different prompting methods.
[0082] Optionally, if the notification priority of the review notification information is determined to be high priority, the notification method can be a combination of SMS notification, email notification, and message notification; if the notification priority of the review notification information is determined to be medium priority, the notification method can be a combination of email notification and message notification; if the notification priority of the review notification information is determined to be low priority, the notification method can be a message notification.
[0083] Step 460: Send the review prompt information to the person to be reviewed using the prompting method and the sending method.
[0084] As an optional approach, after determining the notification and delivery methods for the review notification information, the review notification information can be sent to the person to be reviewed according to the corresponding notification and delivery methods, thereby ensuring that the person to be reviewed can review the target code based on the received review notification information.
[0085] In some optional embodiments, after the review prompt information is sent to the corresponding reviewer, a successful submission feedback can be generated, and the prompt method, submission method, and successful submission feedback can be recorded and stored in the corresponding log to facilitate traceability.
[0086] In this embodiment, to ensure that the reviewers can review the target code in a timely manner, the method for sending the review prompt information is first determined based on the target time zone of the reviewer's location and the timestamp corresponding to the review prompt information. Furthermore, the notification priority of the review prompt information is used to determine the notification method. Finally, the review prompt information is sent according to the notification method and the sending method, ensuring that the reviewers receive the corresponding review prompt information in a timely manner, thereby ensuring that the reviewers can review the target code promptly. This approach, through a remote target webpage, breaks geographical limitations, allowing developers located in different locations to asynchronously submit and monitor integration tasks, greatly promoting team collaboration.
[0087] Please see Figure 6 , Figure 6 This illustration shows a code compilation method provided by an embodiment of this application. The following will focus on... Figure 6 The process shown is described in detail, and the code compilation method may specifically include the following steps 510-540.
[0088] Step 510: Obtain login information on the target webpage.
[0089] For a detailed description of step 510, please refer to step 210, which will not be repeated here.
[0090] In some embodiments, after step 510, the method further includes: if the login user is determined to be a third user based on the login information, then displaying target content in response to the third user's viewing operation on the target webpage according to the third permission, wherein when the third user has the third permission, the third permission is configured to support viewing code.
[0091] As an alternative approach, to ensure all personnel can collaborate through the same platform and avoid the inefficiency caused by different roles requiring different platforms for project collaboration, different user permissions can be set for different roles on the target webpage. After obtaining login information from the target webpage, the specific role of the logged-in user can be determined based on this information. Once the logged-in user is identified as a third-party user, their viewable content on the target webpage can be determined based on their permissions. When the third-party user performs a viewing action, the corresponding target content is displayed.
[0092] Optionally, the third user can be an observer with read-only permissions. These permissions allow the third user to perform read-only operations such as viewing projects, tasks, and reports on the target webpage, thereby ensuring the security and standardization of the compilation and integration of the target code.
[0093] Step 520: If the login user is determined to be the second user based on the login information, then determine whether to receive an audit prompt message under the second user's second permissions. When the second user has the second permissions, the second permissions are configured to support viewing the code, remote collaborative compilation, and local automatic compilation.
[0094] As an alternative approach, when the login user of the target webpage is determined to be the second user based on the login information, it can be determined whether an audit prompt has been received based on the second user's second permissions. In this way, when it is determined that an audit prompt has been received, an audit prompt can be issued to the second user based on the audit prompt information.
[0095] In some optional embodiments, to ensure that personnel with different functions can operate on the target webpage, the second user can be granted specific permissions. This allows the second user to view code, perform collaborative compilation, and local automatic compilation based on these permissions. Optionally, the second user can be an integration engineer. Since integration engineers need to integrate different functional hardware and software modules to obtain a complete system, they need more permissions to view different code and perform integration. Therefore, the second user's permissions on the target webpage can be pre-set to include full access to all functions, ensuring that the integration engineer can execute the corresponding tasks smoothly and accurately.
[0096] Step 530: If an audit prompt is received, the code to be audited is displayed based on the audit prompt.
[0097] As an optional approach, if the second user receives the review prompt information based on the second permission, the code to be reviewed can be displayed based on the review prompt information, thereby facilitating the second user to review the code and ensuring the compilation efficiency of the code to be reviewed.
[0098] In some optional embodiments, if it is determined that the person to be reviewed has received multiple review prompts, the review prompts can be displayed in order of high priority to low priority based on the notification priority of the corresponding review prompts. This ensures that the person to be reviewed can view the high priority review prompts first, and ensures that the more urgent code to be reviewed is reviewed first.
[0099] Optionally, after confirming that the review prompt information has been received, the target webpage responds to the second user's viewing action by displaying the code to be reviewed selected by the second user. This avoids reducing the processing efficiency of the reviewer by displaying all the code when there are multiple codes that need to be reviewed.
[0100] Step 540: Respond to the second user's review operation, generate review feedback, and provide a prompt to the user who uploaded the code to be reviewed based on the review feedback.
[0101] As an alternative approach, after the second user reviews the code to be reviewed, a judgment can be made on whether the code passes the review. After the second user selects the judgment result of the code to be reviewed on the target webpage, the system can respond to the second user's review operation and generate review feedback for the code to be reviewed. This feedback can then be used to prompt the user who uploaded the code to be reviewed, ensuring that the code to be reviewed can proceed to the next step based on the review feedback.
[0102] In some optional embodiments, the review feedback may include approval feedback and rejection feedback. If the review is rejected, a modification prompt message is generated based on the rejection feedback, thereby prompting the user who uploaded the code to be reviewed to make modifications, ensuring that the user who uploaded the code to be reviewed can correct the code in a timely manner; if the review is approved, a review completion message is generated based on the approval feedback, thereby prompting the user who uploaded the code to be reviewed.
[0103] In this embodiment, to ensure that different user roles can collaborate through the same platform, user role and permission management is introduced to ensure the security and standardization of integration operations, while avoiding problems caused by differences in individual developer environments and reducing maintenance costs.
[0104] Figure 7 This is a code compilation method shown in an embodiment of this application, such as... Figure 7 As shown, the system first obtains user information from the user who logs in on the target webpage to determine the user's role. If the user role is determined to be an application engineer, the system retrieves the ASW code submitted by the application engineer and performs intelligent analysis to determine the type of change. If the change type is determined to be a logical change, the build process is automatically triggered on the target webpage. If the change type is determined to be an interface change, the ASW code is identified as code awaiting review. After the ASW code passes the integration engineer's review, the system first loads the automated compilation process (e.g., a Jenkins pipeline), then pulls the uploaded code for integration compilation to obtain the build result. If the build is successful, the corresponding files are generated and archived, and an archive notification is generated. If the build fails, the build error is recorded and an alert is issued.
[0105] Optionally, if the user role is determined to be an observer, based on the observer's read-only permissions, the observer can view projects, tasks, and reports. If the user role is determined to be an integration engineer, the integration engineer's full integration permissions enable project management, task monitoring, system configuration, and triggering of integration compilation functions. Furthermore, the integration engineer also reviews the ASW code uploaded by the application engineer. If the review fails, the code is returned to the application engineer for modification until it passes review, and the application engineer is notified upon approval.
[0106] Figure 8 These are the user permissions corresponding to different users as shown in one embodiment of this application, such as... Figure 8As shown, when logging in through the target webpage, the user's identity is first verified. After successful verification, the user's role is determined. If the logged-in user is identified as an integration engineer, the integration engineer has full permissions, which allow them to perform all functions, including project management, task management, and configuration management. If the logged-in user is identified as an application engineer, the application engineer has limited permissions, which allow them to perform some functions, including code submission, viewing projects, and viewing tasks. If the logged-in user is identified as an observer, the observer has read-only permissions, which allow them to view projects and results.
[0107] Project management functionality can be achieved through the project management module on the target webpage. This module enables project lifecycle management, including three phases: project initialization, active development, and archiving completion. Each project is associated with a Git repository address, Jenkins task name, and build configuration template. Project member management provides fine-grained access control; integration engineers can manage global project settings, while application layer engineers can only access authorized projects. The project configuration system supports multi-environment configuration management, allowing the definition of build parameters for different environments such as development, testing, and production. Configuration versioning ensures change traceability and supports configuration rollback to historical versions. A configuration inheritance mechanism allows sub-projects to inherit the basic settings of their parent projects, while also supporting specific overriding.
[0108] Figure 9 This is a schematic diagram illustrating the process of sending a notification on a target webpage according to an embodiment of this application, such as... Figure 9 As shown, after triggering the notification event on the target webpage, the time zone of the recipient's location is first determined. Based on the time zone, it is then determined whether the current time falls within the recipient's working hours. If the current time is determined to be within working hours, the corresponding notification information can be sent to the recipient immediately. If the current time is determined not to be within working hours, the corresponding notification information can be sent at a scheduled time during the recipient's working hours. The notification events can include code commit events, code build (compilation) events, code build completion events, and code review events. The corresponding recipients can be application engineers and / or integration engineers, code committers, personnel involved in code build, and code reviewers.
[0109] Optionally, after determining the notification sending method, the priority of the event to be notified can be obtained, and then the notification sending form can be determined based on the priority. If the priority of the event is determined to be high priority, the notification sending form can be determined to include SMS, email and message; if the priority of the event is determined to be medium priority, the notification sending form can be determined to include email and message; if the priority of the event is determined to be low priority, the notification sending form can be determined to be message.
[0110] Optionally, after determining the form and method of sending the notification, the notification is sent to the corresponding recipient according to the form and method. After a successful send, the corresponding sending information is recorded in the log for easy reference.
[0111] The above embodiments describe in detail the code compilation method provided by the embodiments of this application. In other embodiments, this application also provides a code compilation apparatus. Figure 10 This is a block diagram of a code compilation apparatus according to an embodiment of this application, such as Figure 10 As shown, the code compilation device 600 includes: a user determination module 610, a target code acquisition module 620, a first compilation module 630, and a second compilation module 640.
[0112] User identification module 610 is used to obtain login information on the target webpage and determine the logged-in user as the first user based on the login information; target code acquisition module 620 is used to obtain the target code uploaded by the first user under the first user's first permissions, wherein when the first user has the first permissions, the first permissions are configured to support code submission and local automatic compilation; first compilation module 630 is used to compile the target code and generate a target file if the analysis of the target code determines that the change type of the target code is a logical change; second compilation module 640 is used to generate review prompt information based on the target code and compile the target code based on the review feedback if the analysis of the target code determines that the change type of the target code is an interface change; the review feedback is determined based on the review prompt information.
[0113] In some embodiments, the second compilation module 640 includes: a compilation submodule, configured to compile the target code to generate a target file if the review feedback indicates that the target code has passed the review; and a modification prompt submodule, configured to generate modification prompt information and provide a prompt to the first user based on the modification prompt information if the review feedback indicates that the target code has not passed the review.
[0114] In some embodiments, the compilation submodule includes: an acquisition unit for acquiring a compilation environment and base code; a compilation unit for compiling the target code and the base code in the compilation environment to obtain a compilation result; an error information generation unit for generating an error message if the compilation result indicates that the target code has not been successfully compiled; and a target file generation unit for generating the target file if the compilation result indicates that the target code has been successfully compiled.
[0115] In some embodiments, the code compilation device 600 further includes: a sending method determination module, configured to determine the sending method of the review prompt information based on the target time zone and the timestamp corresponding to the review prompt information; a prompting method determination module, configured to obtain the notification priority of the review prompt information and determine the prompting method of the review prompt information based on the notification priority, wherein the prompting method includes at least one or a combination of SMS prompts, email prompts, and message prompts; and a sending module, configured to send the review prompt information to the person to be reviewed through the prompting method and the sending method.
[0116] In some embodiments, the sending method determination module includes: a first determination submodule, configured to determine that the sending method is immediate sending if the current time is determined to be the working time of the person to be reviewed based on the target time zone and the timestamp corresponding to the review prompt information; and a second determination submodule, configured to determine that the sending method is timed sending if the current time is determined to be the non-working time of the person to be reviewed based on the target time zone and the timestamp corresponding to the review prompt information, wherein the timed sending is sent during the working time of the person to be reviewed.
[0117] In some embodiments, the code compilation device 600 further includes: a first determining module, configured to determine whether to receive a review prompt message under the second user's second permissions if the logged-in user is determined to be a second user based on the login information, wherein when the second user has the second permissions, the second permissions are configured to support viewing code, remote collaborative compilation, and local automatic compilation; a first display module, configured to display the code to be reviewed based on the review prompt message if the review prompt message is received; and a response module, configured to respond to the second user's review operation, generate review feedback, and provide a prompt to the user who uploaded the code to be reviewed based on the review feedback.
[0118] In some embodiments, the code compilation device 600 further includes: a second display module, configured to display target content in response to the third user's viewing operation on the target webpage according to the third permission if the login user is determined to be a third user based on the login information, wherein when the third user has the third permission, the third permission is configured to support viewing the code.
[0119] According to one aspect of the embodiments of this application, an electronic device is also provided, such as... Figure 11 As shown, the electronic device 700 also includes a processor 710 and one or more memories 720. The one or more memories 720 are used to store program instructions executed by the processor 710. When the processor 710 executes the program instructions, it implements the code compilation method described above.
[0120] Furthermore, the processor 710 may include one or more processing cores. The processor 710 runs or executes instructions, programs, code sets, or instruction sets stored in the memory 720, and retrieves data stored in the memory 720. Optionally, the processor 710 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 710 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor and may be implemented using a separate communication chip.
[0121] According to one aspect of this application, a computer-readable storage medium is also provided, which may be included in the cloud server described in the above embodiments; or it may exist independently and not assembled into the cloud server. The aforementioned computer-readable storage medium carries computer-readable instructions that, when executed by a processor, implement the methods in any of the above embodiments.
[0122] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. Computer-readable storage media can be, for example, but not limited to: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0123] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0124] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0125] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A code compilation method, characterized in that, The method includes: Obtain the login information on the target webpage, and determine the logged-in user as the first user based on the login information; Under the first user's first permission, the target code uploaded by the first user is obtained, wherein when the first user has the first permission, the first permission is configured to support code submission and local automatic compilation; If analysis of the target code determines that the change type of the target code is a logical change, then the target code is compiled to generate a target file; If the analysis of the target code determines that the change type of the target code is an interface change, then an audit prompt message is generated based on the target code, and the target code is compiled based on the audit feedback; the audit feedback is determined based on the audit prompt message.
2. The method according to claim 1, characterized in that, The step of compiling the target code based on the review feedback includes: If the review feedback indicates that the target code has passed the review, then the target code is compiled to generate a target file; If the review feedback indicates that the target code has not passed the review, a modification prompt message is generated, and the first user is prompted based on the modification prompt message.
3. The method according to claim 2, characterized in that, The process of compiling the target code to generate a target file includes: Obtain the compilation environment and basic code; In the compilation environment, the target code and the base code are compiled to obtain the compilation result; If the compilation result indicates that the target code has not been compiled successfully, an error message is generated; If the compilation result indicates that the target code has been compiled successfully, then the target file is generated.
4. The method according to claim 1, characterized in that, The review prompt information includes the target time zone of the location of the person to be reviewed. After generating the review prompt information based on the target code, the method further includes: The method of sending the review prompt information is determined based on the target time zone and the timestamp corresponding to the review prompt information. The notification priority of the review prompt information is obtained, and the prompting method of the review prompt information is determined according to the notification priority, wherein the prompting method includes at least one or a combination of SMS prompts, email prompts and message prompts; The review notification information is sent to the person to be reviewed using the aforementioned notification and sending methods.
5. The method according to claim 4, characterized in that, The step of determining the sending method of the review prompt based on the target time zone and the timestamp corresponding to the review prompt information includes: If the current working time of the person to be reviewed is determined based on the target time zone and the timestamp corresponding to the review prompt information, then the sending method is determined to be immediate sending; If it is determined that the current time is the non-working time of the person to be reviewed based on the target time zone and the timestamp corresponding to the review prompt information, then the sending method is determined to be scheduled sending, wherein the scheduled sending is sent during the working time of the person to be reviewed.
6. The method according to any one of claims 1-5, characterized in that, After obtaining the login information on the target webpage, the method further includes: If the login user is determined to be the second user based on the login information, then it is determined whether an audit prompt message is received under the second user's second permissions. When the second user has the second permissions, the second permissions are configured to support viewing the code, remote collaborative compilation, and local automatic compilation. If a review prompt is received, the code to be reviewed will be displayed based on the review prompt. In response to the second user's review operation, a review feedback is generated, and a prompt is given to the user who uploaded the code to be reviewed based on the review feedback.
7. The method according to any one of claims 1-5, characterized in that, After determining the target user's user permissions based on the login information, the method further includes: If the login user is determined to be a third user based on the login information, the target content is displayed in response to the third user's viewing operation on the target webpage according to the third permission. When the third user has the third permission, the third permission is configured to support viewing the code.
8. A code processing apparatus, characterized in that, The device includes: The user identification module is used to obtain login information on the target webpage and identify the logged-in user as the first user based on the login information. The target code acquisition module is used to acquire the target code uploaded by the first user under the first user's first permission, wherein when the first user has the first permission, the first permission is configured to support code submission and local automatic compilation. The first compilation module is used to compile the target code and generate a target file if the analysis of the target code determines that the change type of the target code is a logical change. The second compilation module is used to generate review prompt information based on the target code if the analysis of the target code determines that the change type of the target code is an interface change, and to compile the target code based on the review feedback; the review feedback is determined based on the review prompt information.
9. An electronic device, characterized in that, The electronic device includes: processor; A memory storing computer-readable instructions that, when executed by the processor, implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1 to 7.