Data processing method and device, electronic equipment and computer readable storage medium

By identifying and removing duplicate and sensitive information in the source code of multiple versions of software, the problems of sensitive information leakage and code redundancy in software development are solved, the development cost and circle complexity are reduced, and the code maintainability is improved.

CN119271255APending Publication Date: 2025-01-07TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310820858.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-05
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In the prior art, there are problems of sensitive information leakage and high code repetition rate in the source code management of multi-version software, resulting in increased circle complexity and increased development costs.

Method used

By obtaining source code files of different versions, determining the logical judgment code information associated with duplicate code information and version, generating new source code files, deleting sensitive code information, and deduplicating and encapsulating the logical judgment code information and duplicate code information. , reduce the complexity and redundancy of source code files.

Benefits of technology

It effectively solves the problem of sensitive information leakage between source code files in different versions, reduces the circle complexity and code duplication rate of source code files, and improves the maintainability and user experience of the code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271255A_ABST
    Figure CN119271255A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of software development. The method comprises the steps of obtaining at least two first source code files of an application program; wherein the at least two first source code files respectively correspond to different versions of the application program; determining target code information based on the at least two first source code files; generating a second source code file based on the target code information and the first source code file; creating an environment variable, compiling the second source code file, and identifying uncompiled code information in the second source code file based on the environment variable; deleting the sensitive code information from the corresponding second source code file to generate a third source code file; and generating a compiled application program based on the third source code file. According to the embodiment of the invention, the sensitive code information is deleted from the corresponding second source code file, so that the problem of sensitive information leakage among source codes of multiple versions can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development technology. Specifically, the present application relates to a data processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development of communication networks and computer systems, the number of applications is increasing day by day, and the functions and categories of applications are becoming more and more abundant. In order to meet the different usage requirements of different users, different software versions can be developed for applications. A code repository refers to a centralized or distributed system used to manage and store software source code.

[0003] When developing software through a code repository, in order to perform project management on different software versions of the same application, in the prior art, different code repositories are usually used to correspond to different software versions for differentiated storage, and the difference source codes of different versions are managed by adding logical judgments. Since different versions of the same application may have the same source code, when adding logical judgments to judge the source codes of different versions, there may be a problem of sensitive information leakage between versions. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, device, electronic device, and computer-readable storage medium, which can solve the problem of sensitive information leakage of multiple versions of software source code in the prior art. The technical solution is as follows:

[0005] According to one aspect of an embodiment of the present application, a data processing method is provided, the method comprising:

[0006] Obtain at least two first source code files of the application; wherein the at least two first source code files correspond to different versions of the application;

[0007] Determining target code information based on at least two first source code files; wherein the target code information includes at least one of repeated code information between the at least two first source code files or logic judgment code information associated with the version in the first source code files;

[0008] generating a second source code file based on the target code information and the first source code file;

[0009] Creating an environment variable, compiling the second source code file, and identifying uncompiled code information in the second source code file based on the environment variable; wherein the uncompiled code information is sensitive code information that does not match the target code version; the target code version is the version corresponding to the second source code file;

[0010] The sensitive code information is deleted from the corresponding second source code file to generate a third source code file; and a compiled application is generated based on the third source code file.

[0011] In a possible implementation, when the target code information includes logic judgment code information associated with the version in the first source code file, generating the second source code file based on the target code information and the first source code file includes:

[0012] Decoupling logic judgment code information associated with the version from each first source code file, and writing the logic judgment code information into a configuration file of the application program;

[0013] The configuration file is referenced in each first source code file, and the logic judgment code information in the corresponding first source code file is replaced based on a preset read instruction to obtain a second source code file corresponding to each first source code file.

[0014] In a possible implementation, the method further includes:

[0015] When the logic judgment code information associated with the version cannot be decoupled from the first source code file, obtaining combination information of the logic judgment code information associated with the version and the business logic code information;

[0016] Write the combination information into the configuration file and encapsulate the combination information into semantic variables;

[0017] The combination information in the first source code file is replaced with the semantic variable to obtain a second source code file corresponding to each first source code file.

[0018] In yet another possible implementation, the generating of the second source code file based on the target code information and the first source code file further includes:

[0019] Determine logic processing code information associated with logic judgment code information or combination information in the first source code file;

[0020] Replacing the logic processing code information in the first source code file with the preset variable information;

[0021] The logic processing code information is saved as a new second source code file.

[0022] In yet another possible implementation, when the target code information includes duplicate code information between at least two first source code files, generating a second source code file based on the target code information and the first source code files includes:

[0023] Encapsulate the repeated code information into components, and add the corresponding component information to any first source code file;

[0024] The repeated code information in the first source code file is replaced with the component to obtain a second source code file corresponding to each first source code file.

[0025] In another possible implementation, when the target code information includes duplicate code information and logic judgment code information associated with the version in the first source code file, generating a second source code file based on the target code information and the first source code file includes:

[0026] Decoupling logic judgment code information associated with the version from each first source code file, and writing the logic judgment code information into a configuration file of the application program;

[0027] The configuration file is referenced in each first source code file, and the logic judgment code information in the corresponding first source code file is replaced based on a preset read instruction to obtain a fourth source code file corresponding to each first source code file;

[0028] Encapsulate the repeated code information into components, and add the corresponding component information to any fourth source code file;

[0029] The repeated code information in the corresponding fourth source code files is replaced with the components to obtain the second source code files corresponding to each fourth source code file.

[0030] In another possible implementation, the determining of the target code information based on the at least two first source code files includes at least one of the following:

[0031] Matching information of first source code files of different versions, determining duplicate code information between at least two first source code files, and using the duplicate code information as target code information;

[0032] Based on a plurality of preset logic keywords, logic judgment code information associated with the version is screened out from each first source code file, and the logic judgment code information associated with the version is used as target code information.

[0033] According to another aspect of an embodiment of the present application, a data processing device is provided, the device comprising:

[0034] An acquisition module, used to acquire at least two first source code files of the application; wherein the at least two first source code files correspond to different versions of the application;

[0035] A determination module, configured to determine target code information based on at least two first source code files; wherein the target code information includes at least one of repeated code information between at least two first source code files or logic judgment code information associated with versions in the first source code files;

[0036] A generating module, used for generating a second source code file based on the target code information and the first source code file;

[0037] an identification module, used to create an environment variable, compile the second source code file, and identify uncompiled code information in the second source code file based on the environment variable; wherein the uncompiled code information is sensitive code information that does not match the target code version; the target code version is the version corresponding to the second source code file;

[0038] A deletion module, used to delete the sensitive code information from the corresponding second source code file to generate a third source code file;

[0039] The compiling module is used to generate a compiled application based on the third source code file.

[0040] In a possible implementation, when the target code information includes logic judgment code information associated with the version in the first source code file, the generation module, when generating the second source code file based on the target code information and the first source code file, is used to:

[0041] Decoupling logic judgment code information associated with the version from each first source code file, and writing the logic judgment code information into a configuration file of the application program;

[0042] The configuration file is referenced in each first source code file, and the logic judgment code information in the corresponding first source code file is replaced based on a preset read instruction to obtain a second source code file corresponding to each first source code file.

[0043] In a possible implementation, the generation module is further used to:

[0044] When the logic judgment code information associated with the version cannot be decoupled from the first source code file, obtaining combination information of the logic judgment code information associated with the version and the business logic code information;

[0045] Write the combination information into the configuration file and encapsulate the combination information into semantic variables;

[0046] The combination information in the first source code file is replaced with the semantic variable to obtain a second source code file corresponding to each first source code file.

[0047] In yet another possible implementation, when the generating module generates the second source code file based on the target code information and the first source code file, it is further configured to:

[0048] Determine logic processing code information associated with logic judgment code information or combination information in the first source code file;

[0049] Replacing the logic processing code information in the first source code file with the preset variable information;

[0050] The logic processing code information is saved as a new second source code file.

[0051] In yet another possible implementation, when the target code information includes duplicate code information between at least two first source code files, the generation module, when generating the second source code file based on the target code information and the first source code file, is further configured to:

[0052] Encapsulate the repeated code information into components, and add the corresponding component information to any first source code file;

[0053] The repeated code information in the first source code file is replaced with the component to obtain a second source code file corresponding to each first source code file.

[0054] In another possible implementation, when the target code information includes duplicate code information and logic judgment code information associated with the version in the first source code file, the generation module is further configured to:

[0055] Decoupling logic judgment code information associated with the version from each first source code file, and writing the logic judgment code information into a configuration file of the application program;

[0056] The configuration file is referenced in each first source code file, and the logic judgment code information in the corresponding first source code file is replaced based on a preset read instruction to obtain a fourth source code file corresponding to each first source code file;

[0057] Encapsulate the repeated code information into components, and add the corresponding component information to any fourth source code file;

[0058] The repeated code information in the corresponding fourth source code files is replaced with the components to obtain the second source code files corresponding to each fourth source code file.

[0059] In another possible implementation, when determining the target code information based on the at least two first source code files, the determination module is configured to:

[0060] Matching information of first source code files of different versions, determining duplicate code information between at least two first source code files, and using the duplicate code information as target code information;

[0061] Based on a plurality of preset logic keywords, logic judgment code information associated with the version is screened out from each first source code file, and the logic judgment code information associated with the version is used as target code information.

[0062] According to another aspect of an embodiment of the present application, an electronic device is provided, which includes: a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the method shown in the first aspect of the embodiment of the present application.

[0063] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method shown in the first aspect of the embodiments of the present application are implemented.

[0064] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, the steps of the method shown in the first aspect of the embodiment of the present application are implemented.

[0065] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0066] The embodiment of the present application determines the target code information through at least two first source code files; wherein the at least two first source code files correspond to different versions of the application respectively; then based on the target code information and the first source code file, a second source code file is generated; then based on the created environment variables, the second source code file is compiled to generate a third source code file, so as to generate a compiled application based on the third source code file. Since the target code information includes at least one of the repeated code information between at least two first source code files or the logic judgment code information associated with the version in the first source code file, the embodiment of the present application can deduplicate the first source code file according to the repeated code information, or control and adjust the logic code module of the first source code file according to the logic judgment code information, so as to achieve the purpose of reducing the repetition rate between source code files and reducing the cyclomatic complexity of the source code file.

[0067] At the same time, environment variables can be used to identify uncompiled sensitive code information in the second source code file. By deleting the sensitive code information from the corresponding second source code file, the problem of sensitive information leakage between source code files of different versions in the prior art can be effectively solved. Different from the prior art method of adding logical judgment to manage different versions of differential source code, it further reduces the cyclomatic complexity of the source code file, and can also effectively protect sensitive information between versions, reduce the source code development and management costs for multi-version applications, and improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0069] Figure 1 A schematic diagram of an application scenario of a data processing method provided in an embodiment of the present application;

[0070] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;

[0071] Figure 3 A schematic diagram of a flow chart of generating a second source code file in a data processing method provided in an embodiment of the present application;

[0072] Figure 4 A schematic diagram of another process of generating a second source code file in a data processing method provided in an embodiment of the present application;

[0073] Figure 5 A schematic diagram of a process for generating a second source code file in a data processing method provided in an embodiment of the present application;

[0074] Figure 6 A schematic diagram of a flow chart of generating a second source code file based on duplicate code information in a data processing method provided in an embodiment of the present application;

[0075] Figure 7 A schematic diagram of a process for generating a second source code file in a data processing method provided in an embodiment of the present application;

[0076] Figure 8 A flowchart of an exemplary data processing method provided in an embodiment of the present application;

[0077] Fig. 9 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0078] Fig.10 A schematic diagram of the structure of a data processing electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0080] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B".

[0081] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0082] First, several terms involved in this application are introduced and explained:

[0083] 1) Code repository: A code repository is a public or private place where a large amount of source code is stored. Most repositories are used for backup and version control, and in projects developed by multiple people, they help deal with various code version issues, such as conflicts caused by developers modifying the source code at the same time. In the embodiments of the present application, for the source code files of the same application, the execution results are usually standard and unified; however, for different target users of the application, the source files of the application may differ in terms of environment deployment, logical functions, and compilation results, thereby forming different versions of the application for different target users; when there are multiple versions of the application, multiple versions of the code repository can be created.

[0084] 2) Cyclomatic complexity: a measure of code complexity. In the concept of software testing, cyclomatic complexity is used to measure the complexity of a module's judgment structure. It is quantitatively expressed as the number of linearly independent paths, that is, the minimum number of paths required to test to reasonably prevent errors. A high cyclomatic complexity indicates that the program code may be of low quality and difficult to test and maintain. According to experience, possible program errors are closely related to high cyclomatic complexity. In the embodiments of the present application, when a layer of logic judgment, loop and other structures is added to the source code, such as if statements, while statements, ternary operators, etc., the cyclomatic complexity of the source code will increase accordingly. Generally speaking, the lower the cyclomatic complexity of the source code, the clearer and more controllable the code repository is.

[0085] 3) Code duplication rate: Code duplication rate refers to the ratio of identical code segments in the code. When the duplication rate of source code files in the code repository is high, some potential problems may arise, such as poor maintainability, large amount of code redundancy, and code deviation. Code duplication rate can be used to measure the complexity and maintenance difficulty of a code repository. For example, when the code in the code repository exists: completely identical code or only modified spaces and comments, structurally and syntactically consistent code, functionally and logically consistent code, etc., the code duplication rate will increase accordingly. Generally speaking, the lower the code duplication rate, the clearer and more controllable the code repository is.

[0086] In the prior art, when developing a code repository of a multi-version application, the multi-version code repository is usually managed by directly adding logical judgment. The inventors have found the following problems:

[0087] First of all, the addition of each logical judgment in the source code file will increase the cyclomatic complexity of the source code file accordingly, reducing the maintainability of the source code file and the code repository.

[0088] Secondly, in the source code file, logical judgment is used to control the operation of the source code. Although the versions can be correctly distinguished in the final program operation effect, the problem of sensitive information leakage cannot be avoided. Taking sensitive copy information as an example, although the sensitive copy information of version 2 will not be displayed in the final version 1 program display, the above sensitive copy information is still included in the actual code of version 1, which will cause the risk of sensitive information leakage between versions.

[0089] Thirdly, in the prior art, there will be multiple copies of the same code between multiple versions, which are redundantly stored in multiple code repositories or multiple repository branches, resulting in a high code duplication rate in the code repositories; when the same code needs to be modified, multiple code repositories or multiple repository branches need to be modified at the same time, resulting in shotgun-style modifications, which can easily lead to incorrect modifications or missed modifications, and reduce development efficiency.

[0090] The data processing method, device, electronic device and computer-readable storage medium provided in this application are intended to solve the above technical problems in the prior art.

[0091] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.

[0092] like Figure 1 As shown, the data processing method of the present application can be applied to Figure 1 In the scenario shown, specifically, the server 101 obtains at least two first source code files of the application from the code repository 102, and determines the target code information based on the at least two first source code files, wherein the target code information includes at least one of the repeated code information between the at least two first source code files or the logic judgment code information associated with the version in the first source code file. Then, the server 101 generates a second source code file based on the target code information and each first source code file; after creating the environment variable, the second source code file is compiled, and the uncompiled code information in the second source code file is identified based on the environment variable; wherein the uncompiled code information is sensitive code information that does not match the target code version; the target code version is the version corresponding to the second source code file; then the server deletes the sensitive code from the corresponding second source code file, generates a third source code file, and generates a compiled application based on the third source code file.

[0093] Figure 1 In the scenario shown, the above data processing method can be performed in a server, and in other scenarios, it can also be performed in a terminal.

[0094] Technicians in this technical field can understand that the "terminal" used here can be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a MID (Mobile Internet Device), etc.; the "server" can be implemented by an independent server or a server cluster consisting of multiple servers.

[0095] The present application provides a data processing method, such as Figure 2 As shown, it can be applied to a server or terminal for data processing, and the method includes:

[0096] S201, obtaining at least two first source code files of an application.

[0097] Among them, at least two first source code files correspond to different versions of the application. The application can be differentiated by version based on the users it faces. For example, the application can be a live broadcast software, which can include a host version, an audience version, and a development version, and each version corresponds to a different first source code file. At the same time, the application can also be differentiated by version according to different deployment locations. For example, the application can also be an application protection system, and the version of the application can include a cloud-native version deployed on the management cloud platform, a proprietary cloud version deployed on the customer's proprietary cloud, and an internal operation version deployed on the internal server of the development team.

[0098] Specifically, a server or terminal for data processing may obtain a first source code file from a code repository corresponding to the application; wherein the at least two first source code files are stored in the same code repository.

[0099] S202: Determine target code information based on at least two first source code files.

[0100] The target code information includes at least one of repeated code information between at least two first source code files or logic judgment code information associated with the version in the first source code file.

[0101] Specifically, a server or terminal used for data processing can compare at least two first source code files in pairs to determine the repeated code information between at least two first source code files; it can also perform keyword analysis on each source code file to obtain logical judgment code information associated with the version in the first source code file.

[0102] S203: Determine target code information based on at least two first source code files.

[0103] Each first source code file corresponds to at least one second source code file.

[0104] In some implementations, when the target code information is repeated code information between at least two first source code files, a server or terminal for data processing may encapsulate the repeated code information into components and generate a second source code file corresponding to each first source code file based on the components.

[0105] In other embodiments, when the target code information is logic judgment code information associated with a version, a server or terminal used for data processing can write the above logic judgment code information into a configuration file of an application, and replace the logic judgment code information in the first source code file based on preset variables; at the same time, the server or terminal used for data processing can also save the logic processing code information associated with the logic judgment code information as new second source code information to obtain at least one second source code file corresponding to each first source code file.

[0106] S204, creating an environment variable, compiling the second source code file, and identifying uncompiled code information in the second source code file based on the environment variable.

[0107] The uncompiled code information is sensitive code information that does not match the target code version; the target code version is the version corresponding to the second source code file. The environment variable is used to identify the unexecuted code information in the second source code file during the compilation process of the source code file.

[0108] Optionally, the environment variable can also be a global variable that takes effect during the compilation process. It is set before the compilation starts and generally does not change during the compilation process. For example, before the second source code file is mutated, an environment variable related to the application version can be created, and its value can be "public cloud version" or "private cloud version". If there is the following logical judgment in the source code file:

[0109] if (version == "native version cloud") then perform native cloud logic;

[0110] if (version == "proprietary version cloud"), then perform the proprietary cloud logic.

[0111] Before the second source code file starts compiling, you can specify the environment variable "version" as "native cloud version" or "proprietary cloud version"; during the compilation process, the environment variable "version" will participate in the execution of the code, and you can make judgments based on the value of the environment variable "version" according to the above logic to perform different logical processing.

[0112] S205, deleting the sensitive code information from the corresponding second source code file to generate a third source code file; and generating a compiled application based on the third source code file.

[0113] Specifically, a server or terminal for data processing can use the second source code file with sensitive code information removed as the third source file code, and then package the third source file code to generate a compiled application.

[0114] The embodiment of the present application determines the target code information through at least two first source code files; wherein the at least two first source code files correspond to different versions of the application respectively; then based on the target code information and the first source code file, a second source code file is generated; then based on the created environment variables, the second source code file is compiled to generate a third source code file, so as to generate a compiled application based on the third source code file. Since the target code information includes at least one of the repeated code information between at least two first source code files or the logic judgment code information associated with the version in the first source code file, the embodiment of the present application can deduplicate the first source code file according to the repeated code information, or control and adjust the logic code module of the first source code file according to the logic judgment code information, so as to achieve the purpose of reducing the repetition rate between source code files and reducing the cyclomatic complexity of the source code file.

[0115] At the same time, environment variables can be used to identify uncompiled sensitive code information in the second source code file. By deleting the sensitive code information from the corresponding second source code file, the problem of sensitive information leakage between source code files of different versions in the prior art can be effectively solved. Different from the prior art method of adding logical judgment to manage different versions of differential source code, it further reduces the cyclomatic complexity of the source code file, and can also effectively protect sensitive information between versions, reduce the source code development and management costs for multi-version applications, and improve user experience.

[0116] A possible implementation method is provided in the embodiment of the present application, such as Figure 3 As shown, when the target code information includes logic judgment code information associated with the version in the first source code file, a second source code file is generated based on the target code information and the first source code file, including:

[0117] S301, decoupling logic judgment code information associated with the version from each first source code file, and writing the logic judgment code information into a configuration file of the application.

[0118] In an embodiment of the present application, the above-mentioned logic judgment code information associated with the version may include a text description logic judgment related to the version; for example, if the current version of the first source code file is judged to be the "native cloud version", then the text description information "Welcome to the native cloud protection system!" is added; if the current version of the first source code file is judged to be the "proprietary cloud version", then the text description information "Welcome to the proprietary cloud protection system!" is added. The above-mentioned logic judgment will significantly increase the cyclomatic complexity of the code repository, and the logic judgment code information associated with the version is included in the configuration file, which reduces the cyclomatic complexity of a single source code file, and thus can reduce the cyclomatic complexity of the entire code repository.

[0119] S302, referencing a configuration file in each first source code file, and replacing logic judgment code information in the corresponding first source code file based on a preset read instruction, to obtain a second source code file corresponding to each first source code file.

[0120] In the embodiment of the present application, the logic judgment code information associated with the version is decoupled, and the above logic judgment code information is extracted from the first source code file and stored in the configuration file; because the cyclomatic complexity of the code warehouse is determined based on the file with the highest cyclomatic complexity, the cyclomatic complexity between files does not overlap, so the cyclomatic complexity of each first source code file is reduced, and the cyclomatic complexity of the entire code warehouse is significantly reduced.

[0121] A possible implementation method is provided in the embodiment of the present application, such as Figure 4 As shown, the above method also includes:

[0122] S401, when the logic judgment code information associated with the version cannot be decoupled from the first source code file, obtain the combination information of the logic judgment code information associated with the version and the business logic code information.

[0123] In the embodiment of the present application, the combination information of the logic judgment code information and the business logic code information associated with the version may include the following judgment:

[0124] if(version === "proprietary cloud version" &&isShowPage === true);

[0125] The above logical judgment shows that if the environment variable "version" is the private cloud version and the value of the common variable "isShowPage" is true, the corresponding logic code execution process will be entered.

[0126] That is to say, if the environment variable "version" is the private cloud version, the final judgment result of this combination of information needs to be determined based on the actual value of "isShowPage"; however, if the environment variable "version" is the native cloud version, the judgment result of this combination of information is "no" regardless of the value of "isShowPage". During the source code compilation process, when the environment variable "version" is the native cloud version, since this logical judgment is also interfered by other variables, the environment variable cannot accurately identify the logic of this combination of information, which will result in the inability to remove logical judgment information that is inconsistent with the current version from the source code file, and may also cause sensitive information of the private cloud version to be leaked to the native cloud version.

[0127] S402, writing the combination information into a configuration file, and encapsulating the combination information into a semantic variable.

[0128] In an embodiment of the present application, the above-mentioned combination information that cannot be separated from the business logic code information is also written into the configuration file, and the combination information is pointed to by a semantic variable, which can further reduce the cyclomatic complexity of the code repository.

[0129] S403: Replace the combination information in the first source code file with the semantic variable to obtain a second source code file corresponding to each first source code file.

[0130] Furthermore, after obtaining the second source code file, before compiling the code, the judgment result of the combination information can be identified with respect to the configuration file, so that the combination information of the logic judgment code information and the business logic code information can be accurately executed; that is, during the source code compilation process, when the environment variable "version" is the native cloud version, the judgment result of the combination information in the configuration file will not be interfered with by other logical variables, so as to delete the combination information from the second source code file and obtain a more accurate and non-redundant third source code file.

[0131] The embodiment of the present application obtains the combination information of the logic judgment code information and the business logic code information associated with the version, and writes the above combination information into the configuration file, which, on the one hand, reduces the cyclomatic complexity of the source code file; on the other hand, before compilation, the accurate judgment result of the combination information can be identified based on the configuration file to accurately identify the sensitive code information of the source code file, reduce the redundancy of the third source code file, and improve the user experience.

[0132] A possible implementation method is provided in the embodiment of the present application, such as Figure 5 As shown, the above method of generating the second source code file based on the target code information and the first source code file also includes:

[0133] S501, determining logic processing code information associated with logic judgment code information or combination information in a first source code file.

[0134] In the embodiment of the present application, for example, the logic judgment code information may include the following judgment:

[0135] if (version === "proprietary cloud version" && isShowPage === true), then perform proprietary cloud logic processing;

[0136] The above-mentioned proprietary cloud logic processing is the logic processing code information associated with the logic judgment code information.

[0137] S502, replacing the logic processing code information in the first source code file with preset variable information; and saving the logic processing code information as a new second source code file.

[0138] The embodiment of the present application can effectively reduce the cyclomatic complexity of a single second source code file by obtaining logic processing code information associated with logic judgment code information or combination information, and extracting the above logic processing code information to a newly created independent second source code file. Since the cyclomatic complexity of the code repository is determined based on the file with the highest cyclomatic complexity, the cyclomatic complexities between files are not superimposed. Therefore, by reducing the cyclomatic complexity of each second source code file, the cyclomatic complexity of the entire code repository is significantly reduced, laying a good foundation for subsequent accurate and efficient code compilation.

[0139] A possible implementation method is provided in the embodiment of the present application, such as Figure 6 As shown, when the target code information includes duplicate code information between at least two first source code files, generating a second source code file based on the target code information and the first source code files includes:

[0140] S601, encapsulating repeated code information into components, and adding corresponding component information to any first source code file.

[0141] The above-mentioned component may be a component variable, and the component variable may point to corresponding component information in the first source code file.

[0142] Specifically, a server or terminal for data processing may encapsulate repeated codes into component variables, and add component information corresponding to the component variables in any first source code file.

[0143] S602: Replace duplicate code information in the first source code file with a component to obtain a second source code file corresponding to each first source code file.

[0144] In some other implementations, the server or terminal for data processing may also write the repeated code information into a new code file, which may be used as a component code file; and then replace the repeated code information corresponding to each first source code file with the component to obtain a second source code file corresponding to each first source code file. The component may point to the component code file.

[0145] The embodiment of the present application achieves code deduplication for the first source code file by encapsulating repeated code information into component variables and replacing the corresponding repeated code information in the first source code file with the component variables, which can effectively reduce the code repetition rate of the first source code file and further reduce the cyclomatic complexity of the source code file.

[0146] A possible implementation method is provided in the embodiment of the present application, such as Figure 7 As shown, when the target code information includes duplicate code information and logic judgment code information associated with the version in the first source code file, a second source code file is generated based on the target code information and the first source code file, including:

[0147] S701, decoupling logic judgment code information associated with the version from each first source code file, and writing the logic judgment code information into a configuration file of the application.

[0148] S702, referencing a configuration file in each first source code file, and replacing logic judgment code information in the corresponding first source code file based on a preset read instruction, to obtain a fourth source code file corresponding to each first source code file.

[0149] In other embodiments, when the logic judgment code information associated with the version cannot be decoupled from the first source code file, the combination information of the logic judgment code information associated with the version and the business logic code information is obtained; the combination information is written into a configuration file, and the combination information is encapsulated into a semantic variable.

[0150] At the same time, the server or terminal used for data processing can also replace the combination information in the first source code file with the semantic variable to obtain a fourth source code file corresponding to each first source code file.

[0151] S703, encapsulate the repeated code information into components, and add the corresponding component information to any fourth source code file.

[0152] The above-mentioned component may be a component variable, and the component variable may point to corresponding component information in the fourth source code file.

[0153] Specifically, a server or terminal for data processing may encapsulate repeated codes into component variables, and add component information corresponding to the component variables in any fourth source code file.

[0154] S704: Replace the repeated code information in the corresponding fourth source code files with the components to obtain the second source code files corresponding to each fourth source code file.

[0155] The embodiment of the present application introduces logic judgment code information and / or combination information associated with the version into the configuration file, and replaces the logic judgment code information or combination information in the first source code file based on preset variables to generate a second source code file, which can effectively reduce the cyclomatic complexity of the source code file. At the same time, the embodiment of the present application further reduces the cyclomatic complexity of the source code by encapsulating repeated code information into component variables and replacing the repeated code information in each fourth source code file with component variables, while also effectively reducing the code repetition rate of the source code file, effectively reducing the redundancy of the code warehouse, and laying a good foundation for the accuracy of subsequent code compilation.

[0156] A possible implementation method is provided in an embodiment of the present application. The above-mentioned determining the target code information based on at least two first source code files includes at least one of the following:

[0157] (1) Matching information of first source code files of different versions to determine repeated code information between at least two first source code files, and using the repeated code information as target code information.

[0158] Specifically, a server or terminal for data processing may perform pairwise matching on each first source code file, and compare and obtain duplicate code information between at least two first source code files.

[0159] (2) Based on a plurality of preset logic keywords, logic judgment code information associated with the version is screened out from each first source code file, and the logic judgment code information associated with the version is used as the target code information.

[0160] Among them, the above-mentioned logical keywords may include if statements, while statements, ternary operators, etc., which are not specifically limited in the embodiments of the present application.

[0161] Specifically, a server or terminal for data processing can parse candidate logic judgment code information based on logic keywords, and filter out logic judgment code information associated with the version from the candidate logic judgment code information to obtain target code information.

[0162] The embodiment of the present application determines repeated code information by matching and comparing different versions of the first source code files, and can also filter out logical judgment code information from the first source code file based on preset logical keywords, thereby achieving effective parsing of the first source code file, laying a good foundation for subsequent generation of source code files with low cyclomatic complexity and low code repetition rate based on target code information, and further improving user experience.

[0163] In order to better understand the above data processing method, Figure 8 An example of a data processing method of the present application is described in detail. The above method can be applied to the code compiler 801. The method includes the following steps:

[0164] S801, the code compiler 801 obtains at least two first source code files of the application from the code repository 802 corresponding to the application, wherein the at least two first source code files correspond to different versions of the application.

[0165] S802, the code compiler 801 matches the information of the first source code files of different versions, determines the repeated code information between at least two first source code files, and uses the repeated code information as the target code information; at the same time, based on multiple preset logical keywords, it can also filter out the logic judgment code information associated with the version from each first source code file, and use the logic judgment code information associated with the version as the target code information.

[0166] The above logic keywords may include if statements, while statements, ternary operators, etc.

[0167] S803, decouple the logic judgment code information associated with the version from each first source code file, and write the logic judgment code information into a configuration file of the application. Reference the configuration file in each first source code file, and replace the logic judgment code information in the corresponding first source code file based on a preset read instruction to obtain a fourth source code file corresponding to each first source code file.

[0168] Optionally, when the logic judgment code information associated with the version cannot be decoupled from the first source code file, the combination information of the logic judgment code information associated with the version and the business logic code information is obtained; the combination information is written into a configuration file, and the combination information is encapsulated into a semantic variable; the combination information in the first source code file is replaced with the semantic variable to obtain a fourth source code file corresponding to each first source code file.

[0169] S804, determining the logic processing code information associated with the logic judgment code information or the combination information in the first source code file; replacing the logic processing code information in the first source code file with preset variable information; and saving the logic processing code information as a new fourth source code file.

[0170] S805, encapsulating the repeated code information into components, and adding the corresponding component information to any fourth source code file; replacing the repeated code information in the fourth source code file with the components, and obtaining a second source code file corresponding to each fourth source code file.

[0171] The above-mentioned component may be a component variable, and the component variable may point to corresponding component information in the fourth source code file.

[0172] S806, creating an environment variable, compiling the second source code file, and identifying uncompiled code information in the second source code file based on the environment variable.

[0173] The uncompiled code information is sensitive code information that does not match the target code version; the target code version is the version corresponding to the second source code file. The environment variable is used to identify the unexecuted code information in the second source code file during the compilation process of the source code file.

[0174] S807, taking the second source code file from which the sensitive code information is removed as the third source file code, and then packaging the third source file code to generate a compiled application program.

[0175] The embodiment of the present application determines the target code information through at least two first source code files; wherein the at least two first source code files correspond to different versions of the application respectively; then based on the target code information and the first source code file, a second source code file is generated; then based on the created environment variables, the second source code file is compiled to generate a third source code file, so as to generate a compiled application based on the third source code file. Since the target code information includes at least one of the repeated code information between at least two first source code files or the logic judgment code information associated with the version in the first source code file, the embodiment of the present application can deduplicate the first source code file according to the repeated code information, or control and adjust the logic code module of the first source code file according to the logic judgment code information, so as to achieve the purpose of reducing the repetition rate between source code files and reducing the cyclomatic complexity of the source code file.

[0176] At the same time, environment variables can be used to identify uncompiled sensitive code information in the second source code file. By deleting the sensitive code information from the corresponding second source code file, the problem of sensitive information leakage between source code files of different versions in the prior art can be effectively solved. Different from the prior art method of adding logical judgment to manage different versions of differential source code, it further reduces the cyclomatic complexity of the source code file, and can also effectively protect sensitive information between versions, reduce the source code development and management costs for multi-version applications, and improve user experience.

[0177] The present application embodiment provides a data processing device, such as Fig. 9 As shown, the data processing device 90 may include: an acquisition module 901, a determination module 902, a generation module 903, an identification module 904, a deletion module 905 and a compilation module 906;

[0178] The acquisition module 901 is used to acquire at least two first source code files of the application; wherein the at least two first source code files correspond to different versions of the application respectively;

[0179] A determination module 902 is used to determine target code information based on at least two first source code files; wherein the target code information includes at least one of repeated code information between at least two first source code files or logic judgment code information associated with a version in the first source code files;

[0180] A generating module 903, configured to generate a second source code file based on the target code information and the first source code file;

[0181] The identification module 904 is used to create an environment variable, compile the second source code file, and identify the uncompiled code information in the second source code file based on the environment variable; wherein the uncompiled code information is sensitive code information that does not match the target code version; the target code version is the version corresponding to the second source code file;

[0182] A deletion module 905, configured to delete the sensitive code information from the corresponding second source code file to generate a third source code file;

[0183] The compiling module 906 is used to generate a compiled application program based on the third source code file.

[0184] In an embodiment of the present application, a possible implementation is provided. When the target code information includes logic judgment code information associated with the version in the first source code file, the generation module 903 generates the second source code file based on the target code information and the first source code file, and is used to:

[0185] Decoupling logic judgment code information associated with the version from each first source code file, and writing the logic judgment code information into a configuration file of the application program;

[0186] The configuration file is referenced in each first source code file, and the logic judgment code information in the corresponding first source code file is replaced based on a preset read instruction to obtain a second source code file corresponding to each first source code file.

[0187] A possible implementation method is provided in an embodiment of the present application. The generation module 903 is further used to:

[0188] When the logic judgment code information associated with the version cannot be decoupled from the first source code file, obtaining combination information of the logic judgment code information associated with the version and the business logic code information;

[0189] Write the combination information into the configuration file and encapsulate the combination information into semantic variables;

[0190] The combination information in the first source code file is replaced with the semantic variable to obtain a second source code file corresponding to each first source code file.

[0191] In an embodiment of the present application, a possible implementation is provided. When the generating module 903 generates the second source code file based on the target code information and the first source code file, it is further configured to:

[0192] Determine logic processing code information associated with logic judgment code information or combination information in the first source code file;

[0193] Replacing the logic processing code information in the first source code file with the preset variable information;

[0194] The logic processing code information is saved as a new second source code file.

[0195] A possible implementation manner is provided in an embodiment of the present application. When the target code information includes repeated code information between at least two first source code files, the generation module 903 is further configured to:

[0196] Encapsulate the repeated code information into components, and add the corresponding component information to any first source code file;

[0197] The repeated code information in the first source code file is replaced with the component to obtain a second source code file corresponding to each first source code file.

[0198] In an embodiment of the present application, a possible implementation is provided. When the target code information includes repeated code information and logic judgment code information associated with the version in the first source code file, the generation module 903 is further used to:

[0199] Decoupling logic judgment code information associated with the version from each first source code file, and writing the logic judgment code information into a configuration file of the application program;

[0200] The configuration file is referenced in each first source code file, and the logic judgment code information in the corresponding first source code file is replaced based on a preset read instruction to obtain a fourth source code file corresponding to each first source code file;

[0201] Encapsulate the repeated code information into components, and add the corresponding component information to any fourth source code file;

[0202] The repeated code information in the corresponding fourth source code files is replaced with the components to obtain the second source code files corresponding to each fourth source code file.

[0203] A possible implementation manner is provided in an embodiment of the present application. When the determination module 902 determines the target code information based on at least two first source code files, it is used to:

[0204] Matching information of first source code files of different versions, determining duplicate code information between at least two first source code files, and using the duplicate code information as target code information;

[0205] Based on a plurality of preset logic keywords, logic judgment code information associated with the version is screened out from each first source code file, and the logic judgment code information associated with the version is used as target code information.

[0206] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.

[0207] The embodiment of the present application determines the target code information through at least two first source code files; wherein the at least two first source code files correspond to different versions of the application respectively; then based on the target code information and the first source code file, a second source code file is generated; then based on the created environment variables, the second source code file is compiled to generate a third source code file, so as to generate a compiled application based on the third source code file. Since the target code information includes at least one of the repeated code information between at least two first source code files or the logic judgment code information associated with the version in the first source code file, the embodiment of the present application can deduplicate the first source code file according to the repeated code information, or control and adjust the logic code module of the first source code file according to the logic judgment code information, so as to achieve the purpose of reducing the repetition rate between source code files and reducing the cyclomatic complexity of the source code file.

[0208] At the same time, environment variables can be used to identify uncompiled sensitive code information in the second source code file. By deleting the sensitive code information from the corresponding second source code file, the problem of sensitive information leakage between source code files of different versions in the prior art can be effectively solved. Different from the prior art method of adding logical judgment to manage different versions of differential source code, it further reduces the cyclomatic complexity of the source code file, and can also effectively protect sensitive information between versions, reduce the source code development and management costs for multi-version applications, and improve user experience.

[0209] In an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, the processor executes the above-mentioned computer program to implement the steps of the data processing method, and compared with the related art, the following can be achieved: the embodiment of the present application determines the target code information through at least two first source code files; wherein, at least two first source code files correspond to different versions of the application respectively; then based on the target code information and the first source code file, a second source code file is generated; then, based on the created environment variables, the second source code file is compiled to generate a third source code file, so as to generate a compiled application based on the third source code file. Since the target code information includes at least one of the repeated code information between at least two first source code files or the logic judgment code information associated with the version in the first source code file, the embodiment of the present application can deduplicate the first source code file according to the repeated code information, or control and adjust the logic code module of the first source code file according to the logic judgment code information, so as to achieve the purpose of reducing the repetition rate between source code files and reducing the cyclomatic complexity of the source code file.

[0210] At the same time, environment variables can be used to identify uncompiled sensitive code information in the second source code file. By deleting the sensitive code information from the corresponding second source code file, the problem of sensitive information leakage between source code files of different versions in the prior art can be effectively solved. Different from the prior art method of adding logical judgment to manage different versions of differential source code, it further reduces the cyclomatic complexity of the source code file, and can also effectively protect sensitive information between versions, reduce the source code development and management costs for multi-version applications, and improve user experience.

[0211] In an alternative embodiment, an electronic device is provided, such as Fig.10 As shown, Fig.10 The electronic device 100 shown includes: a processor 1001 and a memory 1003. The processor 1001 and the memory 1003 are connected, such as through a bus 1002. Optionally, the electronic device 100 may also include a transceiver 1004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 1004 is not limited to one, and the structure of the electronic device 100 does not constitute a limitation on the embodiments of the present application.

[0212] Processor 1001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 1001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0213] The bus 1002 may include a path to transmit information between the above components. The bus 1002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 1002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0214] The memory 1003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.

[0215] The memory 1003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 1001. The processor 1001 is used to execute the computer program stored in the memory 1003 to implement the steps shown in the above method embodiment.

[0216] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, notebook computers, PADs, etc. and fixed terminals such as digital TVs, desktop computers, etc.

[0217] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0218] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that when the computer device executes the computer instructions, the following conditions are achieved:

[0219] Obtain at least two first source code files of the application; wherein the at least two first source code files correspond to different versions of the application;

[0220] Determining target code information based on at least two first source code files; wherein the target code information includes at least one of repeated code information between the at least two first source code files or logic judgment code information associated with the version in the first source code files;

[0221] generating a second source code file based on the target code information and the first source code file;

[0222] Creating an environment variable, compiling the second source code file, and identifying uncompiled code information in the second source code file based on the environment variable; wherein the uncompiled code information is sensitive code information that does not match the target code version; the target code version is the version corresponding to the second source code file;

[0223] The sensitive code information is deleted from the corresponding second source code file to generate a third source code file; and a compiled application is generated based on the third source code file.

[0224] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.

[0225] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0226] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. A data processing method, characterized in that: include: Obtain at least two first source code files of the application; wherein the at least two first source code files correspond to different versions of the application respectively; Determining target code information based on at least two first source code files; wherein the target code information includes at least one of repeated code information between the at least two first source code files or logic judgment code information associated with a version in the first source code files; generating a second source code file based on the target code information and the first source code file; Creating an environment variable, compiling the second source code file, and identifying uncompiled code information in the second source code file based on the environment variable; wherein the uncompiled code information is sensitive code information that does not match a target code version; and the target code version is a version corresponding to the second source code file; The sensitive code information is deleted from the corresponding second source code file to generate a third source code file; and a compiled application is generated based on the third source code file.

2. The method according to claim 1, characterized in that When the target code information includes logic judgment code information associated with the version in the first source code file, generating a second source code file based on the target code information and the first source code file includes: Decoupling logic judgment code information associated with the version from each of the first source code files, and writing the logic judgment code information into a configuration file of the application; The configuration file is referenced in each of the first source code files, and the logic judgment code information in the corresponding first source code file is replaced based on a preset read instruction to obtain a second source code file corresponding to each first source code file.

3. The method according to claim 2, characterized in that The method further comprises: When the logic judgment code information associated with the version cannot be decoupled from the first source code file, obtaining combination information of the logic judgment code information associated with the version and the business logic code information; Writing the combination information into the configuration file, and encapsulating the combination information into a semantic variable; The combination information in the first source code file is replaced with the semantic variable to obtain a second source code file corresponding to each first source code file.

4. The method according to claim 3, characterized in that The generating a second source code file based on the target code information and the first source code file further includes: Determine logic processing code information associated with the logic judgment code information or the combination information in the first source code file; Replacing the logic processing code information in the first source code file with preset variable information; The logic processing code information is saved as a new second source code file.

5. The method according to claim 1, characterized in that When the target code information includes repeated code information between the at least two first source code files, generating a second source code file based on the target code information and the first source code files includes: Encapsulating the repeated code information into components, and adding corresponding component information to any first source code file; The repeated code information in the first source code files is replaced with the components to obtain second source code files corresponding to each first source code file.

6. The method according to claim 1, characterized in that When the target code information includes the repeated code information and the logic judgment code information associated with the version in the first source code file, generating the second source code file based on the target code information and the first source code file includes: Decoupling logic judgment code information associated with the version from each of the first source code files, and writing the logic judgment code information into a configuration file of the application; The configuration file is referenced in each of the first source code files, and the logic judgment code information in the corresponding first source code file is replaced based on a preset read instruction to obtain a fourth source code file corresponding to each of the first source code files; Encapsulating the repeated code information into components, and adding corresponding component information to any fourth source code file; The repeated code information in the corresponding fourth source code files is replaced with the components to obtain the second source code files corresponding to each fourth source code file.

7. The method according to claim 1, characterized in that The determining of the target code information based on the at least two first source code files includes at least one of the following: Matching information of first source code files of different versions to determine duplicate code information between at least two first source code files, and using the duplicate code information as target code information; Based on a plurality of preset logic keywords, logic judgment code information associated with the version is screened out from each of the first source code files, and the logic judgment code information associated with the version is used as target code information.

8. A data processing device, characterized in that: include: An acquisition module, used to acquire at least two first source code files of an application; wherein the at least two first source code files correspond to different versions of the application respectively; A determination module, configured to determine target code information based on at least two first source code files; wherein the target code information includes at least one of repeated code information between the at least two first source code files or logic judgment code information associated with a version in the first source code files; A generating module, configured to generate a second source code file based on the target code information and the first source code file; an identification module, configured to create an environment variable, compile the second source code file, and identify uncompiled code information in the second source code file based on the environment variable; wherein the uncompiled code information is sensitive code information that does not match a target code version; and the target code version is a version corresponding to the second source code file; A deletion module, used to delete the sensitive code information from the corresponding second source code file to generate a third source code file; A compiling module is used to generate a compiled application based on the third source code file.

9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.