Code arrangement method, device, equipment, medium and program product
By using periodic summarization and related call analysis methods, combined with a standard correction model, automated code standardization management is achieved, solving the problem of low code organization efficiency in existing technologies, improving code standardization and consistency, and enhancing development efficiency and quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE INTERNET CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, code cleanup methods rely on static rules that are manually maintained and updated, resulting in low code cleanup efficiency and difficulty in achieving efficient standardization and consistency management.
By periodically summarizing the code set under each task, performing correlation call analysis, determining correlation call relationships, and using the specification correction model to perform dependency iteration mixing and target specification adjustment, automated code specification management and updates are achieved.
It improves code standardization and consistency, reduces manual intervention, enhances development and code organization efficiency, lowers maintenance costs, and ensures dynamic adjustment of code quality and overall quality.
Smart Images

Figure CN122173124A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet technology, and in particular to a code organization method, apparatus, device, medium, and program product. Background Technology
[0002] In related technologies, code cleanup methods are typically implemented through built-in IDE (Integrated Development Environment) formatting plugins and code style checking platforms. For example, IDE plugins can be deployed within the IDE to perform real-time checks as code is written; code style checking platforms can automatically or manually trigger tasks to acquire target code for inspection. Both of these methods use static rules that rely on manual maintenance and updates, leading to relatively low code cleanup efficiency. Summary of the Invention
[0003] This disclosure provides a code organization method, apparatus, device, medium, and program product.
[0004] According to a first aspect of this disclosure, a code organization method is provided, comprising:
[0005] Periodically summarize the code set under each task to obtain the first target specification for the task code update of each code set in the current period; An association call analysis is performed on the interfaces and implementations of different code sets to obtain the association call relationship; wherein, the association call relationship includes the association call initiation point and the association call implementation point; Based on the associated call relationship, determine the associated call implementation point code set set and the associated call initiation point code set set corresponding to the associated call initiation point of each code set, and obtain the second target specification of the associated call implementation point code set set and the third target specification of the associated call initiation point code set set. Based on the second target specification and the third target specification, the first target specification is subjected to dependency iteration mixing to obtain the dependency iteration target specification; The updated code set is determined by processing the dependency iteration target specification and the dependency iteration target specification in the previous cycle through the specification correction model.
[0006] According to a second aspect of this disclosure, a code organization apparatus is provided, comprising: The summary module is used to periodically summarize the code of the code set under each task to obtain the first target specification of the task code update for each code set in the current period; The analysis module is used to perform associated call analysis on the interfaces and implementations of different code sets to obtain associated call relationships; wherein, the associated call relationship includes the associated call initiation point and the associated call implementation point; The specification determination module is used to determine, based on the associated call relationship, the associated call initiation point code set set and the associated call initiation point code set set corresponding to the associated call initiation point of each code set, and to obtain the second target specification of the associated call implementation point code set set and the third target specification of the associated call initiation point code set set. The iteration module is used to perform dependency iteration mixing on the first target specification according to the second target specification and the third target specification to obtain the dependency iteration target specification; The update module is used to process the dependency iteration target specification and the dependency iteration target specification in the previous cycle through the specification correction model to determine the updated code set.
[0007] According to a third aspect of this disclosure, an electronic device is provided, comprising: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect above.
[0008] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method described in the first aspect above.
[0009] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in the first aspect above.
[0010] In this embodiment, by periodically summarizing the code sets under each task, a first target specification for the task code update of each code set within the current period is obtained. Association call analysis is performed on the interfaces and implementations of different code sets to obtain association call relationships. These association call relationships include the initiating point and implementation point of the association call. Based on these relationships, the set of code sets corresponding to the initiating point of each code set and the set of code sets corresponding to the initiating point of the association call are determined. A second target specification for the set of code sets corresponding to the implementation point of the association call and a third target specification for the set of code sets corresponding to the initiating point of the association call are then obtained. Based on the second and third target specifications, the first target specification is iteratively mixed with dependencies to obtain a dependency iteration target specification. A specification correction model is used to process the dependency iteration target specification and the dependency iteration target specification from the previous period to determine the updated code set. This allows for periodic specification management, dependency analysis, and code updates for code sets. This not only improves code standardization and consistency but also reduces manual intervention through automation, improving development and code organization efficiency. Furthermore, by relying on iterative hybrid and specification correction models, code standards can be dynamically adjusted to ensure consistent code quality across different cycles, thereby improving the overall quality of software development, reducing maintenance costs, and increasing collaboration efficiency.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 A flowchart illustrating a code organization method provided in an embodiment of this disclosure; Figure 2 A flowchart illustrating another code organization method provided in this embodiment of the disclosure; Figure 3 This is a schematic diagram of the structure of the code organization device provided in an embodiment of this disclosure. Detailed Implementation
[0013] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0014] The code organization methods, apparatus, devices, media, and program products of this disclosure are described below with reference to the accompanying drawings.
[0015] Figure 1 This is a flowchart illustrating a code organization method provided in an embodiment of this disclosure, which can be applied to a code management platform. For example... Figure 1 As shown, this code organization method includes the following steps: Step 101: Periodically summarize the code set under each task to obtain the first target specification for the task code update of each code set in this period.
[0016] In this embodiment of the disclosure, during the software development process, the code management platform can periodically (e.g., in units of period T) summarize and analyze the enterprise's code set. For example, it can collect the code update status of each code set under various tasks, and by refining and analyzing these code updates, form the target specification G for each period, i.e., the first target specification G. The first target specification G can be a feature matrix that reflects the standardization and consistency of code updates.
[0017] Step 102: Perform association call analysis on the interfaces and implementations in different code sets to obtain the association call relationship.
[0018] Among them, the associated call relationship includes the associated call initiation point and the associated call implementation point.
[0019] In this embodiment of the disclosure, a joint call inspection mechanism can be used to analyze the call relationships between interfaces and implementations in different code sets. For example, the implementations of interfaces in different code sets can be identified, and the call chains between interfaces and implementations in different code sets can be analyzed to identify the initiation and implementation points of related calls. Through deep tracing, the integrity of the call chain can be ensured.
[0020] Step 103: Based on the associated call relationship, determine the associated call implementation point code set set and the associated call initiation point code set set corresponding to the associated call initiation point of each code set, and obtain the second target specification of the associated call implementation point code set set and the third target specification of the associated call initiation point code set set.
[0021] In this embodiment of the disclosure, after determining the associated call relationships between code sets, the dependencies of each code set can be further analyzed. For example, the dependent code set set (e.g., the associated call implementation point code set set PD) and the dependent code set set (e.g., the associated call initiation point code set set PP corresponding to the associated call implementation point) of each code set can be identified, and the second target specification GD and the third target specification GP of these sets (including the associated call implementation point code set set PD and the associated call initiation point code set set PP) within the current period T can be obtained. Thus, by analyzing the dependencies of the code sets, data support can be provided for subsequent target specification merging.
[0022] Step 104: Based on the second target specification and the third target specification, perform dependency iteration mixing on the first target specification to obtain the dependency iteration target specification.
[0023] In this embodiment, after obtaining the second target specification of the set of associated call implementation point code sets and the third target specification of the set of associated call initiation point code sets, the platform performs dependency iteration mixing with the task code update target specification G of the code set itself. For example, a dependency iteration target specification G' can be generated through weight allocation and mixing operations. As an example, different weights can be assigned to the target specifications according to the intensity of associated calls, and the final dependency iteration target specification can be generated through weighted mixing operations. This not only considers the update specification of the code set itself but also incorporates the influence of dependencies, resulting in a more comprehensive and accurate target specification.
[0024] Step 105: The updated code set is determined by processing the dependency iteration target specification and the dependency iteration target specification in the previous cycle through the specification correction model.
[0025] In this embodiment of the disclosure, an AI-based specification correction model M can be used to process the dependency iteration target specification and the dependency iteration target specification of the previous period to obtain an updated code set. For example, the specification correction model M can perform style specification adjustments on the code set, such as calculating the target specification correction GA based on the current period's dependency iteration target specification G' and the previous period's dependency iteration target specification GT'. Then, the specification correction model M can update the code set based on the target specification correction GA to ensure that the code conforms to the latest specification requirements.
[0026] In this embodiment, by periodically summarizing the code sets under each task, a first target specification for the task code update of each code set within the current period is obtained. Association call analysis is performed on the interfaces and implementations of different code sets to obtain association call relationships. These association call relationships include the initiating point and implementation point of the association call. Based on these relationships, the set of code sets corresponding to the initiating point of each code set and the set of code sets corresponding to the initiating point of the association call are determined. A second target specification for the set of code sets corresponding to the implementation point of the association call and a third target specification for the set of code sets corresponding to the initiating point of the association call are then obtained. Based on the second and third target specifications, the first target specification is iteratively mixed with dependencies to obtain a dependency iteration target specification. A specification correction model is used to process the dependency iteration target specification and the dependency iteration target specification from the previous period to determine the updated code set. This allows for periodic specification management, dependency analysis, and code updates for code sets. This not only improves code standardization and consistency but also reduces manual intervention through automation, improving development and code organization efficiency. Furthermore, by relying on iterative hybrid and specification correction models, code standards can be dynamically adjusted to ensure consistent code quality across different cycles, thereby improving the overall quality of software development, reducing maintenance costs, and increasing collaboration efficiency.
[0027] In some possible implementations, the code sets are periodically aggregated under each task to obtain the first target specification for the task code updates of each code set within the current period, including: For any code set, obtain the target specification of the code set in the previous cycle and the target specification in the current cycle; Read the code updates and code update templates for the code set within the current cycle; Based on the code updates of the code set in this cycle, the code update template code, the target specifications of the previous cycle, and the target specifications of the current cycle, determine the first target specification for the task code updates of each code set in this cycle and store it in the specification database.
[0028] In this embodiment, for any code set, the target specification (PG) of the code set in the previous period and the target specification (G) of the current period can be obtained first. These target specifications can be feature matrices extracted based on the code updates of the code set under various tasks, reflecting the code's compliance requirements. Then, all code updates (PU) of the code set in the current period can be read to form a code set. Simultaneously, the code specification update template code (UM) can also be read. The code update template code can be a verified, specification-compliant code example that can be used to guide the code updates in the current period. Afterwards, based on the code updates in the current period, the code update template code, the target specification PG of the previous period, and the target specification G of the current period, the first target specification for the task code updates of each code set in the current period can be determined. It is understood that the determined first target specification G can also be stored in the specification database DB to provide basic data support for subsequent code management and specification integration. Thus, by combining the target specifications from the previous cycle, the code updates of the current cycle, and exemplary code to determine the primary target specification, on the one hand, dynamic updates and continuous optimization of code specifications can be achieved. This not only ensures that code updates comply with the latest specification requirements but also reduces manual intervention and specification deviations caused by human error by introducing exemplary code and specification correction models, thereby improving code quality. On the other hand, the automated specification extraction and update process can also simplify the workload of developers in code specification management, thereby improving development efficiency and shortening project cycles.
[0029] In some possible implementations, based on the code updates of the code set within the current cycle, the code update template code, the target specification of the previous cycle, and the target specification of the current cycle, the first target specification for the task code updates of each code set within the current cycle is determined, including: When the code update template code is empty, the target specification of the previous cycle is determined as the first target specification; When the code update template is not empty, the read code update template is used as the original input of the specification correction model. The output matrix is obtained through the specification correction model inference, and the output matrix is used as the target specification update. Based on the target specifications and target specification updates of the previous cycle, the first target specification is determined.
[0030] In this embodiment, if the code update template code (UM) is empty within the current cycle, it indicates that there is currently no new template code as a reference for specification updates. In this case, to maintain the continuity and stability of the code specification, the target specification (PG) of the previous cycle can be directly used as the first target specification (G) for the current cycle. This ensures that even in the absence of new specification guidance, code updates can still follow existing, validated specifications, avoiding confusion or inconsistencies caused by missing specifications. If the code update template code (UM) is not empty, it indicates that there are new template codes available for reference. In this case, these template codes can be used as input to the specification correction model (M). The specification correction model generates an output matrix (UG) through inference, which reflects the specification update based on the new template code, transforming the new template code into a specific specification update, ensuring that the code specification can reflect the latest coding practices and standards in a timely manner. After obtaining the target specification update (UG), the target specification (PG) of the previous cycle can be combined with the target specification update (UG), and the first target specification (G) for the current cycle can be determined through certain calculation methods (such as weighted summation, normalization, etc.). This approach allows for flexible handling of code style updates. When new model code is lacking, the style from the previous cycle is directly inherited, ensuring continuity and stability. Conversely, when new model code becomes available, the style modification model uses reasoning to generate an updated target style, which is then combined with the old style to create a new target style. This not only dynamically adapts to code update needs but also leverages the reasoning capabilities of the AI model to ensure the scientific validity and adaptability of the style, further improving code quality.
[0031] In some possible implementations, an association call analysis is performed on the interfaces and implementations in different code sets to obtain the association call relationships, including: For any code set, identify the implementation corresponding to each interface in the code set; Based on the call chain of interfaces and implementations between different code sets, the associated call initiation point and associated call implementation point are determined, and the associated call relationship is obtained.
[0032] In this embodiment of the disclosure, during associated call analysis, the interfaces and their implementations within each code set can be identified and matched. For example, each code set can be traversed to identify all defined interfaces (I) and find the corresponding implementation code (R) for each interface. For instance, in object-oriented programming, an interface defines the signature of a method, while the implementation is the code within a specific class that implements these methods. This step clearly reveals the correspondence between interfaces and implementations in each code set, laying the foundation for subsequent call chain analysis. After identifying the correspondence between interfaces and implementations in the code set, the call relationships between different code sets can be further analyzed. For example, the call path of each interface can be traced, starting from the call initiation point (S) and following the call chain to the call implementation point (E). Here, the call initiation point can refer to the location in the code where the interface call is initiated, while the call implementation point can refer to the location where the implementation code of the interface method is actually executed. By analyzing the call chain, the dependencies between different code sets can be determined, identifying which code sets depend on the interface implementations of other code sets. Finally, all identified call relationships can be aggregated to form a complete call relationship graph, where each node represents an interface or implementation of a code set, and edges represent call relationships. In this way, by analyzing the call relationships between interfaces and implementations in different code sets, the dependencies between code sets can be comprehensively and accurately identified. This not only helps in understanding the code structure and interactions between modules but also provides important basis for subsequent code management and optimization. Furthermore, it helps identify potential circular dependency problems, allowing for early optimization, improving system maintainability and stability, and further enhancing organization efficiency and code quality.
[0033] In some possible implementations, after determining the associated call initiation point and associated call implementation point based on the call chain of interfaces and implementations between different code sets, and obtaining the associated call relationship, the process further includes: Generate a circular call dependency graph based on the associated call relationships; Determine the dependency aggregation angle based on the cyclic call dependency graph; Based on the associated call relationships, after determining the associated call implementation point code set set and the associated call initiation point code set set corresponding to the associated call initiation point for each code set, and obtaining the second target specification of the associated call implementation point code set set and the third target specification of the associated call initiation point code set set, the process also includes: The target specification offset angle that the third target specification depends on within this period is determined based on the mapping length.
[0034] In this embodiment, after determining the initiation and implementation points of related calls between different code sets, a circular call dependency graph (GL) can be generated based on these call relationships. This GL uses the interfaces and implementations of the code sets as nodes and the call relationships as edges to visually display the dependencies between code sets. By constructing the GL, it is possible to clearly identify which code sets have direct or indirect call relationships and whether circular dependencies exist. Circular dependency refers to code set A calling code set B, and code set B calling code set A. This dependency relationship may lead to deadlocks or performance issues during system runtime. Then, after generating the GL, the platform further analyzes the dependencies in the graph to determine the dependency aggregation angle. The dependency aggregation angle can be calculated by analyzing the weights of all call edges in the graph, reflecting the strength and pattern of the dependency relationship between code sets. For example, if there are frequent call relationships between two code sets and the call depth is deep, their dependency aggregation angle will be large, indicating a strong dependency relationship between the two code sets. By determining the dependency aggregation angle, the degree of coupling between code sets can be better understood, providing a basis for subsequent code optimization and refactoring. As a concrete example, determining the dependency aggregation angle A calculation example can be shown below:
[0035]
[0036] Where n is the total number of related call edges; | GL |This represents the total weight of the graph, which helps identify high-risk circular call paths; To iteratively call the edge weights of the dependent graph GL; The coupling degree function is denoted as 'a' (e.g., 1) when both parties call the service management platform. Otherwise, the value is 'b' (e.g., 0.5) when both parties use the same technology, and 'c' (e.g., 0.2) when both parties use different technologies. ) represents the model output value when performing AI-based interface link consistency analysis between interface implementations.
[0037] After determining the associated call relationships, the dependencies of each code set can be further analyzed. For example, for each code set P, the dependent code set set (PD) and the dependent code set set (PP) can be identified. After obtaining the second target specification (GD) of the dependent code set set and the third target specification (GP) of the dependent code set set, the relationships between these target specifications can be further analyzed. For example, the target specification offset angle of the third target specification within the current period can be determined based on the mapping length. Here, the mapping length refers to the length of the mapping relationship between the target specifications of the dependent code set set and the dependent code set set, reflecting the similarity and differences in target specifications between the two sets. By calculating the mapping length, the platform can determine the target specification offset angle of the third target specification, that is, the direction and degree of adjustment of the third target specification relative to the second target specification. This offset angle helps the platform better understand the dependencies between code sets, providing a basis for subsequent target specification adjustments. As a concrete example, determining the target specification offset angle... A calculation example can be shown below:
[0038]
[0039]
[0040] in, The length of the target specification GP dependency target specification mapping within period T; The dependency target specification mapping matrix can be obtained by combining the dependency target specification GD and the dependent target specification GP to establish a complete dependency target specification mapping relationship for the code set P; For the target specification of the dependent code set d; The target specification for the dependent code set p; associated call strength For code collection The amount of code interacting between the code set PD and DP accounts for a significant portion of the code set. The proportion of total code volume.
[0041] This approach allows for a comprehensive and systematic analysis of dependencies between code sets, enabling the generation of circular call dependency graphs, determination of dependency aggregation angles, and calculation of target specification offset angles. This not only helps identify the degree of coupling between code sets but also provides crucial information for code optimization and refactoring. Furthermore, by determining the dependency aggregation angle and target specification offset angle, a better understanding of the interactions between code sets can be achieved, providing a scientific basis for the dynamic adjustment of code specifications. This, in turn, effectively improves code quality, ensures the standardization and consistency of the software development process, and provides strong guarantees for software stability and maintainability.
[0042] In some possible implementations, the first target specification is iteratively mixed with the second and third target specifications to obtain a dependency iterative target specification, including: Based on the intensity of associated calls, assign weights to the first target specification, the second target specification, and the third target specification; Based on the dependency aggregation perspective, the target specification offset perspective, and the respective weights of the first target specification, the second target specification, and the third target specification, the dependency iteration target specification is determined.
[0043] In this embodiment of the disclosure, before performing dependency iteration mixing, weights can be assigned to the first target specification (G), the second target specification (GD), and the third target specification (GP) based on the intensity of the associated invocation (denoted as ). , , The weight allocation method can be based on system configuration parameters or dynamically calculated to ensure that the weights reflect the actual impact of the call relationships. After allocating weights, the dependency iteration target specification (G') can be further determined by combining the dependency aggregation angle and the target specification offset angle. The dependency aggregation angle reflects the overall strength of the dependencies between code sets, while the target specification offset angle reflects the direction and degree of adjustment of the third target specification relative to the second target specification. For example, the method for determining the dependency iteration target specification can be as follows:
[0044]
[0045] Wherein, WG represents the weights assigned to the target specifications G, GD, and GP. , , The weights and sums.
[0046] In some possible implementations, the updated code set is determined by processing the dependency iteration target specification and the dependency iteration target specification in the previous cycle through a specification correction model, including: Retrieve the dependency iteration target specification of the code set in the current cycle, and the dependency iteration target specification in the previous cycle; Based on the dependency iteration target specification in the current cycle and the dependency iteration target specification in the previous cycle, determine the target specification revision; The target specification is adjusted using a specification correction model to obtain an updated code set.
[0047] In this embodiment of the disclosure, before performing code style correction, it is necessary to obtain the dependency iteration target style (G') for the current cycle and the dependency iteration target style (GT') for the previous cycle. After obtaining the dependency iteration target styles for the current cycle and the previous cycle, the target style correction (GA) can be calculated. For example, the target style correction (GA) can be calculated as follows:
[0048]
[0049]
[0050]
[0051] Where m is the number of dimensions of the target specification; Indicates the correction angle; Represents the difference matrix; The strength of the correction to the difference matrix is represented by the difference matrix. Sensitivity to change Multiplying them together yields the result. Sensitivity to change.
[0052] Then, after determining the target specification (GA), an AI-based specification correction model (M) can be used to automatically adjust the code set to conform to the latest specification requirements. This allows for automatic adjustment of the code set based on the dependency iteration target specification and the dependency iteration target specification from the previous cycle, thereby further reducing manual intervention, improving the efficiency of code standardization, and ensuring the scientific nature and accuracy of code adjustments.
[0053] In some possible implementations, the target specification is adjusted using a specification correction model to obtain an updated code set, including: The code set is style-cleaned and segmented to obtain smaller code segments; Encode the code segments and fill in the gaps to obtain the input for the specification correction model; The canonical correction model derives the result matrix based on input reasoning; Based on the results matrix and target specification correction, the model style difference degree is determined; When any element in the model style difference is greater than the minimum value of the style difference termination, the model style difference is backpropagated in the canonical correction model. The iteration ends when the model style difference is less than or equal to the minimum style difference threshold, or when the difference between the model style difference and the previous style difference is divided by the current model style difference within the style difference update termination gradient range, or when the model style difference is greater than the previous style difference for a preset number of consecutive occurrences or when the maximum number of iterations is reached. The code set after the iteration is completed is de-encoded to obtain the updated code set.
[0054] In this embodiment, when the target specification is adjusted using a specification correction model to obtain an updated code set, the code set can be preprocessed before specification adjustment. This preprocessing includes style removal: removing stylistic markers such as carriage returns, line breaks, tabs, spaces, assignment operators, parentheses, underscores, arrows, and syntax keywords from the code. While these markers improve code readability, they may interfere with model inference during specification adjustment. Segmentation involves dividing the code into multiple segments based on stylistic markers (such as line breaks and parentheses). Each segment contains a logically independent code fragment. For example, a function body or a code block can be considered a segment. Through style removal and segmentation, the code set can be decomposed into more manageable segments, preparing it for subsequent encoding and model inference. After obtaining the code segments, each segment can be encoded. For example, the BERT model can be used to encode each segment, with padding spaces added before and after the encoding of each segment. By encoding and padding gaps, input data for the model can be generated to ensure that the model can correctly understand and process code snippets.
[0055] Then, the encoded input data can be fed into the canonical correction model (M). The canonical correction model will perform inference based on the input data and generate an outcome matrix (RD). After the model generates the outcome matrix, the style dissimilarity (L) of the canonical correction model can be calculated to evaluate the difference between the model output and the target canonical correction (GA). For example, by comparing the outcome matrix (RD) and the target canonical correction (GA), the difference value of each element can be calculated to obtain the model style dissimilarity matrix, such as... L=RD GA If any element in the model style dissimilarity is greater than the minimum terminating value (Lm) of the style dissimilarity, backpropagation can be performed in the canonical correction model. For example, the model style dissimilarity (L) can be used as an error signal to update the model parameters through the backpropagation algorithm, adjusting the model output to make it closer to the target canonical correction (GA). During the backpropagation process, the canonical correction model can adjust its internal parameters according to the error signal to optimize the inference results of the canonical correction model.
[0056] The iteration can end if the model style difference is less than or equal to the minimum style difference threshold, or if the difference between the model style difference and the previous style difference divided by the current model style difference falls within the style difference update termination gradient range, or if the model style difference is greater than the previous style difference for a predetermined number of consecutive occurrences or the maximum number of iterations is reached. For example, after each backpropagation, the following conditions are checked to determine whether to end the iteration: Is the style difference less than or equal to the style difference termination minimum? If all elements in the model style difference (L) are less than or equal to the style difference termination minimum (Lm), it means that the model output is close enough to the target specification and the iteration can end.
[0057] Style difference update termination gradient: Calculate the difference between the current model style difference and the previous style difference, and divide it by the current model style difference. If this result is within the range of the style difference update termination gradient (Lg), it indicates that the model adjustment has stabilized and the iteration can end.
[0058] If the model style difference is greater than the previous style difference for more than a preset number of consecutive occurrences, it indicates that the model may be trapped in a local optimum and cannot be further optimized. In this case, the iteration can be terminated.
[0059] Reaching the maximum number of iterations: If the number of iterations reaches the system's preset maximum number of iterations (Im), the iteration will end regardless of whether the model style difference meets the above conditions.
[0060] After the iteration, the platform de-encodes the adjusted code set. For example, the model's output matrix (RD) can be de-encoded using BERT (Bidirectional Encoder Representations from Transformers) to convert the vector representation back into code text. The previously removed stylistic markers, such as line breaks and spaces, are then restored in the de-encoded code text to ensure readability. This ensures that the adjusted code not only conforms to specifications but also has good readability, thereby further improving code quality, reducing manual intervention, and significantly increasing development efficiency.
[0061] In some possible implementations, after determining the updated code set by processing the dependency iteration target specification and the dependency iteration target specification in the previous cycle through the specification correction model, the following steps are also included: Submit the updated code set to the target user.
[0062] In this embodiment of the disclosure, after the code set is standardized and an updated code set is generated through the specification correction model, the updated code can be submitted to the target user to ensure that the updated code can be received and used by the development team or relevant users.
[0063] To make the methods provided in this disclosure clearer, the following examples will be used for illustration.
[0064] This disclosure provides an enterprise-level code joint organization and standardization integration method (code organization method). By building a standardization database, using dependency graphs and updated template code, it can automate the inspection and integration of task code, improve style consistency, optimize code quality, and solve the problem of code structure and standardization deviation caused by personnel changes and the passage of time. In particular, it can prevent the disruption of management standards when AI (artificial intelligence) generated code is integrated into the code set.
[0065] See Figure 2 The code cleanup methods include the following processing: Step 1: The code management platform establishes a standardized database DB based on a cycle T, regularly summarizes the code of all code sets within the enterprise under various tasks, extracts the target specifications, and obtains the target specifications G for the code update PU of each task within each cycle T.
[0066] By refining the task objective specification G within cycle T, a foundational basis is provided for cross-cycle specification integration.
[0067] The code management platform establishes a specification database DB to store the target specifications of each code set under each task cycle T. At the end of each cycle T, a joint extraction process of target specifications is executed to obtain the target specifications G of the task code in this cycle T, and then the G is stored in the specification database DB.
[0068] Wherein, any target specification G[i] in the target specification G is a feature matrix. The process of performing the joint extraction of target specifications to obtain the target specifications G of the task in this period T is as follows: (1) Obtain the target specification PG of code set P in the previous cycle TP; (2) Obtain the code and the target specification G of P in the current period T; <1> Read all the code in code set P within cycle T and update PU to form a code set. ; First, all code updates PU within code set P within period T are read as update points. Then, the files containing all update points are treated as code segments to form a code set. .
[0069] <2> Read the code specification update template code UM. When the code specification update template code UM is empty, the target specification G of the current period T is the target specification PG of the previous period TP.
[0070] <3> When the code specification update template code UM is not empty, the read code specification update template code UM is used as the original input of the specification correction model M, and the output matrix obtained by model inference is used as the target specification update UG.
[0071] <4> After adding the target specification PG and the target specification update UG from the previous period's TP, normalizing each element in the matrix, the resulting final matrix serves as the code set. The target specification G is:
[0072] Here, sigmoid is the normalized activation function.
[0073] (3) After obtaining the target specification G of the task code within this period T, store it in the specification database DB.
[0074] For a detailed explanation of the standardization correction model M, please refer to step 6.
[0075] Step 2: The code management platform adopts a joint call inspection mechanism to analyze the associated calls of interfaces and implementations in different code sets, obtain the associated call initiation point and associated call implementation point, and construct a circular call dependency graph (GL) based on the associated call relationship between code sets.
[0076] (1) Traverse all code sets P and their interfaces I and implementations R, and perform associated call analysis in sequence according to the joint call checking mechanism to establish multiple associated call relationships; <1> For each interface I within code set P, identify its corresponding implementation R; The methods used for joint call analysis of Interface I include: relational calls of the service management platform and interface link consistency analysis based on artificial intelligence (this method uses artificial intelligence to mark all call codes of each platform and compares the path in the call parameters with the paths of all service interfaces; if they match, it is a call).
[0077] <2> Analyze the call chain between interface I and implementation R of different code sets to determine the associated call initiation point S and implementation point E; <3> If multi-level or cross-codeset calls are found, continue deep tracing until the call chain is stable.
[0078] (2) Construct a set of associated calls for all identified associated call relationships. Based on the associated call chain, a circular call dependency graph (GL) is generated, where nodes represent code set interfaces and implementations, and edges represent call relationships. Among them, the edge weights of the dependent graph GL are called in a loop. Defined as:
[0079] in, This is a coupling degree function. When both parties call the service management platform, this value is 1; otherwise, when both parties use the same technology, this value is 0.5; and when both parties use different technologies, this value is 0.2. ) represents the model output value when performing AI-based interface link consistency analysis between interface implementations.
[0080] (3) Edge weights based on cyclic calls to the dependency graph GL Analyze the strength and pattern of circular dependencies to determine the angle of dependency aggregation. :
[0081] Where n is the total number of related call edges, and |GL| is the total graph weight, which helps to identify high-risk circular call paths.
[0082] Step 3: The code management platform traverses all code sets. For code set P, it obtains the set of related call implementation points (dependent code set PD) corresponding to its associated call initiation point, and obtains the target specification GD of PD within period T. At the same time, it obtains the set of related call initiation points (dependent code set PP) corresponding to the associated call implementation points in code set P, and obtains the target specification GP of PP within period T.
[0083] By obtaining the dependent code sets and the code sets that are depended upon by the code set, the target specification merging is completed within period T.
[0084] (1) Traverse all code sets P and process them according to the following procedure to obtain the target specification set GD of the dependent code set PD within the period T and the target specification set GP of the dependent code set PP within the period T: <1> Get the set of code sets of all associated call initiation points in code set P, which is defined as the dependent code set set PD. Query the target specification set of dependent code set set PD in period T, denoted as GD. <2> Get the set of related call initiation point code sets corresponding to all related call implementation points in code set P, and define it as the dependent code set set PP. Query the target specification set of the dependent code set set PP within the period T, denoted as GP.
[0085] (2) Based on mapping length Determine the target specification GP dependent on the target specification offset angle within period T. :
[0086] in, This represents the dependency target specification mapping matrix, which combines the dependency target specification GD and the depended target specification GP to establish a complete dependency target specification mapping relationship for the code set P, resulting in the dependency target specification mapping matrix. The specific method for obtaining it is as follows:
[0087] in, For the target specification of the dependent code set d, The target specification for the code set p that is depended upon.
[0088] This indicates the length of the target specification GP dependency target specification mapping within period T, which is related to the call strength. Weighted average yields:
[0089] Among them, the intensity of associated calls For code collection The amount of code interacting between the code set PD and DP accounts for a significant portion of the code set. The proportion of total code volume.
[0090] Step 4: The code management platform performs dependency iteration mixing on the target specification G of the code update PU of the task in code set P within period T, based on the target specification GD of the dependent code set PD in period T and the target specification GP of the dependent code set PP in period T, to obtain the dependency iteration target specification G', which is stored in the specification database DB as the dependency iteration target specification record of code set P in the current period TC.
[0091] (1) Obtain the target specification G of the code update PU of the code set P within the period T, the target specification set GD of the dependent code set PD, and the target specification set GP of the dependent code set PP.
[0092] (2) Perform dependency iterative mixing and blending on the target specification according to the following steps; <1> Based on the strength of associated calls Weights are assigned to the target specifications G, GD, and GP in the form of weight ratios (i.e., the intensity of the associated call multiplied by the respective system parameter settings). , , .
[0093] <2> Perform mixed operations to generate the dependency iteration target specification G':
[0094] Wherein, WG represents the weights assigned to the target specifications G, GD, and GP. , , The weights sum, which are obtained as follows:
[0095] (3) Store the generated dependency iteration target specification G' into the target specification record of the current period TC of the corresponding code set P in the specification database DB.
[0096] Step 5: The code management platform obtains the revised dependency target specification GA by comparing the dependency iteration target specification G' in period T with the dependency iteration target specification GT' in the previous period TP.
[0097] (1) Obtain the dependency iteration target specification G' of code set P in the current period T, and the dependency iteration target specification GT' of the previous period TP; Where m represents the number of target specification dimensions, ensuring that the revised GA accurately reflects changes in the target specification during the week.
[0098] (2) Obtain the target specification correction GA for the output code set P period T, so as to provide a basis for subsequent target specification adjustments:
[0099] in, The correction angle is obtained as follows:
[0100] in, The difference matrix is represented by the comparison of each item between G' and GT', i.e.:
[0101] Representing the difference matrix The correction strength, which is determined by the difference matrix. Sensitivity to change Multiplying them together, we get:
[0102] Among them, sensitivity to change These are system parameters configured by the system and used to control the extent of specification corrections.
[0103] Step 6: The code management platform performs style standardization, using an AI-based style correction model M to refine the code sets in code set P. The GA was modified according to the target specification to obtain the updated code set. .
[0104] Through standardization adjustments, the code set in code set P was completed. The stylized update yields the updated code set. The specific execution process of the AI-based canonical correction model M is as follows: (1) The code set before the code standardization After style removal and segmentation to obtain code segments, the code segments are then encoded using BERT and filled with gaps to obtain the input MI of the standard correction model M.
[0105] <1> First, the code collection After style cleanup, the code before cleanup is divided into segments according to style markers (including carriage return, line feed, tab, space, assignment operator, parentheses, underscore, arrow, syntax keywords, etc.). Multiple consecutive style markers are also considered as one.
[0106] <2> Remove stylized markers from each segment, and add two (based on the target code type and set by system parameters) padding space codes (i.e. all-zero marker vector symbols) before and after the result of BERT encoding of each code segment.
[0107] <3> The encoded sequence formed by arranging them in order is used as the input MI of the canonical correction model M and fed into the canonical correction model M.
[0108] (2) The model M takes MI as input and the result matrix RD obtained by inference is subtracted from the target model correction GA as the model style difference degree L. When any element in the model style difference degree is greater than the minimum value Lm (system parameter) of the style difference degree termination, the model style difference degree is backpropagated in the model M. When the model style difference degree is less than or equal to the minimum value Lm of the style difference degree termination, or when the difference between the model style difference degree and the previous style difference degree is divided by the current style difference degree result within the range of the style difference degree update termination gradient Lg (system parameter) and the situation of being greater than the previous style difference degree occurs more than 3 times in a row, or when the maximum number of iterations Im is reached, the iteration ends.
[0109] The backpropagation logic for style difference is as follows: Keep the content of each segment unchanged, backpropagate to update the style marker gaps between segments until the end of the iteration condition is met. Then, replace the vector in the style marker between each segment with the style marker vector with the smallest difference in magnitude between the style marker vector and the style marker vector. If the difference in magnitude between the style marker and all style markers is greater than the style similarity difference limit (configured by system parameters), set it to all 0 values.
[0110] Among them, the canonical correction model M is a large speech model based on the transformers structure. In each coding module of the first layer, in addition to position coding and input coding, there is also a type coding. When the value is 1, it means that its coding content is a stylized marker empty space, which can be updated by backpropagation. When the value is 0, it means that its input coding is a code fragment, which cannot be updated by backpropagation.
[0111] (3) The updated MI is decoded using BERT to serve as the updated code set. .
[0112] Step 7: Obtain the updated code set Afterwards, the code management platform submits the code collection. To the R&D personnel, the R&D personnel have access to the code set After review, the code management platform uses the code collection. Replace the original code set .
[0113] In summary, this disclosure provides a method for enterprise-level code joint organization and standardization integration, including: a code management platform periodically establishes a standard database, regularly summarizes internal code sets, extracts target standards to determine the code update standards for each period; the platform adopts a joint call inspection mechanism to analyze the interface and implementation relationships of different code sets, constructs a circular call dependency graph; for each code set, the platform obtains the target standards of its associated call dependencies and dependent code sets, performs dependency iterative mixing to obtain new target standards, stores them in the database; by comparing the new and old standards, corrections are made, and an artificial intelligence model is used to standardize the code; finally, the updated code set is submitted to the developers for review and to replace the original code set, as detailed in steps 1 to 7.
[0114] A method for generating target specifications is provided, including: obtaining the target specifications of the code set in the previous period and the target specifications of the current period; traversing all code sets and their interfaces and implementations; performing associated call analysis based on the joint call checking mechanism; establishing multiple associated call relationships; constructing an associated call set and generating a circular call dependency graph; analyzing the strength and pattern of circular dependencies; traversing all code sets; processing to obtain the target specification set of the dependent code set in the current period and the target specification set of the dependent code set; combining these two target specifications to establish a complete dependency target specification mapping relationship, forming a dependency target specification model for code set P; determining the dependency mapping length of the target specification within the period based on the dependency target specifications; obtaining the offset angle of the dependency target specification through weighted associative call strength; obtaining the target specification for the task code update of the code set in the current period; performing dependency iteration mixing on the target specifications; storing the generated dependency iteration target specifications in the corresponding record in the database; obtaining the dependency iteration target specifications of the current period and comparing them with the target specifications of the previous period to obtain a difference matrix; determining the correction angle based on the correction strength of the difference matrix; and finally outputting the correction of the dependency target specifications for code set P in the current period. See steps 1 to 5 for details.
[0115] A canonical correction model based on a target canonical specification and its inference execution method are also provided. The method includes: performing style cleansing and segmentation on the code set before cleansing to obtain code segments; encoding these segments using BERT and filling gaps to form the input MI of the canonical correction model M; using MI as input, model M infers the result matrix RD, subtracts the target canonical correction GA, and calculates the style difference degree L. If any element in the style difference degree is greater than the termination minimum value Lm, backpropagation is performed in model M. The iteration ends when the style difference degree is less than or equal to Lm, or when the difference compared to the previous difference degree is within the termination gradient Lg range and occurs consecutively more than 3 times, or when the maximum number of iterations Im is reached. The style cleansing method involves: removing stylistic markers from the code set and segmenting it at each stylistic marker to form code segments; removing the markers from each segment and adding two filler codes; arranging these codes sequentially to form an encoding sequence as input to model M. The backpropagation logic for style difference is as follows: keep the content of each segment unchanged, perform backpropagation updates for the gaps between segments until the iteration termination condition is met. After the update, replace the stylized marker vector between segments with the vector with the smallest difference in magnitude between its corresponding vector. If the difference is greater than the similarity limit, set it to all 0 values. Finally, the updated MI is de-encoded by BERT to generate the updated code set, see step 6 for details.
[0116] Based on this, the method provided in this disclosure can achieve at least the following technical effects: By constructing a specification database and driving target specification updates through periodic tasks, dynamic rule evolution management across code sets and time cycles is achieved, solving the problems of static rule fixation and reliance on manual maintenance, and significantly improving the adaptability and global consistency of the specification system. The target specification generation method effectively manages the change records of historical code and its corresponding rules, ensuring that all changes are traceable, improving code coherence and consistency, and reducing the risk of specification jumps. Simultaneously, by identifying the correlations between different code sets, it can promote joint updates of multiple code sets, reducing potential code differences after integration, improving maintenance efficiency, and making code management more consistent and standardized, providing development teams with a more efficient update strategy. Based on the target specification-based specification correction model and its inference execution method, an automated specification correction mechanism is introduced, which can significantly reduce the time and resources required for developers to write correction logic, ensuring rapid response and efficient execution of specifications, thereby reducing human error and improving code quality.
[0117] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0118] According to embodiments of this disclosure, this disclosure also provides a code organization apparatus. For example, Figure 3 This is a schematic diagram of a code organization device provided in an embodiment of the present disclosure. The code organization device 300 includes: The summary module 310 is used to periodically summarize the code set under each task to obtain the first target specification of the task code update for each code set in the current period. Analysis module 320 is used to perform associated call analysis on interfaces and implementations in different code sets to obtain associated call relationships; wherein, the associated call relationship includes the associated call initiation point and the associated call implementation point; The specification determination module 330 is used to determine, based on the associated call relationship, the associated call initiation point code set set and the associated call initiation point code set set corresponding to the associated call initiation point of each code set, and to obtain the second target specification of the associated call implementation point code set set and the third target specification of the associated call initiation point code set set. The iteration module 340 is used to perform dependency iteration mixing on the first target specification according to the second target specification and the third target specification to obtain the dependency iteration target specification; The update module 350 is used to process the code set by using the specification correction model based on the dependency iteration target specification and the dependency iteration target specification in the previous cycle.
[0119] Furthermore, the aggregation module 310 is used for: For any code set, obtain the target specification of the code set in the previous period and the target specification in the current period; Read the code updates and code update templates for the code set described in this cycle; Based on the code updates of the code set in the current cycle, the code update template code, the target specification of the previous cycle, and the target specification of the current cycle, determine the first target specification for the task code updates of each code set in the current cycle and store it in the specification database.
[0120] Furthermore, the aggregation module 310 is configured to include: When the code update template code is empty, the target specification of the previous cycle is determined as the first target specification; When the code update model code is not empty, the read code update model code is used as the original input of the canonical correction model, the output matrix is obtained through the canonical correction model inference, and the output matrix is used as the target canonical update; Based on the target specification of the previous cycle and the target specification update, the first target specification is determined.
[0121] Furthermore, the analysis module 320 is used for: For any code set, identify the implementation corresponding to each interface in the code set; Based on the call chain of interfaces and implementations between different code sets, the associated call initiation point and associated call implementation point are determined, and the associated call relationship is obtained.
[0122] Furthermore, it also includes an angle determination module, used for: A circular call dependency graph is generated based on the associated call relationships; the dependency aggregation angle is determined based on the circular call dependency graph. The target specification offset angle that the third target specification depends on within this period is determined based on the mapping length.
[0123] Furthermore, the iteration module 340 is used for: Based on the intensity of associated calls, weights are assigned to the first target specification, the second target specification, and the third target specification; Based on the dependency aggregation angle, the target specification offset angle, and the respective weights of the first target specification, the second target specification, and the third target specification, the dependency iteration target specification is determined.
[0124] Furthermore, the update module 350 is used for: Retrieve the dependency iteration target specification of the code set in the current cycle, and the dependency iteration target specification in the previous cycle; Based on the dependency iteration target specification in the current cycle and the dependency iteration target specification in the previous cycle, determine the target specification correction; The target specification is adjusted using a specification correction model to obtain an updated code set.
[0125] Furthermore, the update module 350 is used for: The code set is then subjected to style cleanup and segmentation to obtain smaller code segments; The code segment is encoded and the gap-filling encoding is performed to obtain the input of the specification correction model; The canonical correction model obtains the result matrix based on the input reasoning; Based on the result matrix and target specification correction, the model style difference degree is determined; When any element in the model style difference degree is greater than the minimum value of the style difference degree termination, the model style difference degree is backpropagated in the canonical correction model. The iteration ends when the model style difference is less than or equal to the minimum value of the style difference termination, or when the difference between the model style difference and the previous style difference divided by the current model style difference is within the style difference update termination gradient range, or when the model style difference is greater than the previous style difference for a preset number of consecutive occurrences or when the maximum number of iterations is reached. The code set after the iteration is completed is de-encoded to obtain the updated code set.
[0126] Furthermore, it also includes a submission module for: Submit the updated code set to the target user.
[0127] It should be noted that the description of the features in the embodiment corresponding to the code organization device can be found in the relevant description of the embodiment corresponding to the code organization method, and will not be repeated here.
[0128] Embodiments of this disclosure also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0129] Embodiments of this disclosure also provide a computer-readable storage medium storing a computer program configured to perform the steps in any of the above method embodiments when executed.
[0130] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0131] Embodiments of this disclosure also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0132] Embodiments of this disclosure also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0133] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0134] The above provides a detailed description of a code organization method provided by this disclosure. Specific examples have been used to illustrate the principles and implementation methods of this disclosure. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this disclosure without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this disclosure.
Claims
1. A code organization method, characterized in that, include: Periodically summarize the code set under each task to obtain the first target specification for the task code update of each code set in the current period; An association call analysis is performed on the interfaces and implementations of different code sets to obtain the association call relationship; wherein, the association call relationship includes the association call initiation point and the association call implementation point; Based on the associated call relationship, determine the associated call implementation point code set set and the associated call initiation point code set set corresponding to the associated call initiation point of each code set, and obtain the second target specification of the associated call implementation point code set set and the third target specification of the associated call initiation point code set set. Based on the second target specification and the third target specification, the first target specification is subjected to dependency iteration mixing to obtain the dependency iteration target specification; The updated code set is determined by processing the dependency iteration target specification and the dependency iteration target specification in the previous cycle through the specification correction model.
2. The code organization method according to claim 1, characterized in that, The periodically summarized code sets under each task yields the first target specification for task code updates for each code set within the current period, including: For any code set, obtain the target specification of the code set in the previous period and the target specification in the current period; Read the code updates and code update templates for the code set described in this cycle; Based on the code updates of the code set in the current cycle, the code update template code, the target specification of the previous cycle, and the target specification of the current cycle, determine the first target specification for the task code updates of each code set in the current cycle and store it in the specification database.
3. The code organization method according to claim 2, characterized in that, The step of determining the first target specification for task code updates of each code set in the current cycle based on the code updates of the code set in the current cycle, the code update template code, the target specification of the previous cycle, and the target specification of the current cycle includes: When the code update template code is empty, the target specification of the previous cycle is determined as the first target specification; When the code update model code is not empty, the read code update model code is used as the original input of the canonical correction model, the output matrix is obtained through the canonical correction model inference, and the output matrix is used as the target canonical update; Based on the target specification of the previous cycle and the target specification update, the first target specification is determined.
4. The code organization method according to claim 1, characterized in that, The analysis of associated calls between interfaces and implementations in different code sets to obtain associated call relationships includes: For any code set, identify the implementation corresponding to each interface in the code set; Based on the call chain of interfaces and implementations between different code sets, the associated call initiation point and associated call implementation point are determined, and the associated call relationship is obtained.
5. The code organization method according to claim 4, characterized in that, After determining the associated call initiation point and associated call implementation point based on the call chain of interfaces and implementations between different code sets, and obtaining the associated call relationship, the method further includes: Generate a circular call dependency graph based on the aforementioned call relationships; Based on the aforementioned cyclic call dependency graph, the dependency aggregation angle is determined; After determining the set of associated call implementation point code sets and the set of associated call initiation point code sets corresponding to the associated call initiation point of each code set based on the associated call relationship, and obtaining the second target specification of the set of associated call implementation point code sets and the third target specification of the set of associated call initiation point code sets, the method further includes: The target specification offset angle that the third target specification depends on within this period is determined based on the mapping length.
6. The code organization method according to claim 5, characterized in that, The step of performing dependency iteration mixing on the first target specification according to the second target specification and the third target specification to obtain the dependency iteration target specification includes: Based on the intensity of associated calls, weights are assigned to the first target specification, the second target specification, and the third target specification; Based on the dependency aggregation angle, the target specification offset angle, and the respective weights of the first target specification, the second target specification, and the third target specification, the dependency iteration target specification is determined.
7. The code organization method according to claim 1, characterized in that, The process of using the specification correction model, based on the dependency iteration target specification and the dependency iteration target specification of the previous cycle, to determine the updated code set includes: Retrieve the dependency iteration target specification of the code set in the current cycle, and the dependency iteration target specification in the previous cycle; Based on the dependency iteration target specification in the current cycle and the dependency iteration target specification in the previous cycle, determine the target specification correction; The target specification is adjusted using a specification correction model to obtain an updated code set.
8. The code organization method according to claim 7, characterized in that, The step of adjusting the target specification using a specification correction model to obtain an updated code set includes: The code set is then subjected to style cleanup and segmentation to obtain smaller code segments; The code segment is encoded and the gap-filling encoding is performed to obtain the input of the specification correction model; The canonical correction model obtains the result matrix based on the input reasoning; Based on the result matrix and target specification correction, the model style difference degree is determined; When any element in the model style difference degree is greater than the minimum value of the style difference degree termination, the model style difference degree is backpropagated in the canonical correction model. The iteration ends when the model style difference is less than or equal to the minimum value of the style difference termination, or when the difference between the model style difference and the previous style difference divided by the current model style difference is within the style difference update termination gradient range, or when the model style difference is greater than the previous style difference for a preset number of consecutive occurrences or when the maximum number of iterations is reached. The code set after the iteration is completed is de-encoded to obtain the updated code set.
9. The code organization method according to claim 1, characterized in that, After determining the updated code set by processing the code using the specification correction model based on the dependency iteration target specification and the dependency iteration target specification in the previous cycle, the process further includes: Submit the updated code set to the target user.
10. A code sorting device, characterized in that, include: The summary module is used to periodically summarize the code of the code set under each task to obtain the first target specification of the task code update for each code set in the current period; The analysis module is used to perform associated call analysis on the interfaces and implementations of different code sets to obtain associated call relationships; wherein, the associated call relationship includes the associated call initiation point and the associated call implementation point; The specification determination module is used to determine, based on the associated call relationship, the associated call initiation point code set set and the associated call initiation point code set set corresponding to the associated call initiation point of each code set, and to obtain the second target specification of the associated call implementation point code set set and the third target specification of the associated call initiation point code set set. The iteration module is used to perform dependency iteration mixing on the first target specification according to the second target specification and the third target specification to obtain the dependency iteration target specification; The update module is used to process the dependency iteration target specification and the dependency iteration target specification in the previous cycle through the specification correction model to determine the updated code set.
11. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-9.
12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-9.
13. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-9.