CN117349165A - Compiling and debugging method and device, storage medium and electronic equipment - Google Patents

Compiling and debugging method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117349165A
CN117349165A CN202311309447.2A CN202311309447A CN117349165A CN 117349165 A CN117349165 A CN 117349165A CN 202311309447 A CN202311309447 A CN 202311309447A CN 117349165 A CN117349165 A CN 117349165A
Authority
CN
China
Prior art keywords
file
terminal
source code
compiling
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311309447.2A
Other languages
Chinese (zh)
Inventor
刘鑫琪
刘唱畅
俞建晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202311309447.2A priority Critical patent/CN117349165A/en
Publication of CN117349165A publication Critical patent/CN117349165A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the specification discloses a compiling and debugging method, a device, a storage medium and electronic equipment, wherein the method comprises the following steps: acquiring a compiling dependent package and a single warehouse source code file corresponding to a target complete machine version of a terminal, determining a source code modification file corresponding to the single warehouse source code file, converting the source code modification file into an incremental system executable file for the terminal, writing the incremental system executable file into the terminal, and updating a system class path of the terminal based on the incremental system executable file so as to control the terminal to load the incremental system executable file through a class loading mechanism when the terminal system is debugged.

Description

Compiling and debugging method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a compiling and debugging method, a device, a storage medium, and an electronic apparatus.
Background
With the rapid development of computer technology, terminals such as mobile phones and tablets are rapidly popularized, when a complete machine compiling and debugging is carried out on a terminal system, a complete machine source code environment of the system is generally required to be downloaded, then a system module where a modified file is located is compiled based on the complete machine source code environment of the system, a complete machine frame layer file is obtained after the compiling is completed, and then the terminal system is debugged based on the complete machine frame layer file in a state that the terminal can be mounted.
Disclosure of Invention
The embodiment of the specification provides a compiling and debugging method, a compiling and debugging device, a storage medium and electronic equipment, wherein the technical scheme is as follows:
in a first aspect, an embodiment of the present disclosure provides a compiling and debugging method, where the method includes:
acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of a terminal, and determining a source code modification file corresponding to the single warehouse source code file;
and converting the source code modification file into an incremental system executable file aiming at the terminal, writing the incremental system executable file into the terminal, and updating a system class path of the terminal based on the incremental system executable file so as to control the terminal to load the incremental system executable file through a class loading mechanism when the terminal system is debugged.
In a second aspect, embodiments of the present disclosure provide a compiling and debugging device, the device including:
the file processing module is used for acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of the terminal and determining a source code modification file corresponding to the single warehouse source code file;
the compiling processing module is used for converting the source code modification file into an increment system executable file aiming at the terminal, writing the increment system executable file into the terminal, and updating a system class path of the terminal based on the increment system executable file so as to control the terminal to load the increment system executable file through a class loading mechanism when the terminal system is debugged.
In a third aspect, the present description provides a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-described method steps.
In a fourth aspect, embodiments of the present disclosure provide an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
The technical scheme provided by some embodiments of the present specification has the following beneficial effects:
in one or more embodiments of the present disclosure, a compiling dependency package and a single-repository source code file corresponding to a target complete machine version of a terminal are obtained, a source code modification file corresponding to the single-repository source code file is determined, the source code modification file is converted into an incremental system executable file for the terminal, the incremental system executable file is written into the terminal, and a system class path update is performed on the terminal based on the incremental system executable file, so that the terminal is controlled to load the incremental system executable file through a class loading mechanism when the terminal system is debugged, and thus, in the compiling and debugging process of the original complete machine system, the related framework layer code compiling and debugging process can be optimized, the source code environment is realized only by downloading the single-repository source code file, and the increment based on the single-repository source code file, so that the local storage space occupied by a development test terminal is greatly reduced, and the compiling and debugging speed of the development test terminal is improved.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a compiling and debugging method according to an embodiment of the present disclosure;
FIG. 2 is a flowchart of another method for compiling and debugging according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a compiling and debugging device according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a document processing module according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of an operating system and user space provided by an embodiment of the present disclosure;
FIG. 7 is an architecture diagram of the android operating system of FIG. 6;
FIG. 8 is an architecture diagram of the IOS operating system of FIG. 6.
Detailed Description
The technical solutions of the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
In the description of the present specification, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present specification, it should be noted that, unless expressly specified and limited otherwise, "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus. The specific meaning of the terms in this specification will be understood by those of ordinary skill in the art in the light of the specific circumstances. In addition, in the description of the present specification, unless otherwise indicated, "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
In the related art, when a complete machine compiling and debugging are performed on a terminal system, a complete machine source code environment of the system is generally required to be downloaded, then a system module where a modification file is located is compiled based on the complete machine source code environment of the system, a complete machine frame layer file is obtained after the compiling is completed, and then the debugging is performed based on the complete machine frame layer file in a terminal mountable state. Taking an android system with a terminal system as a main stream as an example, a compiling and debugging method of Java codes of a main stream Android Framework at present mainly relates to complete machine module compiling and mountable (remote) debugging:
compiling a complete machine module: firstly, the complete machine source code environment file of the terminal system needs to be downloaded, and then the system module where the modification file is located is compiled (such as module files of frame work. Jar, services. Jar, etc.). Illustratively, if frame work jar is compiled, the instruction may be compiled by: after compiling, the frame work/jar file containing the modifications, "frame work/jar file," i.e., the complete machine frame layer file, is obtained and then ready for mounting (remove) debugging.
Mountable (remote) debug: the terminal is in a mountable (Remount) state, and the read-only partition can be dynamically modified in the mountable (Remount) state. And copying the frame work jar file after the compiling is successful to the mobile phone, so that the modified code is effective, and the development terminal can start to debug.
However, in the above process, for compiling the complete machine module, the complete machine source code environment file needs to be downloaded to the development test terminal in advance, and the complete machine source code environment file can reach more than 100GB, which greatly affects the compiling and debugging speed of the development test terminal, and the compiling and debugging efficiency is low.
It should be noted that, information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals according to the embodiments of the present disclosure are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions.
The present specification is described in detail below with reference to specific examples.
In one embodiment, as shown in fig. 1, a compile debugging method is specifically proposed, which can be implemented in dependence on a computer program and can be run on a compile debugging device based on von neumann system. The computer program may be integrated in the application or may run as a stand-alone tool class application. The compiling and debugging device may be a development testing terminal, including but not limited to: personal computers, tablet computers, handheld devices, vehicle mounted devices, wearable devices, computing devices, or other processing devices connected to a wireless modem, and the like. Terminal devices in different networks may be called different names, for example: a user equipment, an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent or user equipment, a cellular telephone, a cordless telephone, an electronic device in a 5G network or future evolution network, etc.
Specifically, the compiling and debugging method comprises the following steps:
s102: acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of a terminal, and determining a source code modification file corresponding to the single warehouse source code file;
the compiling dependent package is obtained by collecting original byte code files under a system frame layer directory when the terminal compiles the whole machine version, and the collection of all the original byte code files is the compiling dependent package.
The whole machine source code environment file of the terminal operating system can be stored in a form of a warehouse source code, and the warehouse source code comprises a basic single warehouse source code file of a plurality of functional modules.
In the specification, in the compiling link of the complete machine (operating system) version of each terminal, collecting original byte code files under the system frame layer directory, collecting all original byte code files and packaging to obtain a basic compiling dependency package of the complete machine system version, simultaneously recording the complete machine version of the system in the compiling link of the complete machine (operating system), associating the complete machine version of the system with the basic compiling dependency package corresponding to the complete machine version of the system, simultaneously determining one or more basic single warehouse files actually called by the compiling link of the complete machine (operating system), associating the 'one or more basic single warehouse files' with the complete machine version of the system, establishing a reference mapping relation between each complete machine version of the system, the 'one or more basic single warehouse files' and the basic compiling dependency package, and subsequently modifying a source code development file, such as Java source development file, by modifying the source development file, according to the reference mapping relation, only needing to determine the target complete machine version of the modification, then obtaining the compiling dependency package and the source development file of the terminal based on the reference mapping relation;
The target complete machine version can be understood as the complete machine system version which needs to be modified by the current development testing terminal;
optionally, after triggering the compiling link of the complete machine (operating system) version aiming at the terminal each time, the development testing terminal collects the original byte code file under the current system framework layer directory and packages the original byte code file to obtain the compiling dependent package of the complete machine system version, and associates the complete machine version of the current system with the compiling dependent package.
Optionally, the development test end may be used in cooperation with the compiling server, that is, after triggering the compiling link of the complete machine (operating system) version for the terminal each time, the compiling server is instructed to collect the original byte code file under the current system framework layer directory, package the original byte code file to obtain the compiling dependent package of the complete machine system version, and associate the complete machine version of the current system with the compiling dependent package.
By way of example, the system framework layer directory may be, for example "/system/framework/directory" i.e., collect complete compilation links: and finally integrating the jar files of the original class byte codes under the system/frame/directory, collecting the jar files of the original class byte codes, and packaging to obtain a compiling dependent package for the test development terminal to acquire.
S104: and converting the source code modification file into an incremental system executable file aiming at the terminal, writing the incremental system executable file into the terminal, and updating a system class path of the terminal based on the incremental system executable file so as to control the terminal to load the incremental system executable file through a class loading mechanism when the terminal system is debugged.
Illustratively, the source code modification file is compiled, and compiling parameters are configured in the compiling process: inputting a path of compiling a dependency package, inputting a modified source code file, and realizing incremental compiling of the source code modified file; after the increment compiling is completed, a jar file of class (byte code) can be obtained, and the jar file of class (byte code) is the executable file of the increment system.
Further, when the terminal is in the mountable state, the development testing terminal can modify the file in the read-only file partition, then write the incremental system executable file into the terminal, after writing the incremental system executable file into the terminal, perform system class path update on the terminal based on the incremental system executable file, wherein the system class path update is used for adjusting the declaration sequence of class loading, then restart the terminal, enter terminal system debugging, and control the terminal to load the incremental system executable file through a class loading mechanism during terminal system debugging.
In the embodiment of the specification, the compiling dependency package and the single warehouse source code file corresponding to the target whole machine version of the terminal are obtained, the source code modification file corresponding to the single warehouse source code file is determined, the source code modification file is converted into the increment system executable file for the terminal, the increment system executable file is written into the terminal, and the system type path updating is carried out on the terminal based on the increment system executable file, so that the terminal is controlled to load the increment system executable file through a type loading mechanism when the terminal system is debugged, and therefore, the related framework layer code compiling and debugging process can be optimized in the compiling and debugging process of the original whole machine system, the source code environment is realized only by downloading the single warehouse source code file, and the increment compiling based on the single warehouse source code file is greatly reduced, the local storage space of a development test terminal is occupied, and the compiling and debugging speed of the development test terminal is improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating another embodiment of a compiling and debugging method according to the present disclosure. Specific:
s202: acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of a terminal from a compiling server;
In some embodiments, before executing the compiling dependent package and the single-repository source code file corresponding to the target full-machine version of the terminal obtained from the compiling server, the development testing terminal may further adopt the following manner:
a2: under a terminal complete machine compiling scene, controlling a compiling server to obtain a compiling dependent package corresponding to a target complete machine version from a system framework layer directory, and controlling the compiling server to determine a single warehouse source code file corresponding to the target complete machine version;
the development test end can be used with a compiling server in a matching way, in the compiling link of the complete machine (operating system) version of each terminal, the compiling server is controlled to collect original byte code files under a system frame layer directory "/system/frame work/directory", collect all original byte code files (jar files of original class byte codes) under "/system/frame work/directory" and package to obtain a basic compiling dependent package of the complete machine system version, and record the complete machine version (the complete machine version of the system comprises the current target complete machine version modified next time) of the complete machine (operating system) version compiling link, and meanwhile determine one or more basic single warehouse files actually called by the complete machine (operating system) version compiling link;
The class byte code is a binary execution file of the JVM virtual machine obtained after compiling a Java source code file;
a4: and storing the compiling dependent package and the single warehouse source code file corresponding to the target whole machine version through the compiling server.
The control compiling server associates the whole system version with the basic compiling dependency package corresponding to the whole system version, determines one or more basic single warehouse files actually called by the compiling link of the whole system (operating system) version, associates one or more basic single warehouse files with the whole system version, establishes a reference mapping relation between each whole system version and the basic single warehouse file and the basic compiling dependency package based on the basic single warehouse file, does not need to download a whole system source code environment file when the whole system version is compiled next time, only needs to determine the target whole system version needing to be modified this time, acquires the compiling dependency package and the single warehouse source code file corresponding to the target whole system version of the terminal based on the reference mapping relation, and then the development testing terminal can carry out development testing modification on the single warehouse source code file based on the modification operation of development testing personnel, thereby determining source code modification files corresponding to the single warehouse source code file, such as a modified source code Java file;
S204: and generating a source code modification file corresponding to the source code modification operation in response to the source code modification operation aiming at the single warehouse source code.
Illustratively, a development tester downloads a compiling dependent package and a single-warehouse source code file corresponding to a target whole machine version from a compiling server through a development testing end, and then receives input source code modification operation aiming at the single-warehouse source code based on development testing requirements to modify a source code Java file in the single-warehouse source code file, so that a source code modification file is generated.
S206: and calling a target script to compile the source code modification file to obtain a target byte code file, and converting the target byte code file into an incremental system executable file aiming at the terminal.
Illustratively, the target bytecode file is a jar file of class bytecode after the compilation of the source code modification file is completed;
illustratively, converting the target bytecode file into an incremental system executable file for the terminal may be understood as performing a class bytecode file conversion into a dex file, the dex file being a system executable file;
in some embodiments, a target script is preconfigured, the target script is used for realizing automation of a compiling process and an installing process, and for development testers at a development test end, only an environment corresponding to a target complete machine version is initialized and source codes are modified, and the compiling process and the installing process are not needed to be manually intervened, so that the debugging compiling process is optimized;
The custom target script is used to realize the automation of the environment downloading, the inputting of the compiling parameters and the inputting of the installing parameters, so that the manual operation of a developer can be reduced, and the attention of the development to codes is improved.
In a possible implementation manner, the compiling of the source code modification file by executing the call target script to obtain the target byte code file may be as follows:
and calling a target script to control a source code compiler to configure class path parameters aiming at compiling the dependency package, and performing incremental compiling on the source code modification file to obtain a target byte code file.
Illustratively, a source code compiler (e.g., a Java compiler) compiles the source code modification file, and configures compiling parameters during compiling: configuring class path parameters classpath of a compiling dependent package, inputting modified source code files by input files, and realizing incremental compiling of the source code modified files; after the increment compiling is completed, a jar file of class (byte code) can be obtained, and the jar file of class (byte code) is the executable file of the increment system.
In a possible implementation manner, the converting the target byte code file into the incremental system executable file for the terminal may be performed in the following manner:
And the control target execution program performs file type conversion on the target byte code file to obtain an initial incremental system executable file aiming at the terminal, and performs byte alignment processing on the initial incremental system executable file to obtain an incremental system executable file.
Exemplary, the build script will obtain a "target bytecode file (Jar file of class bytecode), convert the class file into a dex file (system executable file) by a target execution query such as" d8.Jar executor ", obtain a dex file that can be run in the system environment, and target byte-align the dex file (e.g., 4-byte-align), and an incremental system executable file, e.g., named quick. Jar, where Jar can be understood as" a collection of multiple class files "
S208: the control target script determines that the terminal is in a mountable state, and writes the incremental system executable file into an executable file path under a system framework layer directory of the terminal;
further, the development testing terminal controls the terminal to enter a mountable state, when the terminal is in the mountable state, the development testing terminal can modify files in the read-only file partition, and then the incremental system executable files are written into the terminal;
For example, the target script copies the incremental system executable file "quick. Jar file" to the path of the terminal directory/system/frame work/quick. Jar under the state that the terminal is in the remote (mountable) state, and the "path of the directory/system/frame work/quick. Jar" can be regarded as an executable file path under the system frame layer directory.
S210: and the control target script determines a modification file type corresponding to the incremental system executable file, and modifies the system environment variable class path based on the modification file type so as to control the terminal to load the incremental system executable file through a class loading mechanism when the terminal system is debugged.
Furthermore, after the control target script is written into the terminal, the control target script updates the system class path of the terminal based on the incremental system executable file, the system class path update is used for adjusting the statement sequence of class loading, then the terminal is restarted, the terminal system debugging link is entered, and the control terminal loads the incremental system executable file through a class loading mechanism when the terminal system is debugged.
Illustratively, the modifying the system environment variable class path based on the modification file type may be:
the system environment variable class path at least comprises a guide class directory path and a system service class directory path;
if the modified file type is the guide type, determining a guide catalog path, and updating a guide loading statement sequence corresponding to the guide catalog path based on the increment system executable file;
and if the modified file type is the system service type, determining a system service category directory path, and updating a system service loading statement sequence corresponding to the system service category directory path based on the incremental system executable file.
The target script determines a modification file type corresponding to the incremental system executable file when the terminal is in a Remount (mountable) state, and in practical application, the incremental modification based on development test requirements can be modified for a system service class or a guide class, and the modification file type corresponding to the system executable file can be determined first, for example, the modification file type can be a guide class bootclassspath or a system service class systemoversprassath;
If the modified file type is the guide type, determining a guide category directory path '/system/etc/classspace/bootclassspace.pb ', and then modifying the file content of the guide category directory path '/system/etc/classspace/bootclassspace.pb;
if the modified file type is the system service type, determining a system service catalog path "/system/etc/classpath/system/classclasspath/classpath"/system/etc/classpath, and then modifying the content of the system/etc/classpath/systemclasspath/pb file in the terminal catalog;
the file content is the declaration sequence of class loading, and the incremental system executable file is usually inserted in front of the class loading file list, so that the incremental system executable file quick.
In one or more embodiments of the present disclosure, the compiling and debugging method can implement single warehouse compiling of system environment source codes, and compared with traditional system complete machine source code compiling, storage optimization of dimension level is implemented, and local storage space and environment preparation time are greatly reduced; the increment compiling of the code level is realized by adopting the compiling and debugging method, and compared with the traditional full compiling, the compiling time and the executable file size of an increment system are greatly reduced; the Java-based class loading mechanism is realized, and the incremental compiling product can realize code modification and debugging effects under the condition of not depending on the source codes of the full system environment; and the compiling and installing automation is realized by using the target script, the downloading of the dependent environment data, the input of the compiling parameters and the input of the installing parameters are automated, and the manual operation of a developer is reduced.
The compiling and debugging device according to the embodiment of the present disclosure will be described in detail below with reference to fig. 3. Note that, the compiling and debugging device shown in fig. 3 is used for executing the method of the embodiment shown in fig. 1 to 2 of the present specification, and for convenience of explanation, only the portion relevant to the embodiment of the present specification is shown, and specific technical details are not disclosed, please refer to the embodiment shown in fig. 1 to 2 of the present specification.
Fig. 3 is a schematic structural diagram of a compiling and debugging device according to an embodiment of the present disclosure. The compiling and debugging device 1 may be realized as all or a part of a device by software, hardware or a combination of both. According to some embodiments, the compiling and debugging device 1 comprises a file processing module 11 and a compiling and processing module 12, which are specifically configured to:
the file processing module 11 is used for acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of the terminal and determining a source code modification file corresponding to the single warehouse source code file;
the compiling processing module 12 is configured to convert the source code modification file into an incremental system executable file for the terminal, write the incremental system executable file into the terminal, and update a system class path of the terminal based on the incremental system executable file, so as to control the terminal to load the incremental system executable file through a class loading mechanism when the terminal system is debugged.
Optionally, as shown in fig. 4, the file processing module 11 includes:
a data obtaining unit 111, configured to obtain, from a compiling server, a compiling dependent package and a single-repository source code file corresponding to a target full-machine version of a terminal;
the file generating unit 112 is configured to generate a source code modification file corresponding to the source code modification operation in response to the source code modification operation for the single repository source code.
Optionally, the file processing module 11 is further configured to:
under a terminal complete machine compiling scene, controlling a compiling server to obtain a compiling dependent package corresponding to a target complete machine version from a system framework layer directory, and controlling the compiling server to determine a single warehouse source code file corresponding to the target complete machine version;
and storing the compiling dependent package and the single warehouse source code file corresponding to the target whole machine version through the compiling server.
Optionally, the compiling processing module 12 is configured to:
and calling a target script to compile the source code modification file to obtain a target byte code file, and converting the target byte code file into an incremental system executable file aiming at the terminal.
Optionally, the compiling processing module 12 is configured to:
And calling a target script to control a source code compiler to configure class path parameters aiming at compiling the dependency package, and performing incremental compiling on the source code modification file to obtain a target byte code file.
Optionally, the compiling processing module 12 is configured to:
and the control target execution program performs file type conversion on the target byte code file to obtain an initial incremental system executable file aiming at the terminal, and performs byte alignment processing on the initial incremental system executable file to obtain an incremental system executable file.
Optionally, the compiling processing module 12 is configured to:
determining that the terminal is in a mountable state, and writing the incremental system executable file into an executable file path under a system framework layer directory of the terminal;
and determining a modification file type corresponding to the incremental system executable file, and modifying the system environment variable class path based on the modification file type.
Optionally, the compiling processing module 12 is configured to:
if the modified file type is the guide type, determining a guide catalog path, and updating a guide loading statement sequence corresponding to the guide catalog path based on the increment system executable file;
And if the modified file type is the system service type, determining a system service category directory path, and updating a system service loading statement sequence corresponding to the system service category directory path based on the incremental system executable file.
It should be noted that, when the compiling and debugging device provided in the foregoing embodiment executes the compiling and debugging method, only the division of the foregoing functional modules is used as an example, in practical application, the foregoing functional allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the compiling and debugging device and the compiling and debugging method provided in the foregoing embodiments belong to the same concept, which embody the detailed implementation process in the method embodiment, and are not repeated here.
The foregoing embodiment numbers of the present specification are merely for description, and do not represent advantages or disadvantages of the embodiments.
In one or more embodiments of the present disclosure, a compiling dependency package and a single-repository source code file corresponding to a target complete machine version of a terminal are obtained, a source code modification file corresponding to the single-repository source code file is determined, the source code modification file is converted into an incremental system executable file for the terminal, the incremental system executable file is written into the terminal, and a system class path update is performed on the terminal based on the incremental system executable file, so that the terminal is controlled to load the incremental system executable file through a class loading mechanism when the terminal system is debugged, and thus, in the compiling and debugging process of the original complete machine system, the related framework layer code compiling and debugging process can be optimized, the source code environment is realized only by downloading the single-repository source code file, and the increment based on the single-repository source code file, so that the local storage space occupied by a development test terminal is greatly reduced, and the compiling and debugging speed of the development test terminal is improved.
The embodiment of the present disclosure further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are adapted to be loaded by a processor and execute the compiling and debugging method according to the embodiment shown in fig. 1 to fig. 2, and a specific execution process may refer to a specific description of the embodiment shown in fig. 1 to fig. 2, which is not repeated herein.
The present disclosure further provides a computer program product, where at least one instruction is stored, where the at least one instruction is loaded by the processor and executed by the processor, where the specific execution process may refer to the specific description of the embodiment shown in fig. 1-2, and details are not repeated herein.
Referring to fig. 5, a block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown. The electronic device in this specification may include one or more of the following: processor 110, memory 120, input device 130, output device 140, and bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and lines to connect various portions of the overall electronic device, perform various functions of the electronic device 100, and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in at least one hardware form of digital signal processing (digital signal processing, DSP), field-programmable gate array (field-programmable gate array, FPGA), programmable logic array (programmable logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processing unit (central processing unit, CPU), an image processor (graphics processing unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The memory 120 may include a random access memory (random Access Memory, RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, which may be an Android (Android) system, including an Android system-based deep development system, an IOS system developed by apple corporation, including an IOS system-based deep development system, or other systems, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the electronic device in use, such as phonebooks, audiovisual data, chat log data, and the like.
Referring to FIG. 6, the memory 120 may be divided into an operating system space in which the operating system runs and a user space in which native and third party applications run. In order to ensure that different third party application programs can achieve better operation effects, the operating system allocates corresponding system resources for the different third party application programs. However, the requirements of different application scenarios in the same third party application program on system resources are different, for example, under the local resource loading scenario, the third party application program has higher requirement on the disk reading speed; in the animation rendering scene, the third party application program has higher requirements on the GPU performance. The operating system and the third party application program are mutually independent, and the operating system often cannot timely sense the current application scene of the third party application program, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third party application program.
In order to enable the operating system to distinguish specific application scenes of the third-party application program, data communication between the third-party application program and the operating system needs to be communicated, so that the operating system can acquire current scene information of the third-party application program at any time, and targeted system resource adaptation is performed based on the current scene.
Taking an operating system as an Android system as an example, as shown in fig. 7, a program and data stored in the memory 120 may be stored in the memory 120 with a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360 and an application layer 380, where the Linux kernel layer 320, the system runtime library layer 340 and the application framework layer 360 belong to an operating system space, and the application layer 380 belongs to a user space. The Linux kernel layer 320 provides the underlying drivers for various hardware of the electronic device, such as display drivers, audio drivers, camera drivers, bluetooth drivers, wi-Fi drivers, power management, and the like. The system runtime layer 340 provides the main feature support for the Android system through some C/c++ libraries. For example, the SQLite library provides support for databases, the OpenGL/ES library provides support for 3D graphics, the Webkit library provides support for browser kernels, and the like. Also provided in the system runtime library layer 340 is a An Zhuoyun runtime library (Android run) which provides mainly some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 360 provides various APIs that may be used in building applications, which developers can also build their own applications by using, for example, campaign management, window management, view management, notification management, content provider, package management, call management, resource management, location management. At least one application program is running in the application layer 380, and these application programs may be native application programs of the operating system, such as a contact program, a short message program, a clock program, a camera application, etc.; and may also be a third party application developed by a third party developer, such as a game-like application, instant messaging program, photo beautification program, etc.
Taking an operating system as an IOS system as an example, the programs and data stored in the memory 120 are shown in fig. 8, the IOS system includes: core operating system layer 420 (Core OS layer), core service layer 440 (Core Services layer), media layer 460 (Media layer), and touchable layer 480 (Cocoa Touch Layer). The core operating system layer 420 includes an operating system kernel, drivers, and underlying program frameworks that provide more hardware-like functionality for use by the program frameworks at the core services layer 440. The core services layer 440 provides system services and/or program frameworks required by the application, such as a Foundation (Foundation) framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a sports framework, and the like. The media layer 460 provides an interface for applications related to audiovisual aspects, such as a graphics-image related interface, an audio technology related interface, a video technology related interface, an audio video transmission technology wireless play (AirPlay) interface, and so forth. The touchable layer 480 provides various commonly used interface-related frameworks for application development, with the touchable layer 480 being responsible for user touch interactions on the electronic device. Such as a local notification service, a remote push service, an advertisement framework, a game tool framework, a message User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
Among the frameworks illustrated in fig. 8, frameworks related to most applications include, but are not limited to: the infrastructure in core services layer 440 and the UIKit framework in touchable layer 480. The infrastructure provides many basic object classes and data types, providing the most basic system services for all applications, independent of the UI. While the class provided by the UIKit framework is a basic UI class library for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides the infrastructure for applications to build user interfaces, draw, process and user interaction events, respond to gestures, and so on.
The manner and principle of implementing data communication between the third party application program and the operating system in the IOS system may refer to the Android system, and this description is not repeated here.
The input device 130 is configured to receive input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are a touch display screen for receiving a touch operation thereon or thereabout by a user using a finger, a touch pen, or any other suitable object, and displaying a user interface of each application program. Touch display screens are typically provided on the front panel of an electronic device. The touch display screen may be designed as a full screen, a curved screen, or a contoured screen. The touch display screen may also be designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, and the embodiments of the present disclosure are not limited thereto.
In addition, those skilled in the art will appreciate that the configuration of the electronic device shown in the above-described figures does not constitute a limitation of the electronic device, and the electronic device may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the electronic device further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (wireless fidelity, wiFi) module, a power supply, and a bluetooth module, which are not described herein.
In the embodiment of the present specification, the execution subject of each step may be the electronic device described above. Optionally, the execution subject of each step is an operating system of the electronic device. The operating system may be an android system, an IOS system, or other operating systems, which embodiments of the present specification are not limited to.
The electronic device of the embodiment of the present specification may further have a display device mounted thereon, and the display device may be various devices capable of realizing a display function, for example: cathode ray tube displays (cathode ray tubedisplay, CR), light-emitting diode displays (light-emitting diode display, LED), electronic ink screens, liquid crystal displays (liquid crystal display, LCD), plasma display panels (plasma display panel, PDP), and the like. A user may utilize a display device on electronic device 101 to view displayed text, images, video, etc. The electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality ) device, an automobile, a data storage device, an audio playing device, a video playing device, a notebook, a desktop computing device, a wearable device such as an electronic watch, electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic article of clothing, etc.
In the electronic device shown in fig. 5, the processor 110 may be configured to invoke an application program stored in the memory 120, and specifically perform the following operations:
acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of a terminal, and determining a source code modification file corresponding to the single warehouse source code file;
and converting the source code modification file into an incremental system executable file aiming at the terminal, writing the incremental system executable file into the terminal, and updating a system class path of the terminal based on the incremental system executable file so as to control the terminal to load the incremental system executable file through a class loading mechanism when the terminal system is debugged.
In one embodiment, the processor 110 determines, when executing the compilation dependency package and the single-repository source code file corresponding to the target complete machine version of the acquisition terminal, a source code modification file corresponding to the single-repository source code file, and performs the following operations:
acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of a terminal from a compiling server;
and generating a source code modification file corresponding to the source code modification operation in response to the source code modification operation aiming at the single warehouse source code.
In one embodiment, before executing the compiling dependent package and the single repository source code file corresponding to the target full machine version of the obtaining terminal from the compiling server, the processor 110 further performs the following operations:
under a terminal complete machine compiling scene, controlling a compiling server to obtain a compiling dependent package corresponding to a target complete machine version from a system framework layer directory, and controlling the compiling server to determine a single warehouse source code file corresponding to the target complete machine version;
and storing the compiling dependent package and the single warehouse source code file corresponding to the target whole machine version through the compiling server.
In one embodiment, the processor 110, when executing the converting the source code modification file into an incremental system executable file for the terminal, performs the following operations:
and calling a target script to compile the source code modification file to obtain a target byte code file, and converting the target byte code file into an incremental system executable file aiming at the terminal.
In one embodiment, the processor 110, when executing the call target script, compiles the source code modification file to obtain a target bytecode file, performs the following operations:
And calling a target script to control a source code compiler to configure class path parameters aiming at compiling the dependency package, and performing incremental compiling on the source code modification file to obtain a target byte code file.
In one embodiment, the processor 110, upon performing the converting the target bytecode file into an incremental system executable file for the terminal, performs the following operations: and the control target execution program performs file type conversion on the target byte code file to obtain an initial incremental system executable file aiming at the terminal, and performs byte alignment processing on the initial incremental system executable file to obtain an incremental system executable file.
In one embodiment, the processor 110 performs the following operations when performing the writing of the incremental system executable file to the terminal and performing a system class path update on the terminal based on the incremental system executable file:
determining that the terminal is in a mountable state, and writing the incremental system executable file into an executable file path under a system framework layer directory of the terminal;
and determining a modification file type corresponding to the incremental system executable file, and modifying the system environment variable class path based on the modification file type.
In one embodiment, the processor 110, when executing the modification to the system environment variable class path based on the modification file type, performs the following operations:
if the modified file type is the guide type, determining a guide catalog path, and updating a guide loading statement sequence corresponding to the guide catalog path based on the increment system executable file;
and if the modified file type is the system service type, determining a system service category directory path, and updating a system service loading statement sequence corresponding to the system service category directory path based on the incremental system executable file.
In one or more embodiments of the present disclosure, a compiling dependency package and a single-repository source code file corresponding to a target complete machine version of a terminal are obtained, a source code modification file corresponding to the single-repository source code file is determined, the source code modification file is converted into an incremental system executable file for the terminal, the incremental system executable file is written into the terminal, and a system class path update is performed on the terminal based on the incremental system executable file, so that the terminal is controlled to load the incremental system executable file through a class loading mechanism when the terminal system is debugged, and thus, in the compiling and debugging process of the original complete machine system, the related framework layer code compiling and debugging process can be optimized, the source code environment is realized only by downloading the single-repository source code file, and the increment based on the single-repository source code file, so that the local storage space occupied by a development test terminal is greatly reduced, and the compiling and debugging speed of the development test terminal is improved.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.
The foregoing disclosure is only illustrative of the preferred embodiments of the present invention and is not to be construed as limiting the scope of the claims, which follow the meaning of the claims of the present invention.

Claims (11)

1. The compiling and debugging method is characterized by being applied to a development testing end, and comprises the following steps:
acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of a terminal, and determining a source code modification file corresponding to the single warehouse source code file;
and converting the source code modification file into an incremental system executable file aiming at the terminal, writing the incremental system executable file into the terminal, and updating a system class path of the terminal based on the incremental system executable file so as to control the terminal to load the incremental system executable file through a class loading mechanism when the terminal system is debugged.
2. The method according to claim 1, wherein the obtaining the compilation dependency package and the single-repository source code file corresponding to the target complete machine version of the terminal, determining the source code modification file corresponding to the single-repository source code file, includes:
acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of a terminal from a compiling server;
and generating a source code modification file corresponding to the source code modification operation in response to the source code modification operation aiming at the single warehouse source code.
3. The method according to claim 2, wherein before the compiling dependent package and the single repository source code file corresponding to the target full machine version of the terminal are obtained from the compiling server, the method further comprises:
under a terminal complete machine compiling scene, controlling a compiling server to obtain a compiling dependent package corresponding to a target complete machine version from a system framework layer directory, and controlling the compiling server to determine a single warehouse source code file corresponding to the target complete machine version;
and storing the compiling dependent package and the single warehouse source code file corresponding to the target whole machine version through the compiling server.
4. The method of claim 1, wherein the converting the source code modification file into an incremental system executable file for the terminal comprises:
And calling a target script to compile the source code modification file to obtain a target byte code file, and converting the target byte code file into an incremental system executable file aiming at the terminal.
5. The method of claim 4, wherein the invoking the target script compiles the source code modification file to obtain a target bytecode file, comprising:
and calling a target script to control a source code compiler to configure class path parameters aiming at compiling the dependency package, and performing incremental compiling on the source code modification file to obtain a target byte code file.
6. The method of claim 4, wherein the converting the target bytecode file into an incremental system executable file for the terminal comprises:
and the control target execution program performs file type conversion on the target byte code file to obtain an initial incremental system executable file aiming at the terminal, and performs byte alignment processing on the initial incremental system executable file to obtain an incremental system executable file.
7. The method of claim 1, wherein writing the incremental system executable file to the terminal and performing a system class path update for the terminal based on the incremental system executable file comprises:
Determining that the terminal is in a mountable state, and writing the incremental system executable file into an executable file path under a system framework layer directory of the terminal;
and determining a modification file type corresponding to the incremental system executable file, and modifying the system environment variable class path based on the modification file type.
8. The method of claim 7, wherein modifying the system environment variable class path based on the modified file type comprises:
if the modified file type is the guide type, determining a guide catalog path, and updating a guide loading statement sequence corresponding to the guide catalog path based on the increment system executable file;
and if the modified file type is the system service type, determining a system service category directory path, and updating a system service loading statement sequence corresponding to the system service category directory path based on the incremental system executable file.
9. A compile debugging device, the device comprising:
the file processing module is used for acquiring a compiling dependent package and a single warehouse source code file corresponding to a target whole machine version of the terminal and determining a source code modification file corresponding to the single warehouse source code file;
The compiling processing module is used for converting the source code modification file into an increment system executable file aiming at the terminal, writing the increment system executable file into the terminal, and updating a system class path of the terminal based on the increment system executable file so as to control the terminal to load the increment system executable file through a class loading mechanism when the terminal system is debugged.
10. A computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method steps of any one of claims 1 to 9.
11. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps of any of claims 1-9.
CN202311309447.2A 2023-10-10 2023-10-10 Compiling and debugging method and device, storage medium and electronic equipment Pending CN117349165A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311309447.2A CN117349165A (en) 2023-10-10 2023-10-10 Compiling and debugging method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311309447.2A CN117349165A (en) 2023-10-10 2023-10-10 Compiling and debugging method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117349165A true CN117349165A (en) 2024-01-05

Family

ID=89358907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311309447.2A Pending CN117349165A (en) 2023-10-10 2023-10-10 Compiling and debugging method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117349165A (en)

Similar Documents

Publication Publication Date Title
US9032390B2 (en) Framework versioning
Meier Professional Android 4 application development
CN109697060B (en) Video special effect system, generation method, device, equipment and storage medium thereof
CN102971688B (en) Cross-platform program frame
CN110531962B (en) Development processing method and device for applet and computer readable storage medium
Meier et al. Professional Android
CN111158818A (en) Page rendering method and device
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
CN111459586B (en) Remote assistance method, device, storage medium and terminal
CN111796820B (en) Method and device for constructing front-end page based on integrated assembly and electronic equipment
CN110874217A (en) Interface display method and device for fast application and storage medium
US7974829B2 (en) System for simulating mobile phone and method thereof
CN111338623A (en) Method, device, medium and electronic equipment for developing user interface
CN111857658A (en) Method, device, medium and electronic equipment for rendering dynamic component
CN110865863B (en) Interface display method and device for fast application and storage medium
CN112416303B (en) Software development kit hot repair method and device and electronic equipment
EP2590074A1 (en) System for inserting services in a software application
CN110851370B (en) Program testing method and device and storage medium
CN112988175A (en) Cross-platform application installation package generation method, device, medium and electronic equipment
CN110442419B (en) Interface layout method and device for Android application
CN110618811A (en) Information presentation method and device
CN114547604A (en) Application detection method and device, storage medium and electronic equipment
WO2022078057A1 (en) Method and apparatus for publishing application package, method and apparatus for applying application package, and medium, server and device
CN111338961B (en) Application debugging method and device, electronic equipment and storage medium
CN117349165A (en) Compiling and debugging method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination