Data processing method and device, equipment, storage medium and product

By generating the dynamic libraries corresponding to the static library and writing them to the application archive file, the problem of generating static library source code debugging files is solved, the source code embedding and debugging file generation of static libraries is realized, and effective debugging operations are supported.

CN119807007APending Publication Date: 2025-04-11TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311300882.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-08
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

It is difficult for the existing technology to generate debug files corresponding to the source code of the static library, resulting in the inability to effectively debug when an exception is detected during the use of the static library.

Method used

By obtaining the source code of the static library and the application archive file, generating the dynamic library corresponding to the static library, and writing the dynamic library into the application archive file. Finally, a specific code segment is used to replace the updated application archive file to obtain the debug file corresponding to the source code of the static library.

Benefits of technology

It implements embedding the source code of the static library into the library of the application archive file, thereby generating the debugging file corresponding to the source code of the static library, and supports effective debugging of the classes to be debugged in the static library.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807007A_ABST
    Figure CN119807007A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a data processing method and device, equipment, a storage medium and a product. The method comprises the steps that a source code of a static library and an application program archive file are obtained, the application program archive file comprises a first code segment, a dynamic library corresponding to the static library is generated based on the source code of the static library, and the dynamic library is stored in the dynamic library; and writing the dynamic library into the application program archive file to obtain an updated application program archive file, and replacing the first code segment in the updated application program archive file with the second code segment to obtain a debugging file corresponding to the source code of the static library. Therefore, by converting the static library into the dynamic library and writing the dynamic library into the application program archive file, the source code of the static library can be embedded into the library of the application program archive file, so that the debugging file corresponding to the source code of the static library is obtained. The embodiment of the invention can be applied to a cloud technology scene; for example, the application program is a cloud application, and the source code of the static library is stored in a cloud server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, a data processing apparatus, a computer device, a computer-readable storage medium, and a data processing product. Background Art

[0002] With the advancement of scientific and technological research, software development technology has developed rapidly. Products developed by software developers can be provided to demanders in the form of static libraries. After receiving the static library provided by the developer, the demander can obtain the corresponding software functions by accessing the static library. After accessing the static library, if the demander detects an abnormality during the use of the static library, the abnormality information can be returned to the developer through the application archive file. Research has found that since the source code of the static library is not embedded in the library of the application archive file, how to obtain the debug file corresponding to the source code of the static library has become a hot issue in current research. Summary of the invention

[0003] Embodiments of the present application provide a data processing method, apparatus, device, computer-readable storage medium, and product that can generate a debugging file corresponding to the source code of a static library.

[0004] On the one hand, an embodiment of the present application provides a data processing method, including:

[0005] Obtaining source code of a static library and an application archive file, wherein the static library includes a class to be debugged; the application archive file includes a first code segment, wherein the first code segment is used to return a first object, and the first object is an instance of the class to be debugged in the static library;

[0006] Based on the source code of the static library, a dynamic library corresponding to the static library is generated. The dynamic library includes a target class, which is obtained by performing macro renaming on the class to be debugged.

[0007] Writing the dynamic library into the application archive file to obtain an updated application archive file;

[0008] The second code segment is used to replace the first code segment in the updated application archive file to obtain a debugging file corresponding to the source code of the static library. The second code segment is used to return a second object, which is an instance of the target class. The debugging file is used to debug the class to be debugged.

[0009] On the one hand, an embodiment of the present application provides a data processing device, the data processing device comprising:

[0010] An acquisition unit, used for acquiring source code of a static library and an application archive file, wherein the static library includes a class to be debugged; the application archive file includes a first code segment, wherein the first code segment is used for returning a first object, wherein the first object is an instance of the class to be debugged in the static library;

[0011] A processing unit is used to generate a dynamic library corresponding to the static library based on the source code of the static library, wherein the dynamic library includes a target class, and the target class is obtained by performing macro renaming processing on the class to be debugged;

[0012] and for writing the dynamic library into the application archive file to obtain an updated application archive file;

[0013] And it is used to replace the first code segment in the updated application archive file with the second code segment to obtain a debugging file corresponding to the source code of the static library, the second code segment is used to return a second object, the second object is an instance of the target class, and the debugging file is used to debug the class to be debugged.

[0014] In one embodiment, the application archive file further includes a third code segment and N libraries, the third code segment is used to access the static library, and N is a positive integer; the processing unit is used to write the dynamic library into the application archive file to obtain an updated application archive file, specifically used to:

[0015] Decompress the application archive file to obtain the third code segment and N libraries;

[0016] The third code segment is replaced by the fourth code segment, where the fourth code segment is used to access the dynamic library;

[0017] Re-sign N libraries to obtain updated signature information of N libraries;

[0018] Based on the fourth code segment and the updated signature information of the N libraries, an updated application archive file is generated.

[0019] In one implementation, the processing unit is used to perform re-signature processing on N libraries to obtain updated signature information of the N libraries, specifically for:

[0020] Get the signature information of the debugging device, which is used to debug the class to be debugged;

[0021] The signature information of the N libraries is updated by using the signature information of the debugging device to obtain the updated signature information of the N libraries.

[0022] In one implementation, the third code segment includes an access path to the static library; and the process in which the processing unit replaces the third code segment with the fourth code segment includes:

[0023] Replace the static library access path with the dynamic library access path.

[0024] In one implementation, in the source code of the static library, the identifier of the class to be debugged is the first identifier; the processing unit is used to generate a dynamic library corresponding to the static library based on the source code of the static library, specifically for:

[0025] Replace the identifier of the class to be debugged in the source code of the static library with the second identifier to obtain the updated source code of the static library;

[0026] Package the updated source code of the static library to obtain the framework file corresponding to the static library;

[0027] Get the dynamic library to be filled;

[0028] Add the framework file to the dynamic library to be filled to obtain the dynamic library corresponding to the static library.

[0029] In one implementation, the processing unit is used to obtain a dynamic library to be populated, specifically to:

[0030] Create a system project, which is used to provide a debugging environment for the dynamic library in the system project;

[0031] Create a dynamic library in the system engineering to obtain the dynamic library to be filled.

[0032] In one embodiment, the first code segment includes an initialization method of a class to be debugged and a first acquisition instruction, the first acquisition instruction is used to obtain a return result of the class to be debugged; the second code segment includes an initialization method of a target class and a second acquisition instruction, the second acquisition instruction is used to obtain a return result of the target class;

[0033] The processing unit is used to replace the first code segment in the updated application archive file with the second code segment to obtain a debugging file corresponding to the source code of the static library, specifically for:

[0034] Replace the initialization method of the class to be debugged in the updated application archive file with the initialization method of the target class; and,

[0035] Replace the first acquisition instruction in the updated application archive file with the second acquisition instruction.

[0036] In one implementation, the application archive file is generated by sender exception information of the application archive file, and the exception information is obtained after accessing the static library; the processing unit is further used for:

[0037] Use debugging tools to locate problems associated with exception information in the target class;

[0038] Optimize the problems associated with abnormal information in the target class to obtain the optimization results of the target class;

[0039] According to the optimization method of the target class, the class to be debugged is optimized to obtain the optimized source code of the static library.

[0040] In one implementation, the application archive file further includes class indication information, where the class indication information is used to indicate a class to be debugged in a static library; the static library includes M classes, where M is a positive integer; and the processing unit is further used to:

[0041] Based on the class indication information, a class to be debugged among the M classes is determined.

[0042] Accordingly, the present application provides a computer device, the computer device comprising:

[0043] a memory, wherein a computer program is stored in the memory;

[0044] The processor is used to load a computer program to implement the above data processing method.

[0045] Accordingly, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded by a processor and executing the above-mentioned data processing method.

[0046] Accordingly, 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 the computer device performs the above-mentioned data processing method.

[0047] In the embodiment of the present application, the source code of the static library and the application archive file are obtained, the application archive file includes a first code segment, based on the source code of the static library, a dynamic library corresponding to the static library is generated, the dynamic library is written into the application archive file, an updated application archive file is obtained, and the first code segment in the updated application archive file is replaced with the second code segment to obtain a debug file corresponding to the source code of the static library. It can be seen that by converting the static library into a dynamic library and writing the dynamic library into the application archive file, the source code of the static library can be embedded into the library of the application archive file, thereby obtaining a debug file corresponding to the source code of the static library. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 A data processing scenario diagram provided for an embodiment of the present application;

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

[0051] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application;

[0052] Figure 4a A schematic diagram of an application archive file provided in an embodiment of the present application;

[0053] Figure 4b A schematic diagram of a dynamic library creation page provided in an embodiment of the present application;

[0054] Figure 4c A schematic diagram of adding a dynamic library to an injection tool provided in an embodiment of the present application;

[0055] Figure 4d A schematic diagram of converting a static library into a dynamic library provided in an embodiment of the present application;

[0056] Figure 4e An architectural diagram of a debugging file provided in an embodiment of the present application;

[0057] Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0058] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0060] This application involves technologies related to debugging. The following is a brief introduction to the related technologies involved:

[0061] Application archive file: An application archive file is a file obtained by packaging the executable file and resource files of an application. The application archive files in different operating systems are different. Apple Application Archive (IPA) is an application archive file for the Apple operating system (iPhone Operating System, iOS) and the Apple tablet operating system (iPad Operating System, iPadOS). Generally, IPA files are binary files encrypted and protected using digital copyright protection (FairPlayDRM) technology. The encryption protection can be removed by smashing the IPA shell to make some modifications to the IPA file. Each IPA file is a packaged file of the executable file of the Reduced Instruction Set Computer (Advanced RISC Machine, ARM) architecture and the resource files of the application. The IPA file is installed on Apple products (such as iPhone, iPod Touch, iPad, and Mac using the Apple Silicon platform). IPA files can be decompressed by changing the suffix name (such as changing the suffix name to zip) and viewing its contents.

[0062] Debug code: refers to debugging the code through debugging functions such as checkpoints, logs, and viewing status.

[0063] Library: A way to share program code. Libraries are generally divided into static libraries and dynamic libraries. Static libraries are completely copied to the executable file when linked (accessed). When static libraries are used multiple times, there will be multiple redundant copies. Dynamic libraries are not copied to the executable file when linked (accessed). When the program is running, they are dynamically loaded into the memory by the system for the program to call. The system only needs to load it once, and multiple programs can share the dynamic library, which saves more memory than static libraries.

[0064] Hook technology: refers to a technology that changes the running process of a program. Through hook, the program can execute preset code.

[0065] Source code (also called source program): refers to a series of human-readable computer language instructions. In modern programming languages, source code can appear in the form of books or tapes, but the most common format is a text file. The purpose of this typical format is to compile a computer program. The ultimate goal of computer source code is to translate human-readable text into binary instructions that can be executed by a computer. This process is called compilation and is completed by a compiler.

[0066] Xcode: It is an integrated development environment (IDE) for Apple operating systems. Xcode is used to develop software in Apple operating systems (such as macOS, iOS, iPadOS, watchOS, tvOS, and visionOS).

[0067] Shell: It is both a command language and a programming language. A Shell script written in Shell is a text file consisting of a series of commands and control structures.

[0068] Based on the above debugging-related technologies, an embodiment of the present application provides a data processing solution that can generate a debugging file corresponding to the source code of a static library. Figure 1 A data processing scenario diagram provided in an embodiment of the present application, such as Figure 1 As shown, the data processing scenario provided by the present application includes a computer device 101 and a computer device 102, and the data processing scheme provided by the present application can be executed by the computer device 102. Among them, the computer device can be a terminal device or a server, and the terminal device can include but is not limited to: smart phones (such as Android phones, iOS phones, etc.), tablet computers, portable personal computers, mobile Internet devices (Mobile Internet Devices, referred to as MID), intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, wearable devices, etc., and the present application embodiment does not limit this; the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and basic cloud computing services such as big data and artificial intelligence platforms, and the present application embodiment does not limit this.

[0069] It should be noted that Figure 1 The number of computer devices is only used as an example and does not constitute an actual limitation of this application; for example, Figure 1 The computer device 103 may also be included. In addition, the computer device 101 may also access the static library from the computer device 102 (ie, without the need for cloud services), and the computer device 101 and the computer device 102 may be connected via a wired or wireless method, which is not limited in this application.

[0070] The general process of the data processing solution provided by this application is as follows:

[0071] (1) Computer device 102 obtains the application archive file provided by computer device 101, and the source code of the static library to which the application archive file is connected; wherein the static library includes a class to be debugged, and the application archive file includes a first code segment, the first code segment is used to return a first object, and the first object is an instance of the class to be debugged in the static library. In one embodiment, the application archive file also includes class indication information, and the class indication information is used to indicate the class to be debugged in the static library. After obtaining the application archive file provided by computer device 101, computer device 102 can determine the class that needs to be debugged in the static library (i.e., the class to be debugged) through the class indication information.

[0072] (2) The computer device 102 generates a dynamic library corresponding to the static library based on the source code of the static library; wherein the dynamic library includes a target class, which is obtained by macro renaming the class to be debugged. That is to say, the method (function) of the target class in the dynamic library is the same as that of the class to be debugged in the static library, except that the class identifier (name) is different. In one embodiment, the identifier of the class to be debugged is a first identifier. On the one hand, the computer device 102 replaces the identifier of the class to be debugged with a second identifier, obtains the updated source code of the static library, and packages the updated source code of the static library to obtain the framework file corresponding to the static library. On the other hand, the computer device 102 obtains the dynamic library to be filled. After obtaining the framework file corresponding to the static library and the dynamic library to be filled, the computer device 102 adds the framework file to the dynamic library to be filled to obtain the dynamic library corresponding to the static library.

[0073] (3) The computer device 102 writes the dynamic library into the application archive file to obtain an updated application archive file. In one embodiment, the application archive file also includes a third code segment and N libraries, and the third code segment is used to access the static library, where N is a positive integer. In the process of writing the dynamic library into the application archive file, the computer device 102 replaces the third code segment in the application archive file with the fourth code segment, and the fourth code segment is used to access the dynamic library; on the other hand, the signature information of the computer device 102 is used to re-sign the N libraries in the application archive file to obtain the updated signature information of the N libraries. The updated application archive file includes the fourth code segment and can be executed by the computer device 102.

[0074] (4) The computer device 102 uses the second code segment to replace the first code segment in the updated application archive file to obtain the debugging file corresponding to the source code of the static library; wherein the second code segment is used to return the second object, the second object is an instance of the target class, and the debugging file is used to debug the class to be debugged. In one embodiment, the first code segment includes an initialization method of the class to be debugged and a first acquisition instruction, the first acquisition instruction is used to obtain the return result of the class to be debugged; the second code segment includes an initialization method of the target class and a second acquisition instruction, the second acquisition instruction is used to obtain the return result of the target class. On the one hand, the computer device 102 replaces the initialization method of the class to be debugged in the updated application archive file with the initialization method of the target class; on the other hand, it replaces the first acquisition instruction in the updated application archive file with the second acquisition instruction to obtain the debugging file corresponding to the source code of the static library.

[0075] In the embodiment of the present application, the source code of the static library and the application archive file are obtained, the application archive file includes a first code segment, based on the source code of the static library, a dynamic library corresponding to the static library is generated, the dynamic library is written into the application archive file, an updated application archive file is obtained, and the first code segment in the updated application archive file is replaced with the second code segment to obtain a debug file corresponding to the source code of the static library. It can be seen that by converting the static library into a dynamic library and writing the dynamic library into the application archive file, the source code of the static library can be embedded into the library of the application archive file, thereby obtaining a debug file corresponding to the source code of the static library.

[0076] Based on the above data processing scheme, the embodiment of the present application proposes a more detailed data processing method. The data processing method proposed in the embodiment of the present application will be described in detail below in conjunction with the accompanying drawings.

[0077] See also Figure 2 , Figure 2 A flowchart of a data processing method provided in an embodiment of the present application, the data processing method can be executed by a computer device; for example, Figure 1 The computer device 102 shown in FIG. Figure 2 As shown, the data processing method may include the following steps S201-S204:

[0078] S201. Obtain source code of a static library and an application archive file.

[0079] The static library includes M classes, the M classes include the class to be debugged, and M is a positive integer. The application archive file includes a first code segment, the first code segment is used to return a first object, and the first object is an instance of the class to be debugged in the static library. In one embodiment, the application archive file includes parameters associated with the class to be debugged, and the first object is generated after the parameters associated with the class to be debugged are passed into the class to be debugged.

[0080] In another embodiment, the access party of the static library (i.e., the demander) accesses the code of the application to the static library. During the process of data interaction with the static library, when the access party of the static library detects an exception (such as data exception, receiving an exception prompt message, etc.), an application archive file is generated and sent to the computer device. The application archive files in different operating systems are different. In one implementation, the operating system used by the access party of the static library is the Apple operating system, and the application archive file is an Apple application archive file (IPhone Application Archive, IPA). The following uses the application archive file as an example to explain the data processing method provided in this application.

[0081] In one embodiment, the application archive file also includes class indication information, and the class indication information is used to indicate the class to be debugged in the static library. After obtaining the application archive file provided by the access party (i.e., the demand party) of the static library, the computer device can determine the class to be debugged (i.e., the class to be debugged) in the static library through the class indication information.

[0082] S202: Generate a dynamic library corresponding to the static library based on the source code of the static library.

[0083] The dynamic library includes the target class, which is obtained by macro renaming the class to be debugged. In other words, the method (function) of the target class in the dynamic library is the same as that of the class to be debugged in the static library, but the difference is that the class identifier (name) is different.

[0084] In one embodiment, the identification of the class to be debugged is a first identification. On the one hand, the computer device replaces the identification of the class to be debugged with a second identification to obtain the source code after the static library is updated. In one embodiment, the computer device performs macro renaming processing on the class to be debugged through a preprocessing instruction (#define) to obtain the source code after the static library is updated. Further, the computer device packages the source code after the static library is updated (such as encapsulating the source code of the static library into one or more framework files) to obtain the framework file corresponding to the static library. On the other hand, the computer device obtains the dynamic library to be filled. In one embodiment, the computer device creates a system engineering, which is used to provide a debugging environment for the dynamic library in the system engineering. The system engineering can be an independent system engineering or a subsystem engineering of another system engineering, and the present application does not limit this. After the system engineering is created, the computer device creates a dynamic library in the system engineering to obtain a dynamic library to be filled.

[0085] After obtaining the framework file corresponding to the static library and the dynamic library to be filled, the computer device adds the framework file to the dynamic library to be filled (such as filling the framework file corresponding to the static library into the dynamic library to be filled, or adding the reading path of the framework file corresponding to the static library to the dynamic library), and obtains the dynamic library corresponding to the static library, and the identifier of the target class in the dynamic library is the second identifier.

[0086] S203: Write the dynamic library into the application archive file to obtain an updated application archive file.

[0087] The computer device writing the dynamic library into the application archive file can be understood as: connecting the code of the application in the application archive file to the dynamic library (without copying the source code of the dynamic library to the code of the application), and ensuring that the application code can be run in the debugging device (such as a computer device, or other devices except the computer device) after connecting to the dynamic library.

[0088] In one embodiment, the application archive file also includes a third code segment and N libraries, and the third code segment is used to access the code of the application in the application archive file to the static library, where N is a positive integer. The computer device decompresses the application archive file to obtain the third code segment and N libraries. On the one hand, the computer device replaces the third code segment with a fourth code segment, and the fourth code segment is used to access the code of the application in the application archive file to the dynamic library. In one embodiment, the third code segment carries the access path of the static library, and the computer device replaces the access path of the static library in the third code segment with the access path of the dynamic library to obtain the fourth code segment. On the other hand, the computer device re-signs the N libraries to obtain the updated signature information of the N libraries to ensure that the code of the application can be run (debugged) in the debugging device after accessing the dynamic library. In one embodiment, the computer device obtains the signature information of the debugging device, and the debugging device is used to debug the class to be debugged in the static library. Then the computer device uses the signature information of the debugging device to update (replace) the signature information of the N libraries to obtain the updated signature information of the N libraries.

[0089] After obtaining the updated signature information of the fourth code segment and the N libraries, the computer device packages the updated signature information of the fourth code segment and the N libraries to obtain an updated application archive file.

[0090] In another embodiment, the computer device may write the dynamic library into the application archive file through an injection tool or an injection framework (such as InjectionFramework) to obtain an updated application archive file.

[0091] S204: Use the second code segment to replace the first code segment in the updated application archive file to obtain a debugging file corresponding to the source code of the static library.

[0092] The second code segment is used to return a second object, the second object is an instance of the target class, and the debugging file is used to debug the class to be debugged. In one embodiment, the application archive file includes parameters associated with the target class, and the second object is generated after the parameters associated with the target class are passed into the class to be debugged.

[0093] In one embodiment, the first code segment includes an initialization method of a class to be debugged and a first acquisition instruction, and the first acquisition instruction is used to obtain the return result of the class to be debugged. The second code segment includes an initialization method of a target class and a second acquisition instruction, and the second acquisition instruction is used to obtain the return result of the target class. On the one hand, the computer device replaces the initialization method of the class to be debugged in the updated application archive file with the initialization method of the target class. On the other hand, the computer device replaces the first acquisition instruction in the updated application archive file with the second acquisition instruction to obtain the debugging file corresponding to the source code of the static library.

[0094] Furthermore, after obtaining the debugging file corresponding to the source code of the static library, the computer device can locate the problem associated with the abnormal information in the target class through debugging tools (such as checkpoint setting tools, status viewing tools, etc.). After determining the problem associated with the abnormal information in the target class, the computer device optimizes the problem associated with the abnormal information in the target class to obtain the optimization result of the target class, and optimizes the class to be debugged according to the optimization method of the target class to obtain the optimized source code of the static library.

[0095] It can be understood that since the target class in the dynamic library is obtained based on the class to be debugged in the static library (the identifiers of the target class and the class to be debugged are different), after obtaining the debugging file corresponding to the source code of the static library, the target class in the dynamic library can be debugged to achieve the purpose of debugging the class to be debugged in the static library (that is, using the target class as a medium to debug the class to be debugged in the static library); and the optimization method of the class to be debugged in the static library is determined by the optimization method of the target class.

[0096] In an embodiment of the present application, the source code of a static library and an application archive file are obtained, the application archive file includes a first code segment, based on the source code of the static library, a dynamic library corresponding to the static library is generated, the dynamic library is written into the application archive file, an updated application archive file is obtained, and the first code segment in the updated application archive file is replaced with a second code segment to obtain a debug file corresponding to the source code of the static library. It can be seen that by updating the signature information of the library in the application archive file, it can be ensured that the debug file runs smoothly in the debugging device. By converting the static library into a dynamic library and writing the dynamic library into the application archive file, the source code of the static library can be embedded into the library of the application archive file, thereby obtaining a debug file corresponding to the source code of the static library.

[0097] See also Figure 3 , Figure 3 A flowchart of another data processing method provided in an embodiment of the present application, the data processing method can be executed by a computer device; for example, Figure 1The computer device 102 shown in FIG. Figure 3 As shown, the data processing method may include the following steps S301-S306:

[0098] S301. Obtain source code of a static library and an application archive file.

[0099] In one implementation, the static library may be stored in a cloud server, and the application in the application archive file may be a cloud application, which obtains corresponding software functions or data by accessing the static library in the cloud server.

[0100] It is understandable that the application code of the application archive file can be the code of any application; for example, audio processing-related applications, video processing-related applications, game applications, social applications, etc., and this application does not impose any restrictions on this.

[0101] Figure 4a A schematic diagram of an application archive file provided in an embodiment of the present application. Figure 4a As shown, the application archive file includes the code of the application, the first code segment and the third code segment. The code of the application is accessed to the static library through the third code segment, and the static library includes the class to be debugged. The first code segment is used to return the first object, which is an instance generated by the class to be debugged.

[0102] S302: Generate a dynamic library corresponding to the static library based on the source code of the static library.

[0103] In one embodiment, on the one hand, the computer device first performs differential processing on the identifier of the class to be debugged in the static library, and the identifier of the class to be debugged after the differential processing can be distinguished from the identifier of the class to be debugged (not differentiated) in the application archive file. The computer device (through the preprocessing instruction) performs macro renaming processing on the class to be debugged in the static library to obtain the source code after the static library is updated. In one embodiment, in the source code of the static library, the identifier of the class to be debugged is the first identifier, and the computer device replaces the identifier of the class to be debugged in the source code of the static library with the second identifier to obtain the source code after the static library is updated. After obtaining the source code after the static library is updated, the computer device packages the source code after the static library is updated to obtain the framework file corresponding to the static library. On the other hand, the computer device creates a system engineering, and creates a dynamic library in the system engineering to obtain a dynamic library to be filled; wherein, the system engineering is used to provide a debugging environment for the dynamic library in the system engineering.

[0104] After obtaining the framework file corresponding to the static library and the dynamic library to be filled, the computer device adds the framework file to the dynamic library to be filled (such as filling the framework file corresponding to the static library into the dynamic library to be filled, or adding the reading path of the framework file corresponding to the static library to the dynamic library), and obtains the dynamic library corresponding to the static library, and the identifier of the target class in the dynamic library is the second identifier.

[0105] In one embodiment, the application archive file is an IPA file. The computer device creates a new iOS project (ie, a system project) through Xcode, and creates a new dynamic library through Xcode. Figure 4b A schematic diagram of a dynamic library creation page provided in an embodiment of the present application. Figure 4b As shown, the dynamic library creation page includes a project bar 401, a configuration bar 402 and a configuration information display area 403; wherein, the project bar 401 can be used to display the configured system project (Project), tool (or framework), when a system project is created, the identification of the system project (as shown in 4011) will be displayed in the project bar, and the system project can be configured by triggering the identification of the system project; similarly, when a tool (or framework) is created, the identification of the tool (or framework) (as shown in 4012) will be displayed in the project bar, and the tool (or framework) can be configured by triggering the identification of the tool (or framework). In one embodiment, an iOS project includes an injection tool (or injection framework), and a computer device can add a dynamic library corresponding to a static library to the injection tool (or injection framework), and then write the dynamic library into an IPA file through the injection tool (or injection framework). The configuration bar 402 includes multiple configuration options, and different configuration options are used to configure the system project or library accordingly. Specifically, configuration options may include but are not limited to: General Settings, Signing & Capabilities, Resource Tags, Info, Build Settings, and Build Phases; General Settings is used to set application identification, version, deployment device, and other information; Signing & Capabilities is used to configure the project's signature certificate and deployment target; Resource Tags is used to add tags and related resources to resources in the project; Info Settings is used to add network settings and access permissions to the project; Build Settings is used to configure various parameters and options of the compiler, such as compiler path, compilation flags, architecture, optimization level, etc.; Build Phases is used to describe the various stages required to compile an application. Configuration information display area 403 is used to display corresponding content when a configuration option in configuration bar 402 is selected.

[0106] Figure 4cA schematic diagram of adding a dynamic library to an injection tool is provided in an embodiment of the present application. Figure 4c As shown, the display area 403 displays the framework file (identification) and description file (identification) in the dynamic library; the suffix of the framework file is .framework, and the suffix of the description file is .tbd. Each framework file is associated with a framework separation option (DoNot Embed) or a signature certificate binding option (Embed&Sign); the framework separation option is used to separate the application from the framework or library; the signature certificate binding option is used to bind the application to a signature certificate.

[0107] Table 1 is a code example for performing macro renaming on a class to be debugged in a static library provided in an embodiment of the present application:

[0108] Table 1

[0109]

[0110] Among them, "#define TUIRoomEngine TUIRoomEngineRefactor" is a preprocessing command, which is used to replace "TUIRoomEngine" in the static library with "TUIRoomEngineRefactor". "TUIENGINE_EXPORT@interface TUIRoomEngine:NSObject" is an example of the first code segment, which is used to define the interface of "TUIRoomEngine" (the class to be debugged) and return the first object. It should be noted that the codes in Table 1 (such as class identifiers) are only used for examples and do not constitute actual limitations of this application.

[0111] Furthermore, after renaming the macro of the class to be debugged in the static library, the computer device can package the static library through Xcode or a packaging command to obtain the framework file corresponding to the static library (including the file with the suffix .framework). The framework file corresponding to the static library is stored in a specified location (such as a folder for storing the framework file of the dynamic library).

[0112] Figure 4d A schematic diagram of converting a static library into a dynamic library is provided in an embodiment of the present application. Figure 4dAs shown, the static library includes a class to be debugged and a class with a class name of identifier 3, the class name of the class to be debugged is identifier 1, and the class method is method 1. After the class to be debugged is macro-renamed, the class name of the class to be debugged becomes identifier 2 (identifier 1 contained in the static library is replaced by identifier 2), and the class method of the class to be debugged remains unchanged. Then the static library is packaged to obtain the framework file of the static library, and the framework file of the static library is added to the dynamic library to be filled to obtain the dynamic library. The dynamic library includes a target class, the class name of the target class is identifier 2, and the class method is method 1.

[0113] S303: Replace the third code segment in the application archive file with the fourth code segment.

[0114] In one embodiment, the computer device decompresses the application archive file to obtain a third code segment, which includes an access path to a static library. The computer device replaces the access path to the static library with an access path to the dynamic library (the replacement result is the fourth code segment).

[0115] S304: Re-sign the N libraries in the application archive file to obtain updated signature information of the N libraries.

[0116] In one embodiment, the N libraries in the application archive file are obtained by the computer device decompressing the application archive file. The computer device obtains the signature information of the debugging device, and uses the signature information of the debugging device to update the signature information of the N libraries to obtain the updated signature information of the N libraries; wherein the debugging device (which may be a computer device or other device other than a computer device) is used to debug the class to be debugged. Further, the computer device generates an updated application archive file based on the fourth code segment and the updated signature information of the N libraries.

[0117] In one embodiment, the application archive file is an IPA file. The computer device can write the dynamic library into the IPA file through a Shell script. Table 2 is an example of a Shell script key code provided in an embodiment of the present application:

[0118] Table 2

[0119]

[0120] Among them, the first code "cd $app_path...InjectionFramework" means writing the dynamic library into the IPA file through the injection tool / framework (InjectionFramework); the second code "$App Frameworks Path...*.framework" is used to re-sign the library in the IPA file; the third code "TEMP APP PATH=$(set--"$TEMP_PATH / Payload / "*.app;echo"$1")" is used to obtain the path of the application decompressed in the IPA.

[0121] S305: Use the second code segment to replace the first code segment in the updated application archive file to obtain a debugging file corresponding to the source code of the static library.

[0122] The second code segment is used to return a second object, the second object is an instance of the target class, and the debugging file is used to debug the class to be debugged. In one embodiment, the application archive file includes parameters associated with the target class, and the second object is generated after the parameters associated with the target class are passed into the class to be debugged.

[0123] In one embodiment, the first code segment includes an initialization method of a class to be debugged and a first acquisition instruction, and the first acquisition instruction is used to obtain the return result of the class to be debugged. The second code segment includes an initialization method of a target class and a second acquisition instruction, and the second acquisition instruction is used to obtain the return result of the target class. On the one hand, the computer device replaces the initialization method of the class to be debugged in the updated application archive file with the initialization method of the target class. On the other hand, the computer device replaces the first acquisition instruction in the updated application archive file with the second acquisition instruction to obtain the debugging file corresponding to the source code of the static library.

[0124] In one embodiment, the computer device can use hook technology to enable the updated application archive file to be accessed into the dynamic library at runtime. In one embodiment, the application archive file is an IPA file. Table 3 is an implementation code example of a hook technology provided in an embodiment of the present application.

[0125] Table 3

[0126]

[0127] The code in Table 3 is used to replace the initialization method of "TUIRoomEngine" with the initialization method of "injection_TUIRoomEngine_init", and return the object of "TUIRoomEngineRefactor" (ie, the second object) through "injection_TUIRoomEngine_init".

[0128] Figure 4e This is a diagram of the architecture of a debugging file provided in an embodiment of the present application. Figure 4e As shown, the debugging file includes the code of the application, the second code segment and the fourth code segment. The code of the application is accessed to the dynamic library through the fourth code segment, and the static library includes the target class (obtained based on the class to be debugged in the static library). The second code segment is used to return the second object, which is an instance generated by the target class.

[0129] S306: Optimize the class to be debugged in the static library based on the debugging file.

[0130] In one embodiment, the computer device locates the problem associated with the exception information in the target class through a debugging tool (such as a checkpoint setting tool, a status viewing tool, etc.). That is, after the code of the application in the application archive file is connected to the dynamic library, the dynamic library can be debugged directly, and the existing problem can be determined more conveniently and quickly. After determining the problem associated with the exception information in the target class, the computer device optimizes the problem associated with the exception information in the target class to obtain the optimization result of the target class. Figure 4d Since the class method of the class to be debugged in the static library is the same as the class method of the target class in the dynamic library, the computer device can optimize the class to be debugged according to the optimization method of the target class to obtain the optimized source code of the static library.

[0131] Optionally, the data processing method provided in this application can also be applied to source code debugging of an installation package configuration file (package). For specific implementation methods, please refer to Figure 2 or Figure 3 The implementation methods in will not be repeated here.

[0132] In the embodiment of the present application, the source code of the static library and the application archive file are obtained, the application archive file includes a first code segment, based on the source code of the static library, a dynamic library corresponding to the static library is generated, the dynamic library is written into the application archive file, and the updated application archive file is obtained. The first code segment in the updated application archive file is replaced with the second code segment to obtain the debugging file corresponding to the source code of the static library. It can be seen that by performing differential processing on the identification of the class to be debugged in the static library, the identification of the class to be debugged after the differential processing and the identification of the class to be debugged in the application archive file (not subjected to differential processing) can be distinguished, reducing the risk of program exceptions caused by the same identification after the dynamic library is written into the application archive file. By creating a system engineering, a debugging environment is provided for the dynamic library in the system engineering. By updating the signature information of the library in the application archive file, it can be ensured that the debugging file runs smoothly in the debugging device. By converting the static library into a dynamic library and writing the dynamic library into the application archive file, the source code of the static library can be embedded into the library of the application archive file, thereby obtaining the debugging file corresponding to the source code of the static library, and the abnormal information of the static library in the use process can be quickly restored through the debugging file, thereby improving the optimization efficiency of the static library.

[0133] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, the device of the embodiment of the present application is provided below accordingly.

[0134] See also Figure 5 , Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application is shown in FIG. Figure 5 The data processing apparatus shown may be mounted in a computer device, which may specifically be a terminal device or a server. Figure 5 The data processing device shown can be used to perform the above Figure 2 and Figure 3 Some or all of the functions of the described method embodiments. Figure 5 , the data processing device comprises:

[0135] The acquisition unit 501 is used to acquire source code of a static library and an application archive file, wherein the static library includes a class to be debugged; the application archive file includes a first code segment, and the first code segment is used to return a first object, which is an instance of the class to be debugged in the static library;

[0136] The processing unit 502 is used to generate a dynamic library corresponding to the static library based on the source code of the static library, wherein the dynamic library includes a target class, and the target class is obtained by performing macro renaming processing on the class to be debugged;

[0137] and for writing the dynamic library into the application archive file to obtain an updated application archive file;

[0138] And it is used to replace the first code segment in the updated application archive file with the second code segment to obtain a debugging file corresponding to the source code of the static library, the second code segment is used to return a second object, the second object is an instance of the target class, and the debugging file is used to debug the class to be debugged.

[0139] In one implementation, the application archive file further includes a third code segment and N libraries, the third code segment is used to access the static library, and N is a positive integer; the processing unit 502 is used to write the dynamic library into the application archive file to obtain an updated application archive file, specifically for:

[0140] Decompress the application archive file to obtain the third code segment and N libraries;

[0141] The third code segment is replaced by the fourth code segment, where the fourth code segment is used to access the dynamic library;

[0142] Re-sign N libraries to obtain updated signature information of N libraries;

[0143] Based on the fourth code segment and the updated signature information of the N libraries, an updated application archive file is generated.

[0144] In one implementation, the processing unit 502 is used to perform re-signature processing on N libraries to obtain updated signature information of the N libraries, specifically for:

[0145] Get the signature information of the debugging device, which is used to debug the class to be debugged;

[0146] The signature information of the N libraries is updated by using the signature information of the debugging device to obtain the updated signature information of the N libraries.

[0147] In one implementation, the third code segment includes an access path to a static library; and the process in which the processing unit 502 replaces the third code segment with the fourth code segment includes:

[0148] Replace the static library access path with the dynamic library access path.

[0149] In one implementation, in the source code of the static library, the identifier of the class to be debugged is the first identifier; the processing unit 502 is used to generate a dynamic library corresponding to the static library based on the source code of the static library, specifically for:

[0150] Replace the identifier of the class to be debugged in the source code of the static library with the second identifier to obtain the updated source code of the static library;

[0151] Package the updated source code of the static library to obtain the framework file corresponding to the static library;

[0152] Get the dynamic library to be filled;

[0153] Add the framework file to the dynamic library to be filled to obtain the dynamic library corresponding to the static library.

[0154] In one implementation, the processing unit 502 is used to obtain a dynamic library to be filled, specifically to:

[0155] Create a system project, which is used to provide a debugging environment for the dynamic library in the system project;

[0156] Create a dynamic library in the system engineering to obtain the dynamic library to be filled.

[0157] In one embodiment, the first code segment includes an initialization method of a class to be debugged and a first acquisition instruction, the first acquisition instruction is used to obtain a return result of the class to be debugged; the second code segment includes an initialization method of a target class and a second acquisition instruction, the second acquisition instruction is used to obtain a return result of the target class;

[0158] The processing unit 502 is used to replace the first code segment in the updated application archive file with the second code segment to obtain a debugging file corresponding to the source code of the static library, specifically for:

[0159] Replace the initialization method of the class to be debugged in the updated application archive file with the initialization method of the target class; and,

[0160] Replace the first acquisition instruction in the updated application archive file with the second acquisition instruction.

[0161] In one implementation, the application archive file is generated by the sender exception information of the application archive file, and the exception information is obtained after accessing the static library; the processing unit 502 is also used to:

[0162] Use debugging tools to locate problems associated with exception information in the target class;

[0163] Optimize the problems associated with abnormal information in the target class to obtain the optimization results of the target class;

[0164] According to the optimization method of the target class, the class to be debugged is optimized to obtain the optimized source code of the static library.

[0165] In one implementation, the application archive file further includes class indication information, where the class indication information is used to indicate a class to be debugged in a static library; the static library includes M classes, where M is a positive integer; the processing unit 502 is further used to:

[0166] Based on the class indication information, a class to be debugged among the M classes is determined.

[0167] According to one embodiment of the present application, Figure 2 and Figure 3 Some of the steps involved in the data processing method shown can be represented by Figure 5 The data processing device shown in the figure is executed by each unit. For example, Figure 2 The step S201 shown in FIG. 1 can be performed by Figure 5 The acquisition unit 501 shown in FIG. 1 is executed, and steps S202 to S204 can be performed by Figure 5 The processing unit 502 shown executes; Figure 3 The step S301 shown in FIG. Figure 5 The acquisition unit 501 shown in FIG. 1 is executed, and steps S302 to S306 can be performed by Figure 5 Processing unit 502 is shown executing. Figure 5 The various units in the data processing device shown can be respectively or all combined into one or several other units to constitute, or some of the units (some) can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of a unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of the present application, the data processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0168] According to another embodiment of the present application, the program can be executed by running a program on a general computing device such as a computer device including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 and Figure 3 A computer program (including program code) for each step involved in the corresponding method shown in Figure 5 The data processing device shown in the embodiment of the present application is used to implement the data processing method of the embodiment of the present application. The computer program can be recorded on a computer-readable recording medium, for example, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.

[0169] Based on the same inventive concept, the principles and beneficial effects of solving the problems by the data processing device provided in the embodiment of the present application are similar to the principles and beneficial effects of solving the problems by the data processing method in the method embodiment of the present application. Please refer to the principles and beneficial effects of the implementation of the method. For the sake of concise description, they will not be repeated here.

[0170] See also Figure 6 , Figure 6 The following is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a terminal device or a server. Figure 6 As shown, the computer device at least includes a processor 601, a communication interface 602 and a memory 603. The processor 601, the communication interface 602 and the memory 603 can be connected via a bus or other means. The processor 601 (or central processing unit (CPU)) is the computing core and control core of the computer device, which can parse various instructions in the computer device and process various data of the computer device. For example, the CPU can be used to parse the power on and off instructions issued by the object to the computer device, and control the computer device to perform power on and off operations; for example, the CPU can transmit various interactive data between the internal structures of the computer device, and so on. The communication interface 602 can optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.), which can be used to send and receive data under the control of the processor 601; the communication interface 602 can also be used for the transmission and interaction of data within the computer device. The memory 603 (Memory) is a memory device in the computer device, which is used to store programs and data. It can be understood that the memory 603 here can include both the built-in memory of the computer device and the extended memory supported by the computer device. The memory 603 provides a storage space, which stores the operating system of the computer device, including but not limited to: Android system, iOS system, Windows Phone system, etc., which is not limited in this application.

[0171] The embodiment of the present application also provides a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space that stores the processing system of the computer device. In addition, a computer program suitable for being loaded and executed by the processor 601 is also stored in the storage space. It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory, such as at least one disk storage; optionally, it can also be at least one computer-readable storage medium located away from the aforementioned processor.

[0172] In one embodiment, the processor 601 performs the following operations by running the computer program in the memory 603:

[0173] Obtaining source code of a static library and an application archive file, wherein the static library includes a class to be debugged; the application archive file includes a first code segment, wherein the first code segment is used to return a first object, and the first object is an instance of the class to be debugged in the static library;

[0174] Based on the source code of the static library, a dynamic library corresponding to the static library is generated. The dynamic library includes a target class, which is obtained by performing macro renaming on the class to be debugged.

[0175] Writing the dynamic library into the application archive file to obtain an updated application archive file;

[0176] The second code segment is used to replace the first code segment in the updated application archive file to obtain a debugging file corresponding to the source code of the static library. The second code segment is used to return a second object, which is an instance of the target class. The debugging file is used to debug the class to be debugged.

[0177] As an optional embodiment, the application archive file further includes a third code segment and N libraries, the third code segment is used to access the static library, and N is a positive integer; the processor 601 writes the dynamic library into the application archive file, and a specific embodiment of obtaining the updated application archive file is as follows:

[0178] Decompress the application archive file to obtain the third code segment and N libraries;

[0179] The third code segment is replaced by the fourth code segment, where the fourth code segment is used to access the dynamic library;

[0180] Re-sign N libraries to obtain updated signature information of N libraries;

[0181] Based on the fourth code segment and the updated signature information of the N libraries, an updated application archive file is generated.

[0182] As an optional embodiment, the processor 601 performs re-signature processing on N libraries, and a specific embodiment of obtaining updated signature information of N libraries is as follows:

[0183] Get the signature information of the debugging device, which is used to debug the class to be debugged;

[0184] The signature information of the N libraries is updated by using the signature information of the debugging device to obtain the updated signature information of the N libraries.

[0185] As an optional embodiment, the third code segment includes an access path of the static library; and the process in which the processor 601 replaces the third code segment with the fourth code segment includes:

[0186] Replace the static library access path with the dynamic library access path.

[0187] As an optional embodiment, in the source code of the static library, the identifier of the class to be debugged is the first identifier; the specific embodiment of the processor 601 generating the dynamic library corresponding to the static library based on the source code of the static library is:

[0188] Replace the identifier of the class to be debugged in the source code of the static library with the second identifier to obtain the updated source code of the static library;

[0189] Package the updated source code of the static library to obtain the framework file corresponding to the static library;

[0190] Get the dynamic library to be filled;

[0191] Add the framework file to the dynamic library to be filled to obtain the dynamic library corresponding to the static library.

[0192] As an optional embodiment, the specific embodiment of the processor 601 obtaining the dynamic library to be filled is:

[0193] Create a system project, which is used to provide a debugging environment for the dynamic library in the system project;

[0194] Create a dynamic library in the system engineering to obtain the dynamic library to be filled.

[0195] As an optional embodiment, the first code segment includes an initialization method of a class to be debugged and a first acquisition instruction, the first acquisition instruction is used to obtain a return result of the class to be debugged; the second code segment includes an initialization method of a target class and a second acquisition instruction, the second acquisition instruction is used to obtain a return result of the target class;

[0196] The specific embodiment of the processor 601 replacing the first code segment in the updated application archive file with the second code segment to obtain the debugging file corresponding to the source code of the static library is:

[0197] Replace the initialization method of the class to be debugged in the updated application archive file with the initialization method of the target class; and,

[0198] Replace the first acquisition instruction in the updated application archive file with the second acquisition instruction.

[0199] As an optional embodiment, the application archive file is generated by the sender exception information of the application archive file, and the exception information is obtained after accessing the static library; the processor 601 further performs the following operations by running the computer program in the memory 603:

[0200] Use debugging tools to locate problems associated with exception information in the target class;

[0201] Optimize the problems associated with abnormal information in the target class to obtain the optimization results of the target class;

[0202] According to the optimization method of the target class, the class to be debugged is optimized to obtain the optimized source code of the static library.

[0203] As an optional embodiment, the application archive file further includes class indication information, and the class indication information is used to indicate the class to be debugged in the static library; the static library includes M classes, where M is a positive integer; the processor 601 further performs the following operations by running the computer program in the memory 603:

[0204] Based on the class indication information, a class to be debugged among the M classes is determined.

[0205] Based on the same inventive concept, the principles and beneficial effects of solving the problems provided by the computer device in the embodiment of the present application are similar to the principles and beneficial effects of solving the problems provided by the data processing method in the method embodiment of the present application. Please refer to the principles and beneficial effects of the implementation of the method. For the sake of concise description, they will not be repeated here.

[0206] An embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded by a processor and executing the data processing method of the above method embodiment.

[0207] The embodiment of the present application also 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 the computer device executes the above-mentioned data processing method.

[0208] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0209] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0210] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the readable storage medium can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0211] What is disclosed above is only a preferred embodiment of the present application, and it certainly cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiment and equivalent changes made according to the claims of the present application are still within the scope covered by the application.

Claims

1. A data processing method, characterized in that: The method comprises: Obtaining source code of a static library and an application archive file, wherein the static library includes a class to be debugged; the application archive file includes a first code segment, wherein the first code segment is used to return a first object, wherein the first object is an instance of the class to be debugged in the static library; Based on the source code of the static library, a dynamic library corresponding to the static library is generated, wherein the dynamic library includes a target class, and the target class is obtained by performing macro renaming processing on the class to be debugged; Writing the dynamic library into the application archive file to obtain an updated application archive file; The second code segment is used to replace the first code segment in the updated application archive file to obtain a debugging file corresponding to the source code of the static library, the second code segment is used to return a second object, the second object is an instance of the target class, and the debugging file is used to debug the class to be debugged.

2. The method according to claim 1, characterized in that The application archive file further includes a third code segment and N libraries, wherein the third code segment is used to access the static library, and N is a positive integer; the writing of the dynamic library into the application archive file to obtain an updated application archive file includes: Decompressing the application archive file to obtain the third code segment and the N libraries; The third code segment is replaced by a fourth code segment, wherein the fourth code segment is used to access the dynamic library; Re-signing the N libraries to obtain updated signature information of the N libraries; An updated application archive file is generated based on the fourth code segment and the updated signature information of the N libraries.

3. The method according to claim 2, characterized in that The re-signing process is performed on the N libraries to obtain updated signature information of the N libraries, including: Acquire signature information of a debugging device, where the debugging device is used to debug the class to be debugged; The signature information of the N libraries is updated using the signature information of the debugging device to obtain updated signature information of the N libraries.

4. The method according to claim 2, characterized in that The third code segment includes an access path of the static library; and the process of replacing the third code segment with the fourth code segment includes: The access path of the static library is replaced by the access path of the dynamic library.

5. The method according to claim 1, characterized in that In the source code of the static library, the identifier of the class to be debugged is a first identifier; The step of generating a dynamic library corresponding to the static library based on the source code of the static library includes: Replacing the identifier of the class to be debugged in the source code of the static library with the second identifier to obtain the updated source code of the static library; Packaging the updated source code of the static library to obtain the framework file corresponding to the static library; Get the dynamic library to be filled; Add the framework file to the dynamic library to be filled to obtain a dynamic library corresponding to the static library.

6. The method according to claim 5, characterized in that The step of obtaining a dynamic library to be filled includes: Creating a system project, wherein the system project is used to provide a debugging environment for a dynamic library in the system project; In the system engineering, a dynamic library is created to obtain a dynamic library to be filled.

7. The method according to claim 1, characterized in that The first code segment includes an initialization method of the class to be debugged and a first acquisition instruction, the first acquisition instruction is used to acquire the return result of the class to be debugged; the second code segment includes an initialization method of the target class and a second acquisition instruction, the second acquisition instruction is used to acquire the return result of the target class; The step of replacing the first code segment in the updated application archive file with the second code segment to obtain a debugging file corresponding to the source code of the static library includes: Replace the initialization method of the class to be debugged in the updated application archive file with the initialization method of the target class; as well as, The first acquisition instruction in the updated application archive file is replaced by the second acquisition instruction.

8. The method according to claim 1, characterized in that The application archive file is generated by sender exception information of the application archive file, and the exception information is obtained after accessing the static library; the method further includes: Using a debugging tool, locate the problem associated with the abnormal information in the target class; Optimizing the problems associated with the abnormal information in the target class to obtain an optimization result of the target class; According to the optimization method of the target class, the class to be debugged is optimized to obtain the optimized source code of the static library.

9. The method according to claim 1, characterized in that The application archive file also includes class indication information, and the class indication information is used to indicate the class to be debugged in the static library; the static library includes M classes, where M is a positive integer; the method also includes: Based on the class indication information, a class to be debugged among the M classes is determined.

10. A data processing device, characterized in that: The data processing device comprises: an acquisition unit, configured to acquire source code of a static library and an application archive file, wherein the static library includes a class to be debugged; the application archive file includes a first code segment, wherein the first code segment is configured to return a first object, wherein the first object is an instance of the class to be debugged in the static library; A processing unit, configured to generate a dynamic library corresponding to the static library based on the source code of the static library, wherein the dynamic library includes a target class, and the target class is obtained by performing macro renaming processing on the class to be debugged; and for writing the dynamic library into the application archive file to obtain an updated application archive file; And it is used to replace the first code segment in the updated application archive file with a second code segment to obtain a debugging file corresponding to the source code of the static library, wherein the second code segment is used to return a second object, which is an instance of the target class, and the debugging file is used to debug the class to be debugged.

11. A computer device, characterized in that: include: a memory, wherein a computer program is stored in the memory; A processor, used to load the computer program to implement the data processing method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the data processing method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program is suitable for being loaded by a processor and executing the data processing method according to any one of claims 1 to 9.