A data processing method, apparatus, device, and medium
By automatically detecting and renaming conflicting identifiers in static libraries, linking errors caused by static library identifier conflicts are resolved, improving processing efficiency and maintaining program stability and performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2025-01-08
- Publication Date
- 2026-07-10
AI Technical Summary
During program development, identifier conflicts in static libraries can lead to linking errors, affecting the stability and reliability of the program. Existing solutions are inefficient and may impact program performance.
By automatically detecting identifier conflicts, obtaining the files to which the conflicting identifiers belong, renaming them, and generating an evaluation report, the program's stability and performance are ensured to remain unaffected.
It improves the efficiency of handling conflicting identifiers, ensuring that the program does not affect stability and performance when resolving identifier conflicts.
Smart Images

Figure CN122363711A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer application development, and more particularly to a data processing method, apparatus, device, and medium. Background Technology
[0002] In software development, static libraries are a common method for code reuse and modularization. By packaging pre-compiled object files into a single file, static libraries can be reused across multiple projects, reducing code redundancy. However, when multiple static libraries contain the same identifiers (such as function names, class names, global variable names, etc.), identifier conflicts can occur. Identifier conflicts can not only cause linking errors but also lead to uncontrollable runtime problems, affecting the stability and reliability of the program.
[0003] Currently, methods for resolving identifier conflicts typically include modifying the identifier, manually modifying the static library, and converting the static library to a dynamic library. Modifying the identifier includes adding a specific namespace or prefix to the conflicting identifier and modifying compilation options to control the visibility of the conflicting identifier. Manually modifying the static library involves manually removing the file to which the conflicting identifier belongs or manually renaming the conflicting identifier. Converting the static library to a dynamic library involves converting the static library with conflicting identifiers into a dynamic library. However, modifying the identifier involves large-scale refactoring, resulting in low efficiency in resolving conflicts. Manually modifying the static library can affect program stability and cause uncontrollable errors. Converting the static library to a dynamic library increases the complexity of program execution and impacts program performance. Summary of the Invention
[0004] This application provides a data processing method, apparatus, device, and medium that can improve the processing efficiency of conflict flags while ensuring that the stability and performance of the program are not affected.
[0005] One embodiment of this application provides a data processing method, including:
[0006] If a linking error is detected in the source code during the linking process, conflict detection is performed on the identifiers in the source code.
[0007] If a flag conflict is detected in the source program, the conflict flag in the source program is retrieved.
[0008] Obtain the first identifier mapping table corresponding to the source program, and determine the first file to which the conflicting identifier belongs in the first identifier mapping table;
[0009] The conflict markers in the first file are renamed to obtain the second file. The first file in the source program is replaced with the second file to obtain the updated source program.
[0010] Obtain the second identifier mapping table corresponding to the updated source program, compare and analyze the first identifier mapping table and the second identifier mapping table, and generate an evaluation report for the second file.
[0011] One embodiment of this application provides a data processing apparatus, including:
[0012] The link detection module is used to perform conflict detection on the identifiers in the source program if a linking error is detected during the linking process.
[0013] The conflict detection module is used to obtain the conflict flags in the source program if a flag conflict is detected.
[0014] The mapping table acquisition module is used to obtain the first identifier mapping table corresponding to the source program, and determine the first file to which the conflicting identifier belongs in the first identifier mapping table;
[0015] The renaming module is used to rename the conflict flags in the first file to obtain the second file. The first file in the source program is replaced with the second file to obtain the updated source program.
[0016] The report generation module is used to obtain the second identifier mapping table corresponding to the updated source program, compare and analyze the first identifier mapping table and the second identifier mapping table, and generate an evaluation report for the second file.
[0017] The first identifier mapping table includes a first file list and a first identifier list;
[0018] The mapping table acquisition module determines the first file to which the conflicting identifier belongs in the first identifier mapping table, and performs the following steps:
[0019] In the first identifier list, determine the file identifier of the conflict identifier, and based on the file identifier, determine the target static library to which the conflict identifier belongs in the first file list;
[0020] In the target static library to which the conflict identifier belongs, determine the first file to which the conflict identifier belongs.
[0021] The mapping table acquisition module determines the first file to which the conflict identifier belongs in the target static library, and is also used to perform the following steps:
[0022] Obtain the target static library to which the conflict identifier belongs, perform architectural splitting on the target static library to obtain M types of sub-static libraries, where M is a positive integer;
[0023] In the M-class sub-static library, determine the first sub-static library to which the conflict flag belongs;
[0024] The first static library is decompressed to obtain N binary files. Among the N binary files, the first file to which the conflict flag belongs is determined; N is a positive integer.
[0025] The renaming module replaces the first file in the source program with the second file to obtain the updated source program, which is then used to perform the following steps:
[0026] In N binary files, the first file is replaced with the second file to obtain N updated binary files. The updated N binary files are then encapsulated to obtain the updated first static library.
[0027] In the static library of class M, the first static library is replaced with the updated first static library to obtain the updated static library of class M;
[0028] The updated M-class static library is architecturally merged to obtain the updated target static library;
[0029] In the source code, the target static library is replaced with the updated target static library to obtain the updated source code.
[0030] The report generation module obtains the second identifier mapping table corresponding to the updated source program, compares and analyzes the first identifier mapping table and the second identifier mapping table, and generates an evaluation report for the second file, which is used to perform the following steps:
[0031] The updated source program is compiled and linked to generate a second identifier mapping table;
[0032] Get the list of first identifiers in the first identifier mapping table, and get the list of second identifiers in the second identifier mapping table;
[0033] Compare and analyze the first and second identifier lists to count the number of changed identifiers;
[0034] Based on the number of change flags, generate an evaluation report for the second document.
[0035] The report generation module compiles and links the updated source code to generate a second identifier mapping table, and is also used to perform the following steps:
[0036] Obtain the first identifier from the updated source code file;
[0037] If a second identifier matching the first identifier is found in the static library included in the updated source program, then a correspondence is established between the addresses of the first identifier and the binary files to which the second identifier belongs, and the link address of the first identifier is obtained.
[0038] Generate a second identifier mapping table based on the first identifier and its link address.
[0039] The device also includes:
[0040] The file generation module is used to determine that the updated source program was successfully linked during the linking process if the number of new and removed flags in the evaluation report of the second file is zero, and to generate an executable file based on the updated source program; the executable file can be used to start the application indicated by the updated source program.
[0041] The error determination module is used to determine that the updated source program has a linking error during the linking process if the number of newly added flags and removed flags in the evaluation report of the second file is not zero.
[0042] One aspect of this application provides a computer device, including a memory and a processor. The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method provided in one aspect of this application.
[0043] One aspect of this application provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having a processor performs the method provided in one aspect of this application.
[0044] According to one aspect of this application, a computer program product is provided, which may include a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and executes the computer program, causing the computer device to perform the method provided in the above aspect.
[0045] In this embodiment, when a conflicting identifier is detected in the source program, the conflicting identifier is retrieved, and a first identifier mapping table corresponding to the source program is obtained. The first file to which the conflicting identifier belongs is determined in the identifier mapping table. The conflicting identifier in the first file is renamed to obtain a second file. The first file in the source program is replaced with the second file to obtain an updated source program. The updated source program is compiled and linked to generate a second identifier mapping table. The first and second identifier mapping tables are compared and analyzed to generate an evaluation report for the second file. In this embodiment, the first file to which the conflicting identifier belongs is determined through the first identifier mapping table. The conflicting identifier in the first file is automatically renamed, and the first file in the source program is replaced with the second file to obtain an updated source program. The updated source program is then recompiled and linked to generate an evaluation report for the second file. This improves the efficiency of conflicting identifier processing while ensuring that the stability and performance of the program are not affected. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application;
[0048] Figure 2 This is a schematic diagram of a data processing scenario provided in an embodiment of this application;
[0049] Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of this application;
[0050] Figure 4 This is a schematic diagram of a first identifier mapping table provided in an embodiment of this application;
[0051] Figure 5 This is a schematic diagram of a process for renaming conflict flags provided in an embodiment of this application;
[0052] Figure 6 This is a schematic diagram of a data processing flowchart provided in an embodiment of this application;
[0053] Figure 7 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0054] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0056] For ease of understanding, the basic technical concepts involved in the embodiments of this application will be described below:
[0057] An executable file is a file that can be directly run by a computer's operating system. An executable file contains program code, data, and other information needed for the operating system to load and execute the program. The process of generating an executable file includes four steps: preprocessing, compilation, assembly, and linking. Preprocessing refers to preprocessing instructions such as macro definitions and header files in the source program to generate a preprocessed source program file.
[0058] Compilation refers to the process of using a compiler to read a source program and convert it into specific assembly language or machine code. After compilation, the source program will generate one or more object files (such as .obj files or .o files), which contain the machine code or assembly language of the source program.
[0059] Assembly: refers to the process of reading one or more object files generated by compilation using an assembler and converting them into binary format files (such as binary .bin files or binary .o files).
[0060] A static library is a collection of code and data that is copied into the final executable file during program compilation and linking. They are pre-compiled object code sets intended for sharing among multiple programs.
[0061] Linkmap file: This refers to the linking information file generated during the compilation and linking process. It records the mapping of identifiers in the source code to their addresses and locations in the final executable file. The linkmap file includes the addresses of each segment and section, a list of files, a list of identifiers, etc.
[0062] Identifier modification tool (llvm-objcopy): llvm-objcopy is part of the compiler framework system (Low Level Virtual Machine, LLVM), and it can be used to modify the names of programming entities such as variables, functions, and classes.
[0063] Please see Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided in an embodiment of this application; the network architecture may include a server 10d and a terminal cluster, and the terminal cluster may include one or more terminal devices, without limiting the number of terminal devices included in the terminal cluster. Figure 1 As shown, the terminal cluster may specifically include terminal device 10a, terminal device 10b, and terminal device 10c, etc.; all terminal devices in the terminal cluster (for example, may include terminal device 10a, terminal device 10b, and terminal device 10c, etc.) can be connected to server 10d via the network so that each terminal device can interact with server 10d through the network connection.
[0064] in, Figure 1 The terminal devices in the terminal cluster shown may include, but are not limited to: smartphones, tablets, laptops, PDAs, desktop computers, wearable devices (such as smartwatches, smart bracelets, etc.), smart voice interaction devices, smart home appliances (such as smart TVs, etc.), in-vehicle devices, aircraft, and other electronic devices. This application does not limit the type of terminal device.
[0065] Figure 1 The server 10d shown can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. This application does not limit the type of server.
[0066] In the embodiments of this application, Figure 1 Each terminal device in the terminal cluster shown can run a program development tool. When the program development tool runs on each terminal device, it can interact with... Figure 1The servers 10d shown interact with each other. The program development tools running on each terminal device can be any tool with program development capabilities, such as VSCode (Visual Studio Code, a lightweight code editor), PyCharm (a Python-based integrated development environment), DataGrip (a cross-platform database management client tool), Qt Creator (a visual interface-enabled integrated development environment), etc., one or more of these tools, which process the program input into the program development tool.
[0067] Figure 1 The server 10d shown can be the backend server corresponding to the program development tools running in each terminal device. If multiple program development tools are running in a terminal device (e.g., terminal device 10a), then the multiple program development tools can correspond to different servers or the same server, and this application does not limit this. For example, if program development tool A and program development tool B are installed in terminal device 10a, then the server corresponding to program development tool A and the server corresponding to program development tool B can be the same server or different servers.
[0068] Please see Figure 2 , Figure 2 This is a schematic diagram of a data processing scenario provided in an embodiment of this application. Figure 2 The program development tool interface described herein is merely an example; other presentation methods may also be included, and this application does not limit them.
[0069] like Figure 2As shown, the program development tool interface 2a includes a toolbar 01, a program interface 02, and a source program directory interface 03. The toolbar 01 includes file (F) controls, edit (E) controls, and compile / link buttons. The source program directory interface 03 displays the directory information of the source program (e.g., code files, static libraries). The source program can include, but is not limited to, code files (Ac files, Bc files, and Cc files) and static libraries (Xa, Ya, and Za). Here, .c refers to the extension of C language code files. .c files contain program code written in C language. C language is a widely used high-level programming language that provides rich data types, control structures, and functions. .a refers to the extension of static libraries. .a static libraries include multiple related binary format object files. Object files are intermediate files generated after compiling the source code, containing machine code for functions, variables, and other symbols defined in the source code. Binary format object files are files converted from object files to binary format by an assembler.
[0070] In response to the triggering of the compile and link button, the compiler reads the source program and links the code files (e.g., ...) from the source program. Figure 2 The Ac, Bc, and Cc files shown are converted into machine code, generating corresponding object files. For example, the Ac file is compiled into object file Ao, the Bc file into object file Bo, and the Cc file into object file Co. The assembler then converts the compiled object files (Ao, Bo, and Co) into binary format object files. For ease of understanding, these binary format object files can be referred to as binary files. For example, the object files (Ao, Bo, and Co) are converted into binary files (binary file Ao, binary file Bo, and binary file Co) by the assembler.
[0071] After the source program is compiled and assembled, the linker links the identifiers in the corresponding binary files of the code files with the binary files in the static library. Linking refers to establishing a correspondence between identifiers and the addresses of binary files in the static library. Identifiers are the names of programming entities such as variables, functions, and classes. Identifiers serve as a means for the compiler and linker to identify these entities, enabling the program to reference and link to the correct code or data. For example, if the identifier 'a' in binary file Ao is "DoThing", and the identifier 'b' in binary file 'do' contained in static library Xa is also "DoThing", it means that identifier 'b' is an identifier with the same name as identifier 'a'. Therefore, a correspondence is established between identifier 'a' and the address of binary file 'do' in static library Xa, and the address of binary file 'do' is used as the link address of identifier 'a'.
[0072] When a computer device detects a linking error in the source program during the linking process, such as Figure 2 As shown in 2b, the program development tool interface displays "! Linking error", the source program stops linking, the computer device performs conflict detection on the identifiers in the source program, and when an identifier conflict is detected in the source program, it obtains the conflict flag in the source program.
[0073] like Figure 2 As shown in 2c, the specific process by which a linking error occurs in the source program due to a conflicting identifier includes: For example, if identifier a is "DoThing", when linking the identifier a "DoThing" in the binary file Ao, and the binary file do contained in the static library Xa contains an identifier b "DoThing" with the same name as identifier a, and the binary file mo contained in the static library Ya contains an identifier c "DoThing" with the same name as identifier a, then the computer cannot determine whether to use the address of the binary file do containing identifier b "DoThing" as the linking address of identifier a or the address of the binary file mo containing identifier c "DoThing" as the linking address of identifier a, resulting in a linking error in the source program. The conflicting identifiers are identifier b "DoThing" or identifier c "DoThing".
[0074] In practical applications, when a conflict flag of "a" "DoThing" is detected, the computer automatically retrieves the linkmap file generated during the compilation and linking of the source program. It then obtains the file identifier of the conflict flag "a" "DoThing" from the list of flags contained in the linkmap file. Based on this file identifier, it determines the target static library to which the conflict flag "a" belongs from the file list contained in the linkmap file. Finally, it identifies the binary file to which the conflict flag "a" "DoThing" belongs within the target static library. Figure 2 As shown in 2c, the binary files to which the conflict flag a belongs include the binary file do contained in the static library Xa and the binary file mo contained in the static library Ya.
[0075] Use the identifier modification tool (llvm-objcopy) to rename the identifier "DoThing" in any binary file within the binary file containing the conflicting identifier "DoThing". For example, ... Figure 2 As shown in 2d, the identifier "DoThing" in the binary file mo contained in the static library Ya is renamed. Specifically, a prefix is added to the identifier "DoThing", and the identifier "DoThing" is renamed to the identifier "Y_DoThing", resulting in the updated binary file mo, and thus the updated static library Ya.
[0076] Replace the static library Ya in the source program with the updated static library Ya to obtain the updated source program. Compile and link the updated source program, as follows: Figure 2 As shown in 2d, when the identifier 'a' "DoThing" in the binary file Ao is linked, the binary file 'do' contained in the static library Xa contains an identifier 'b' with the same name as identifier 'a', while the binary file 'mo' contained in the static library Ya does not contain an identifier with the same name as identifier 'a'. The computer device uses the address of the binary file 'do' contained in the static library Xa as the link address of identifier 'a', and the linking is successful. Figure 2 As shown in 2e, the program development tool interface displays "Linking successful!" and generates the updated linkmap file corresponding to the source program. The linkmap file generated by compiling and linking the source program is compared and analyzed with the linkmap file generated by compiling and linking the updated source program, and an evaluation report of the updated binary file mo is generated.
[0077] In this embodiment, when a linking error occurs in the source program during the linking process, conflict detection can be automatically performed on the identifiers in the source program. When a conflicting identifier is detected, a linkmap file can be automatically obtained. The linkmap file is used to determine the static library to which the conflicting identifier belongs. Within the static library, the binary file to which the conflicting identifier belongs is determined. The conflicting identifier in the binary file is automatically renamed to obtain an updated static library, and thus an updated source program. By automatically renaming the conflicting identifiers in the static library, linking errors caused by identical identifier names in the static library can be resolved in the source program. This improves the efficiency of conflict identifier processing while ensuring that the stability and performance of the program are not affected.
[0078] Please see Figure 3 , Figure 3 This is a schematic flowchart illustrating a data processing method provided in an embodiment of this application. It can be understood that this data processing method is executed by a computer device, which can be a terminal device (e.g., Figure 1 Any terminal device in the set of terminal devices shown), or a server (such as... Figure 1 The server 10d shown is not limited in this application. The data processing method may include the following steps S101 to S105:
[0079] Step S101: If a linking error is detected in the source program during the linking process, conflict detection is performed on the identifiers in the source program.
[0080] In this context, "source program" refers to program code written in a high-level programming language (e.g., C, C++, Java, Python, etc.) that can achieve a specific function or solve a specific problem. A source program may include, but is not limited to, at least one code file and at least one static library. A code file may include, but is not limited to, program code such as variables, functions, and classes. This application does not limit the content included in the source program or the content included in the code file. For example, a source program written in C may include at least one C language code file (e.g., ...). Figure 2 The Ac, Bc, and Cc files shown can be used as examples. Alternatively, a source program written in C can include at least one C code file and at least one static library. Similarly, a source program written in Python can include at least one Python code file. Python code files have the extension .py, and for ease of understanding, they can be referred to as .py files.
[0081] The linking process refers to the process by which a linker links the binary files generated after compilation and assembly of the source program to produce an executable file. Linking errors refer to errors that occur during the linking process. These errors can include, but are not limited to, identifier conflicts, corrupted static libraries, incompatible binary file formats in the static library, linker configuration errors, and address relocation errors. This application does not limit the types of linking errors that occur during the linking process. Specifically, corrupted static libraries refer to the static library being corrupted during transmission, preventing the linker from linking to it. Linker configuration errors refer to an incorrect order in which the linker links the static libraries or incorrect linker parameter configuration, causing the linker to fail to perform the linking operation correctly. Address relocation refers to the linker's inability to resolve the address relocation information of the binary files in the static library, leading to a linking error.
[0082] The linker processes the binary files (e.g., generated from the compiled and assembled source program) through the linker. Figure 2 The binary files Ao, Bo, and Co are linked together. When a linking error is detected in the source program, a conflict detection is performed on the identifiers in the source program.
[0083] For example, a source program is called source program A. Source program A includes code files (Ac file, Bc file and Cc file) and static libraries (Xa, Ya and Za). The code files in the source program are compiled by a compiler to generate the corresponding object files (Ao file, Bo file and Co file). The compiler can include, but is not limited to, Xcode compiler, Bazel compiler, CMake compiler, etc. This application does not limit the type of compiler.
[0084] The assembler performs binary conversion on the generated object file to generate corresponding binary files (binary file Ao, binary file Bo, binary file Co). The linker links the identifiers in the binary files (binary file Ao, binary file Bo, binary file Co) corresponding to the code file with the addresses of the binary files in the static library. If there are linking errors during the linking process, conflict detection is performed on the identifiers in the source program.
[0085] Step S102: If a flag conflict is detected in the source program, the conflict flag in the source program is obtained.
[0086] In this context, a flag conflict refers to a situation where, during the linking process, two flags with the same name exist in a static library or its binary file, causing the linker to be unable to determine which flag to reference. For example, if the flag 'a' in the binary file Ao corresponding to the code file is linked, and both static libraries Xa and Ya contain flags with the same name (flag 'b' in Xa and flag 'c' in Ya), the linker cannot determine whether to reference flag 'b' or flag 'c'. In other words, the linker cannot determine whether to use the address of the binary file containing flag 'b' as the link address for flag 'a', or the address of the binary file containing flag 'c' as the link address for flag 'a'. In this case, flags 'b' and 'c' are considered conflicting flags.
[0087] If a conflicting identifier is detected in the source program, the conflicting identifier in the source program is retrieved. For example, if static library 1 and static library 2 have the same name and the name of static library 1 and static library 2 is "State", then the conflicting identifier "State" in the source program is retrieved. As another example, if static library m and static library n have the same identifier "Name", then the conflicting identifier "Name" in the source program is retrieved.
[0088] Step S103: Obtain the first identifier mapping table corresponding to the source program, and determine the first file to which the conflicting identifier belongs in the first identifier mapping table;
[0089] The identifier mapping table refers to the linking information file generated during the compilation and linking process of the source program. For example... Figure 2 The linkmap file shown may contain, but is not limited to, the following in the identifier mapping table: resource paths, file lists, section addresses, identifier lists, etc. This application does not limit the content included in the first identifier mapping table. The first file refers to the binary file in the static library to which the conflicting identifier belongs. For example, if the identifier "Name" in binary file b contained in static library a is a conflicting identifier, then the first file to which the conflicting identifier "Name" belongs is binary file b.
[0090] The resource path records the paths to the code files involved in the linking and the processor architecture types supported by the generated executable file. The file list lists the binary files involved in the linking and their corresponding file identifiers. File identifiers may include the binary file number, file name, etc., which are not limited in this application. The binary files involved in the linking may include the binary files corresponding to the code files in the source program and the binary files in the static library. The section address records the address, size, and other information of each segment in the executable file. The identifier list records information about the identifiers contained in the executable file. This information may include, but is not limited to, the identifier name, identifier address, identifier size, identifier file identifier, etc., which are not limited in this application.
[0091] The first identifier mapping table corresponding to the source program is obtained. The first identifier mapping table includes a first file list and a first identifier list. It should be noted that the process of obtaining the first identifier mapping table corresponding to the source program and obtaining the second identifier mapping table corresponding to the updated source program are the same. This application will take the process of obtaining the second identifier mapping table corresponding to the updated source program as an example to describe it in detail, and will not repeat it here.
[0092] Please see Figure 4 , Figure 4 This is a schematic diagram of a first identifier mapping table provided in an embodiment of this application. Figure 4 The first identifier mapping table shown is merely an example; the first identifier mapping table may also include other content, and this application does not limit the first identifier. For example... Figure 4 As shown, the first identifier mapping table includes a first file list and a first identifier list, with the file identifier taking the binary file number as an example.
[0093] The first file list includes file identifiers and file addresses, for example, Figure 4 The file identifier [9] and file address “xxx / xxx / xxx / libprivate.a / arm64 / main.o” are shown, where “libprivate.a” refers to the static library, “arm64” refers to the processor architecture of the static library, and “main.o” refers to the binary file in the static library. The first identifier list includes the address of the identifier, the size of the identifier, the file identifier of the identifier, and the name of the identifier. The file identifier of the identifier refers to the file identifier of the binary file to which the identifier belongs, such as Figure 4As shown, the address of the identifier “Add” is “0x100009FC4”, the size of the identifier “Add” is “0x000000A0”, the file identifier of the identifier “Add” is “[9]”, and the name of the identifier “Add” is “Add”.
[0094] The specific process of determining the first file to which the conflicting identifier belongs in the first identifier mapping table includes: determining the file identifier of the conflicting identifier in the first identifier list; determining the target static library to which the conflicting identifier belongs in the first file list based on the file identifier; and determining the first file to which the conflicting identifier belongs in the target static library. Specifically, the process of determining the first file to which the conflicting identifier belongs in the target static library includes: obtaining the target static library to which the conflicting identifier belongs; performing architectural splitting on the target static library to obtain M types of sub-static libraries, where M is a positive integer; determining the first sub-static library to which the conflicting identifier belongs in the M types of sub-static libraries; decompressing the first static library to obtain N binary files; and determining the first file to which the conflicting identifier belongs in the N binary files, where N is a positive integer.
[0095] Specifically, architecture decomposition refers to splitting a static library (with the .a extension) containing multiple processor architectures into multiple sub-static libraries containing only a single processor architecture. For example, splitting a static library 'a' containing three processor architectures into three sub-static libraries containing only a single architecture. Processor architecture refers to the internal structure and function of a computer processor based on specific design principles and specifications. The processor architecture of a static library can include, but is not limited to, arm64, armv7, and the x86_64 emulator, etc. This application does not limit the processor architecture of the static library. Static library decompression refers to extracting the binary files contained within the static library (e.g., ...). Figure 2 The process of showing the binary file (mo) or other related resources.
[0096] For example, if the conflict flag is "Add", the first flag list is as follows: Figure 4 As shown, in the first identifier list, identify the file identifier with the conflict identifier "Add", such as... Figure 4 As shown, the file identifier for the conflict flag "Add" is "[9]", and according to the file identifier "[9]", in Figure 4 In the first file list shown, determine the file address corresponding to the file identifier "[9]", and in the file address, determine that the target static library to which the conflict identifier belongs is "libprivate.a", the processor architecture of the static library to which the conflict identifier belongs is "arm64", and the first file to which the conflict identifier belongs is "main.o".
[0097] To obtain the target static library "libprivate.a" to which the conflict identifier "Add" belongs, for example, if the target static library "libprivate.a" includes three processor architectures: arm64, armv7, and the x86_64 simulator, in practical applications, the "lipo" tool can be used to split the target static library "libprivate.a" into three sub-static libraries: an arm64 sub-static library, an armv7 sub-static library, and an x86_64 simulator sub-static library. Figure 4 As shown, the processor architecture of the static library to which the conflict identifier "Add" belongs is "arm64". Among the arm64 sub-static library, the armv7 sub-static library and the x86_64 simulator sub-static library, the first sub-static library to which the conflict identifier "Add" belongs is determined to be the arm64 sub-static library, and the arm64 sub-static library is obtained.
[0098] In practical applications, the sub-static library can be decompressed using either the "ar" decompression tool or the bandzip decompression tool. This application does not limit the decompression tool used for decompressing the sub-static library. For example, the "ar" decompression tool can be used to decompress the arm64 sub-static library, resulting in N binary files. For instance, if N is 5, the resulting 5 binary files may include main.o, void.o, read.o, math.o, and write.o. Figure 4 As shown, if the first file to which the conflict flag belongs is "main.o", then among the binary files main.o, void.o, read.o, math.o, and write.o, the first file (also called the binary file) to which the conflict flag "Add" belongs, "main.o", will be retrieved.
[0099] Step S104: Rename the conflict flags in the first file to obtain the second file, replace the first file in the source program with the second file to obtain the updated source program;
[0100] The renaming process refers to renaming or adding a prefix to an identifier. For example, if the identifier is "Name", renaming "Name" could mean renaming it to "read" or adding a prefix to make it "y_Name". The second file refers to the first file after the renaming process.
[0101] For example, rename the conflict marker "Add" in the first file "main.o" by adding a prefix, making it "y_Name", thus obtaining the second file.
[0102] The specific process of replacing the first file in the source program with the second file to obtain the updated source program includes: replacing the first file with the second file in N binary files to obtain N updated binary files; encapsulating the updated N binary files to obtain the updated first static library; replacing the first static library with the updated first static library in the M-class static library to obtain the updated M-class static library; merging the updated M-class static libraries to obtain the updated target static library; and replacing the target static library with the updated target static library in the source program to obtain the updated source program.
[0103] Specifically, encapsulation refers to the process of packaging N binary files into a single sub-static library. Architecture merging refers to the process of merging multiple sub-static libraries for a single processor architecture into a single static library. For example, taking the target static library "libprivate.a" as an example, the static library "libprivate.a" contains three processor architectures (arm64, armv7, and the x86_64 simulator). In the five binary files obtained by decompressing the arm64 sub-static library, the first file "main.o" is replaced with the second file (which can be understood as the first file after renaming), resulting in five updated binary files. These updated five binary files are then encapsulated to obtain the updated arm64 sub-static library (the first static library). In the three types of static libraries (arm64 sub-static library, armv7 sub-static library, and x86_64 simulator sub-static library), the arm64 sub-static library (the first static library) is replaced with the updated arm64 sub-static library (the first static library), resulting in the updated three types of static libraries.
[0104] The updated three types of static libraries (arm64 sub-static library, armv7 sub-static library, and x86_64 simulator sub-static library) are architecturally merged to obtain the updated static library "libprivate.a". In the source program, the static library "libprivate.a" is replaced with the updated static library "libprivate.a" to obtain the updated source program.
[0105] Please see Figure 5 , Figure 5 This is a schematic diagram of a conflict identifier renaming process provided in an embodiment of this application, such as... Figure 5 As shown, renaming conflicting identifiers involves the following 5 steps:
[0106] Static library architecture splitting: Static libraries typically contain multiple processor architectures, such as arm64, armv7, and x86_64 emulator architectures. The "lipo" tool is used to split the static library containing the conflicting identifier into multiple sub-static libraries with a single processor architecture.
[0107] To decompress a static library, you can obtain binary files: For the sub-static library to which the conflict flag belongs, use the "ar" tool to decompress it, thereby obtaining multiple binary files.
[0108] Renaming conflict flags in binary files: Use a flag modification tool (llvm-objcopy) to rename conflict flags in binary files, for example, by adding a prefix to the conflict flags, to obtain the modified binary file.
[0109] Encapsulate binary files into a static library: Replace the binary file containing the conflict flag with the modified binary file, and use the "ar" tool to repackage the updated binary files into the sub-static library to which the conflict flag belongs, resulting in the updated sub-static library.
[0110] Merging static library architectures: The "lipo" tool is used to merge sub-static libraries with different architectures into a complete static library.
[0111] Step S105: Obtain the second identifier mapping table corresponding to the updated source program, compare and analyze the first identifier mapping table and the second identifier mapping table, and generate an evaluation report for the second file.
[0112] The specific process of obtaining the second identifier mapping table corresponding to the updated source program includes: obtaining the first identifier in the code file of the updated source program; if a second identifier matching the first identifier is found in the static library included in the updated source program, then establishing a correspondence between the addresses of the first identifier and the binary files to which the second identifier belongs, and obtaining the link address of the first identifier; and generating the second identifier mapping table based on the first identifier and its link address.
[0113] The second identifier refers to the identifier in the static library that has the same name as the first identifier. For example, if the first identifier is "Name", and the identifier 'a' in the static library has the same name as the first identifier, then the identifier 'a' in the static library can be called the second identifier that matches the first identifier. Establishing a correspondence means associating the addresses of the binary files to which the first identifier and the second identifier belong.
[0114] Specifically, if the updated source program is a program containing three code files (Ac files) and three static libraries (Xa, Ya, and Za), and the identifier in the code file (Ac file) is "read", the first identifier "read" is retrieved. Then, in the static libraries (Xa, Ya, and Za) included in the source program, an identifier with the same name as the first identifier "read" is searched. If a second identifier (e.g., identifier w) with the same name as the first identifier "read" is found in the binary file "do" included in the static library Xa, the addresses of the binary files to which the first identifier and the second identifier belong are associated to obtain the link address of the first identifier "read". For example, if the address of the binary file "do" included in the static library Xa is "xxx / xxx / xxx / Xa / arm64 / do", then the link address of the first identifier "read" is "xxx / xxx / xxx / Xa / arm64 / do".
[0115] The linker assigns a file identifier to each binary file (.o file) participating in the linking. For example, the linker assigns a file identifier to the binary file do participating in the linking as the file identifier [9]. The address of the first identifier "read", the size of the first identifier "read", the file identifier of the first identifier "read", and the name of the first identifier "read" are obtained. A second identifier list is generated based on the address of the first identifier "read", the size of the first identifier "read", the file identifier of the first identifier "read", and the name of the first identifier "read". A second file list is generated based on the file identifier of the first identifier "read" and the link address of the first identifier "read". A second identifier mapping table is generated based on the second identifier list and the second file list.
[0116] The specific process of comparing and analyzing the first identifier mapping table and the second identifier mapping table to generate the evaluation report of the second document includes: obtaining the first identifier list in the first identifier mapping table and obtaining the second identifier list in the second identifier mapping table; comparing and analyzing the first identifier list and the second identifier list to count the number of changed identifiers; and generating the evaluation report of the second document based on the number of changed identifiers.
[0117] Among them, the change markers refer to the markers added and removed from the second marker list compared to the first marker list. For ease of understanding, the added markers can be called added markers and the removed markers can be called removed markers.
[0118] Get the first flag list in the first flag mapping table, get the second flag list in the second flag mapping table, compare and analyze the first flag list and the second flag list, and count the number of newly added flags and the number of decremented flags. For example, if the obtained first flag list includes 3 flags, the 3 flags are “some”, “another” and “app”, the address, size, file identifier and name of the flag “some” are {0x100001A60, 0x00000060, [1]}, the address, size, file identifier and name of the flag “another” are {0x100001AC0, 0x00000059, [2]}, and the address, size, file identifier and name of the flag “app” are {0x100001B20, 0x00000046, [2]}.
[0119] If the obtained second identifier list includes 3 identifiers, the 3 identifiers are “some”, “another”, and “add”, the address, size, file identifier and name of the identifier “some” are 0x100001A60, 0x00000060 and [1], the address, size, file identifier and name of the identifier “another” are {0x100001AC0, 0x00000059, [2]}, and the address, size, file identifier and name of the identifier “add” are 0x100001C21, 0x00000078 and [5].
[0120] A comparative analysis is performed on the first list of identifiers and the second list of identifiers. The first list of identifiers includes the identifiers "some", "another" and "app", while the second list of identifiers includes the identifiers "some", "another" and "add". The new identifier is "add", and the decrease identifier is "app". The number of new identifiers is 1, and the number of decrease identifiers is 1.
[0121] An evaluation report for the second document is generated based on the number of newly added and reduced markers. For example, the evaluation report for the second document may include "the number of newly added markers is 1, and the number of reduced markers is 1". Or, for example, the evaluation report for the second document may include "the newly added marker is 'add', the reduced marker is 'app', the number of newly added markers is 1, and the number of reduced markers is 1". This application does not limit the content of the evaluation report for the second document.
[0122] If the number of newly added or removed flags in the evaluation report of the second file is zero, it is determined that the updated source program was successfully linked during the linking process, and an executable file is generated based on the updated source program; the executable file can be used to launch the application indicated by the updated source program. If the number of newly added or removed flags in the evaluation report of the second file is not zero, it is determined that there is a linking error in the updated source program during the linking process.
[0123] The application can include, but is not limited to, game applications, chat applications, short video applications, etc. This application does not limit the type of application. For example, if the evaluation report of the second file includes "the number of newly added identifiers is 0, and the number of removed identifiers is 0," it indicates that the updated source program was successfully linked during the linking process, and an executable file is generated based on the updated source program; the executable file can be used to launch the game application indicated by the updated source program. If the number of newly added identifiers and removed identifiers in the evaluation report of the second file is not zero, for example, if the evaluation report of the second file includes "the number of newly added identifiers is 1, and the number of removed identifiers is 1," it is determined that a linking error exists in the updated source program during the linking process.
[0124] Please see Figure 6 , Figure 6 This is a schematic diagram of a data processing flowchart provided in an embodiment of this application, such as... Figure 6 As shown, the source program is built and compiled and linked. If a linking error occurs during the linking process, a conflict detection is automatically performed on the identifiers in the source program. Once an identifier conflict is detected, the conflicting identifier and the first identifier mapping table are automatically obtained. In the first identifier mapping table, the first file to which the conflicting identifier belongs is determined. The conflicting identifier is renamed using an identifier modification tool (llvm-objcopy) to obtain a second file. The first file in the static library is replaced with the second file to obtain an updated static library. The updated static library is then reloaded into the source program to obtain an updated source program, ensuring the functional integrity of the application indicated by the entire source program.
[0125] The updated source code is recompiled and linked to verify the success of the identifier renaming. A second identifier mapping table is generated, and the first and second identifier mapping tables are obtained. The first identifier list in the first identifier mapping table and the second identifier list in the second identifier mapping table are automatically compared and analyzed. The number of newly added and removed identifiers before and after the modification is counted. Based on the number of newly added and removed identifiers, a detailed evaluation report is generated to assess the effectiveness of this identifier renaming. If there are no linking errors in the source code during the linking process, that is, if no identifier conflict is detected automatically in the source code, the process ends.
[0126] In this embodiment, when a conflicting identifier is detected in the source program, the conflicting identifier and a first identifier mapping table generated during compilation and linking can be automatically obtained. Within this mapping table, the first file to which the conflicting identifier belongs is automatically determined. The conflicting identifier in the first file is automatically renamed to obtain a second file. The first file in the source program is then replaced with the second file to obtain an updated source program. The updated source program is then compiled and linked to generate a second identifier mapping table. A comparative analysis of the first and second identifier mapping tables is performed to generate an evaluation report for the second file. This approach improves the efficiency of conflicting identifier processing while ensuring that program stability and performance are not affected.
[0127] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Figure 7 As shown, the data processing device 1 may include: a link detection module 101, a conflict detection module 102, a mapping table acquisition module 103, a renaming processing module 104, and a report generation module 105.
[0128] The link detection module 101 is used to perform conflict detection on the identifiers in the source program if a linking error is detected during the linking process.
[0129] The conflict detection module 102 is used to obtain the conflict flag in the source program if a flag conflict is detected in the source program.
[0130] The mapping table acquisition module 103 is used to acquire the first identifier mapping table corresponding to the source program, and determine the first file to which the conflicting identifier belongs in the first identifier mapping table;
[0131] The renaming processing module 104 is used to rename the conflict flags in the first file to obtain the second file, and replace the first file in the source program with the second file to obtain the updated source program.
[0132] The report generation module 105 is used to obtain the second identifier mapping table corresponding to the updated source program, compare and analyze the first identifier mapping table and the second identifier mapping table, and generate an evaluation report for the second file.
[0133] In one or more embodiments, the first identifier mapping table includes a first file list and a first identifier list;
[0134] In one or more embodiments, the mapping table acquisition module 103 determines the first file to which the conflicting identifier belongs in the first identifier mapping table, and performs the following steps:
[0135] In the first identifier list, determine the file identifier of the conflict identifier, and based on the file identifier, determine the target static library to which the conflict identifier belongs in the first file list;
[0136] In the target static library to which the conflict identifier belongs, determine the first file to which the conflict identifier belongs.
[0137] In one or more embodiments, the mapping table acquisition module 103, in the target static library to which the conflict identifier belongs, determines the first file to which the conflict identifier belongs, and is further configured to perform the following steps:
[0138] Obtain the target static library to which the conflict identifier belongs, perform architectural splitting on the target static library to obtain M types of sub-static libraries, where M is a positive integer;
[0139] In the M-class sub-static library, determine the first sub-static library to which the conflict flag belongs;
[0140] The first static library is decompressed to obtain N binary files. Among the N binary files, the first file to which the conflict flag belongs is determined; N is a positive integer.
[0141] In one or more embodiments, the renaming processing module 104 replaces the first file in the source program with the second file to obtain an updated source program, which is used to perform the following steps:
[0142] In N binary files, the first file is replaced with the second file to obtain N updated binary files. The updated N binary files are then encapsulated to obtain the updated first static library.
[0143] In the static library of class M, the first static library is replaced with the updated first static library to obtain the updated static library of class M;
[0144] The updated M-class static library is architecturally merged to obtain the updated target static library;
[0145] In the source code, the target static library is replaced with the updated target static library to obtain the updated source code.
[0146] In one or more embodiments, the report generation module 105 obtains the second identifier mapping table corresponding to the updated source program, compares and analyzes the first identifier mapping table and the second identifier mapping table, and generates an evaluation report for the second file to perform the following steps:
[0147] The updated source program is compiled and linked to generate a second identifier mapping table;
[0148] Get the list of first identifiers in the first identifier mapping table, and get the list of second identifiers in the second identifier mapping table;
[0149] Compare and analyze the first and second identifier lists to count the number of changed identifiers;
[0150] Based on the number of change flags, generate an evaluation report for the second document.
[0151] In one or more embodiments, the report generation module 105 compiles and links the updated source program to generate a second identifier mapping table, and is also used to perform the following steps:
[0152] Obtain the first identifier from the updated source code file;
[0153] If a second identifier matching the first identifier is found in the static library included in the updated source program, then a correspondence is established between the addresses of the first identifier and the binary files to which the second identifier belongs, and the link address of the first identifier is obtained.
[0154] Generate a second identifier mapping table based on the first identifier and its link address.
[0155] In one or more embodiments, the device further includes:
[0156] The file generation module 106 is used to determine that the updated source program was successfully linked during the linking process if the number of new identifiers and removed identifiers in the evaluation report of the second file is zero, and to generate an executable file based on the updated source program; the executable file can be used to start the application indicated by the updated source program.
[0157] Error determination module 107 is used to determine that there is a linking error in the updated source program during the linking process if the number of newly added flags and removed flags in the evaluation report of the second file is not zero.
[0158] According to one embodiment of this application, the foregoing Figure 3The data processing method shown can be related to the steps involved by Figure 7 The data processing apparatus 1 shown is executed by each module. For example, Figure 3 The step S101 shown can be performed by Figure 7 The link detection module 101 shown is used to perform this. Figure 3 The step S102 shown can be performed by Figure 7 The conflict detection module 102 shown is used to perform the above.
[0159] According to one embodiment of this application, Figure 7 The modules in the data processing device 1 shown can be individually or all combined into one or more modules, or some of the modules can be further divided into at least two functionally smaller units to achieve the same operation without affecting the technical effects of the embodiments of this application. The above modules are based on logical function division. In practical applications, the function of one module can also be implemented by at least two units, or the function of at least two modules can be implemented by one module.
[0160] In this embodiment, linking errors caused by identical names of identifiers in the static library are resolved by automatically renaming conflict identifiers in the static library. This improves the efficiency of conflict identifier processing while ensuring that the stability and performance of the program are not affected.
[0161] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 8 As shown, the computer device 1000 can be a terminal device, for example, the one described above. Figure 1 The terminal device 10a in the corresponding embodiment can also be a server, for example, as described above. Figure 1 The server 10d in the corresponding embodiment will not be limited here. For ease of understanding, this application takes a computer device as an example as the terminal device. The computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005. In addition, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. The memory 1005 may also optionally be at least one storage device located remotely from the aforementioned processor 1001. Figure 8 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.
[0162] The network interface 1004 in the computer device 1000 can also provide network communication functions, and the optional user interface 1003 can also include a display screen and a keyboard. Figure 8 In the computer device 1000 shown, the network interface 1004 provides network communication functionality; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0163] If a linking error is detected in the source code during the linking process, conflict detection is performed on the identifiers in the source code.
[0164] If a flag conflict is detected in the source program, the conflict flag in the source program is retrieved.
[0165] Obtain the first identifier mapping table corresponding to the source program, and determine the first file to which the conflicting identifier belongs in the first identifier mapping table;
[0166] The conflict markers in the first file are renamed to obtain the second file. The first file in the source program is replaced with the second file to obtain the updated source program.
[0167] Obtain the second identifier mapping table corresponding to the updated source program, compare and analyze the first identifier mapping table and the second identifier mapping table, and generate an evaluation report for the second file.
[0168] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figure 3 The description of the data processing method in any of the embodiments can also be performed as described above. Figure 7 The description of the data processing device 1 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated here.
[0169] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned data processing device 1. The computer program includes computer instructions, and when the processor executes the computer instructions, it can execute the aforementioned... Figure 3The data processing method described in the embodiments will not be repeated here. Similarly, the beneficial effects of using the same method will not be repeated here either. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed and executed on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network. Multiple computer devices distributed across multiple locations and interconnected via a communication network can constitute a blockchain system.
[0170] Furthermore, it should be noted that this application also provides a computer program product, which may include a computer program that can be stored in a computer-readable storage medium. The processor of a computer device reads the computer program from the computer-readable storage medium, and the processor can execute the computer program, causing the computer device to perform the aforementioned... Figure 3 The data processing methods described in the embodiments are therefore not repeated here. Similarly, the beneficial effects of using the same method will not be repeated here either. For technical details not disclosed in the computer program products or computer program embodiments related to this application, please refer to the description of the method embodiments of this application.
[0171] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different media content, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0172] Those skilled in the art will 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 implementations should not be considered beyond the scope of this application.
[0173] The methods and related apparatuses provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.
[0174] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0175] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A data processing method, characterized in that, include: If a linking error is detected in the source program during the linking process, a conflict detection is performed on the identifiers in the source program. If a flag conflict is detected in the source program, the conflict flag in the source program is obtained; Obtain the first identifier mapping table corresponding to the source program, and determine the first file to which the conflict identifier belongs in the first identifier mapping table; The conflict flag in the first file is renamed to obtain the second file. The first file in the source program is replaced with the second file to obtain the updated source program. Obtain the second identifier mapping table corresponding to the updated source program, compare and analyze the first identifier mapping table and the second identifier mapping table, and generate an evaluation report for the second file.
2. The method according to claim 1, characterized in that, The first identifier mapping table includes a first file list and a first identifier list; The step of determining the first file to which the conflicting identifier belongs in the first identifier mapping table includes: In the first identifier list, determine the file identifier of the conflict identifier, and based on the file identifier, determine the target static library to which the conflict identifier belongs in the first file list; In the target static library to which the conflict identifier belongs, determine the first file to which the conflict identifier belongs.
3. The method according to claim 1, characterized in that, The step of determining the first file to which the conflict identifier belongs in the target static library to which the conflict identifier belongs includes: Obtain the target static library to which the conflict identifier belongs, and perform architectural splitting on the target static library to obtain M types of sub-static libraries, where M is a positive integer; In the M-class sub-static libraries, determine the first sub-static library to which the conflict identifier belongs; The first static library is decompressed to obtain N binary files. Among the N binary files, the first file to which the conflict flag belongs is determined; N is a positive integer.
4. The method according to claim 3, characterized in that, The step of replacing the first file in the source program with the second file to obtain the updated source program includes: In the N binary files, the first file is replaced with the second file to obtain the updated N binary files. The updated N binary files are then encapsulated to obtain the updated first static library. In the M-type static library, the first static library is replaced with the updated first static library to obtain the updated M-type static library; The updated M-class static libraries are architecturally merged to obtain the updated target static library; In the source program, the target static library is replaced with the updated target static library to obtain the updated source program.
5. The method according to claim 1, characterized in that, The process of obtaining the second identifier mapping table corresponding to the updated source program, comparing and analyzing the first identifier mapping table and the second identifier mapping table, and generating an evaluation report for the second file includes: The updated source program is compiled and linked to generate a second identifier mapping table; Obtain the first identifier list from the first identifier mapping table, and obtain the second identifier list from the second identifier mapping table; Compare and analyze the first list of identifiers and the second list of identifiers, and count the number of changed identifiers; An evaluation report for the second file is generated based on the number of change flags.
6. The method according to claim 5, characterized in that, The step of compiling and linking the updated source program to generate a second identifier mapping table includes: Obtain the first identifier from the code file of the updated source program; If a second identifier matching the first identifier is found in the static library contained in the updated source program, then a correspondence is established between the addresses of the first identifier and the binary files to which the second identifier belongs, and the link address of the first identifier is obtained. A second identifier mapping table is generated based on the first identifier and its link address.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: If the number of newly added and removed markers in the evaluation report of the second file is zero, it is determined that the updated source program was successfully linked during the linking process, and an executable file is generated based on the updated source program; the executable file can be used to launch the application indicated by the updated source program. If the number of newly added and removed identifiers in the evaluation report of the second file is not zero, then it is determined that there is a linking error in the updated source program during the linking process.
8. A data processing apparatus, characterized in that, include: The link detection module is used to perform conflict detection on the identifiers in the source program if a linking error is detected during the linking process. The conflict detection module is used to obtain the conflict flags in the source program if a flag conflict is detected in the source program. The mapping table acquisition module is used to acquire the first identifier mapping table corresponding to the source program, and determine the first file to which the conflict identifier belongs in the first identifier mapping table; The renaming processing module is used to rename the conflict flag in the first file to obtain a second file, and replace the first file in the source program with the second file to obtain an updated source program. The report generation module is used to obtain the second identifier mapping table corresponding to the updated source program, compare and analyze the first identifier mapping table and the second identifier mapping table, and generate an evaluation report for the second file.
9. A computer device, characterized in that, Including memory and processor; The memory is connected to the processor, the memory is used to store computer programs, and the processor is used to invoke the computer programs so that the computer device performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1 to 7.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.