CN111880802A - Compiling method, electronic equipment and computer readable storage medium - Google Patents

Compiling method, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN111880802A
CN111880802A CN202010636997.5A CN202010636997A CN111880802A CN 111880802 A CN111880802 A CN 111880802A CN 202010636997 A CN202010636997 A CN 202010636997A CN 111880802 A CN111880802 A CN 111880802A
Authority
CN
China
Prior art keywords
compiling
source file
information
environment information
file
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.)
Withdrawn
Application number
CN202010636997.5A
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
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co 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, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010636997.5A priority Critical patent/CN111880802A/en
Publication of CN111880802A publication Critical patent/CN111880802A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

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

Abstract

The application discloses a compiling method, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: acquiring a source file, and a compiling command and compiling environment information based on the source file; sending the source file, the compiling command and the compiling environment information to first compiling equipment so that the first compiling equipment compiles the source file based on the compiling command and the compiling environment information and obtains a compiling result; and receiving a compiling result returned by the first compiling device. Through the mode, the resource of the local compiling equipment can be saved.

Description

Compiling method, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a compiling method, an electronic device, and a computer-readable storage medium.
Background
At present, a compiler compiles a source file is a time-consuming process, and particularly, after C + + language compilation optimization is poor, language writing methods are improper, or a user imports a large number of header files, the compilation time of a single source file may reach 5 minutes or even longer. Therefore, the situation that the code is modified once and compiled for half an hour may be encountered in the development process, which not only causes the waste of local compiling equipment resources, but also affects the development efficiency.
Disclosure of Invention
A first aspect of an embodiment of the present application provides a compiling method, where the method includes: acquiring a source file, and a compiling command and compiling environment information based on the source file; sending the source file, the compiling command and the compiling environment information to first compiling equipment so that the first compiling equipment compiles the source file based on the compiling command and the compiling environment information and obtains a compiling result; and receiving a compiling result returned by the first compiling device.
A second aspect of the embodiments of the present application provides a compiling method, including: receiving a source file sent by a second compiling device, and a compiling command and compiling environment information based on the source file; creating a compiling environment of the source file according to the compiling environment information; compiling the source file according to the compiling command in a compiling environment, and obtaining a compiling result; and returning the compiling result to the second compiling device.
A third aspect of the embodiments of the present application provides an electronic device, which includes a processor and a memory connected to the processor, where the memory is used to store program data, and the processor is used to execute the program data to implement the foregoing remote compiling method.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, in which program data is stored, and when the program data is executed by a processor, the program data is used to implement the foregoing remote compiling method.
The beneficial effect of this application is: different from the prior art, the method sends the source file, the compiling command and the compiling environment information to the first compiling device by acquiring the source file, the compiling command and the compiling environment information based on the source file, so that the first compiling device compiles the source file based on the compiling command and the compiling environment information, obtains the compiling result, receives the compiling result returned by the first compiling device, and realizes the remote compiling of the source file, wherein, the accuracy of the remote compiling of the source file can be improved by unifying the compiling environment of the first compiling device and the compiling environment of the second compiling device, in addition, the source file can be remotely compiled by the first compiling device without occupying the resource of the second compiling device, thereby saving the resource of the second compiling device, and further enabling a user to continue to use the second compiling device for development, the development efficiency is greatly improved.
Drawings
In order to more clearly illustrate the technical solutions in the present application, the drawings required in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings described below are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive labor. Wherein:
FIG. 1 is a flow chart of a first embodiment of the compiling method of the present application;
FIG. 2 is a flowchart illustrating a second embodiment of the compiling method of the present application;
FIG. 3 is a flow chart of a third embodiment of the compiling method of the application;
FIG. 4 is a flowchart illustrating a fourth embodiment of the compiling method of the present application;
FIG. 5 is a flow chart of a fifth embodiment of the compiling method of the application;
FIG. 6 is a schematic flow chart illustrating step S52 in FIG. 5 according to another embodiment of the present application;
FIG. 7 is a flowchart illustrating a sixth embodiment of the compiling method of the present application;
FIG. 8 is a schematic diagram of interaction between a first compiling device and a second compiling device according to the present application;
FIG. 9 is a block diagram of an embodiment of an electronic device of the present application;
FIG. 10 is a block diagram of an embodiment of a computer storage medium according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first" and "second" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
At present, the compiling of the source file is completed by a local compiling device (i.e. a second compiling device), and if the compiling time of the second compiling device is too long, the device resource is wasted, and the development efficiency is also affected.
The compiling system at least comprises a first compiling device and a second compiling device, and the first compiling device and the second compiling device are in communication connection. The first compiling device and the second compiling device are both called compiling devices, and the difference is that the second compiling device is a device for generating a source file, the second compiling device can compile the source file, and can also send the source file to the first compiling device for compiling, and the first compiling device is a device for compiling the source file sent by the second compiling device. A source file generally refers to the result of a document in which code written in assembly or high level language is saved. Compilation generally refers to the process of compiling a source file into a target file (binary intermediate file) by a compiler. The compiler is installed on the compiling device, and the compiler is a program for compiling a source file into a target file. Correspondingly, a second compiler is arranged on the second compiling device, and a first compiler is arranged on the first compiling device.
The compiling device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, a server, and the like. Alternatively, the first compiling device may be a device with stronger processing capability, such as a server or the like, and the second compiling device may be a device with weaker processing capability, such as a mobile terminal or the like.
In this embodiment, the execution subject of the compiling method may be a second compiling device, and the method may include the following steps:
step S11: the method comprises the steps of obtaining a source file, and compiling commands and compiling environment information based on the source file.
Step S12: and sending the source file, the compiling command and the compiling environment information to the first compiling device, so that the first compiling device compiles the source file based on the compiling command and the compiling environment information and obtains a compiling result.
Step S13: and receiving a compiling result returned by the first compiling device.
Specifically, the second compiling device acquires the source file, and the compiling command and the compiling environment information based on the source file, and sends the source file, the compiling command and the compiling environment information to the first compiling device, so that the first compiling device compiles the source file based on the compiling command and the compiling environment information, and obtains a compiling result. Wherein the compiling result at least comprises a target file.
Generally, the target file can be uniquely determined according to the compiling environment of the source file and the source file, so that the target file obtained by compiling the first compiling device according to the source file, the compiling command based on the source file and the compiling environment information is the same as the target file obtained by compiling the second compiling device according to the source file, the compiling command based on the source file and the compiling environment information, thereby realizing remote compiling of the source file and improving the compiling accuracy of the source file. In other words, the source file and the compiling environment of the source file can determine that the target file compiled by the source file on other systems (such as CentOS6.5) equivalent to the system on the second compiling device is unique, so that the compiling environment information can be transmitted to any other first compiling device meeting the compiling conditions (for example, the version of the compiler is the same, and the version of GLIBC is the same) by using a network transmission mode, and the source file is compiled by the first compiling device.
Wherein the compiling environment information is not limited to include at least one of option information, header information, compiler information, and system information. The Option information may include compilation options such as general Option Overall Option, Language Option, Directory Option, and the like. The header file information may include a header file, which is a carrier file containing function functions and data interface declarations and is mainly used for storing declarations of programs. Wherein the header file in the C + +/C program is suffixed with ". h", such as graphics. In general, tens or hundreds of header files, or even more header files, may be included in one source file. The compiler information may include the kind of compiler, the version of the compiler, and the like. The types of compilers are not limited to include Microsoft Visual Studio, Dev-C + +, C + + Builder, Emacs + GCC, Eclipse + CDT, and Clang. The version of the compiler is, for example, version 1.0, version 2.0, and so on. The system information may include the kind of system, the version of the system, and the like. The types of systems are not limited to including batch systems (MVX, DOS/VSE), time-sharing systems (WINDOWS, UNIX, XENIX, Mac OS), real-time systems (iEMX, VRTX, RTOS, RT Linux). Versions of the system are, for example, version 1.0, version 2.0, and so on.
Optionally, after receiving the compiling result returned by the first compiling device, the second compiling device may further store the compiling result. Optionally, the second compiling device may store the compiling result locally, or may also store the compiling result in a server, so as to save storage resources of the second compiling device.
In this embodiment, by acquiring the source file, and the compiling command and the compiling environment information based on the source file, the compiling command and the compiling environment information are sent to the first compiling device, so that the first compiling device can compile the source file based on the compiling command and the compiling environment information, compiling the source file to obtain a compiling result, receiving the compiling result returned by the first compiling device, realizing remote compiling of the source file, wherein, by unifying the compiling environment of the first compiling device and the compiling environment of the second compiling device, can improve the accuracy of remote compilation of the source file, and moreover, the source file can be compiled remotely through the first compiling device without occupying the resources of the second compiling device, thereby saving the resources of the second compiling device, and then the user can continue to use the second compiling device for development, and the development efficiency is greatly improved.
For example, the steps of obtaining the source file, and the compiling command and the compiling environment information based on the source file are executed by obtaining the compiling command of the source file, and the specific description refers to the following embodiments.
Referring to fig. 2, fig. 2 is a flowchart illustrating a compiling method according to a second embodiment of the present application. In this embodiment, the execution subject of the compiling method may be the second compiling device.
In this embodiment, the step S11 may further include sub-steps S211, S212, and S213:
step S211: and acquiring a compiling command of the source file.
Generally, the compilation commands of different compilers are different, for example, one compilation command of the GCC compiler is gcchello. In an application environment, when a user needs to compile a source file, the user inputs a compilation command, such as gcchello.c, on an operation interface and returns to start compiling the source file, and at the moment, a device responds to the instruction of the user, captures the compilation command of the source file and acquires compilation environment information of the source file according to the compilation command.
In some embodiments, before step S211, the command may be split based on a command capture mechanism, and then the compiling commands of the single source files are respectively obtained, so as to complete the decomposition of the multi-file compiling command into the single-file compiling, so as to implement the remote compiling and the problem of not repeating the compiling (caching) in the case of multi-file compiling. The plurality of split source files can be compiled by the same or different first compiling devices at the same time, wherein when the first compiling device is provided with a plurality of compilers, the plurality of source files can be compiled by the same first compiling device at the same time, and in addition, the plurality of split source files can also be compiled by the same or different first compiling devices according to a preset sequence, and the configuration can be specifically set according to the actual situation, and is not limited herein. The preset order is, for example, a sequence of inputting the compiling command, or priorities of a plurality of compiling commands may be preset, and optionally, the higher the priority of the compiling command corresponding to the important source file or the urgent source file is, the faster the compiling is performed.
Step S212: and acquiring option information, compiler information and system information according to the compiling command.
Optionally, after obtaining the compilation command of the source file, the second compilation device may obtain at least one of option information, compiler information, and system information corresponding to the source file according to the compilation command. The acquisition sequence of the option information, the compiler information and the system information is not limited, and the option information, the compiler information and the system information can be acquired step by step or simultaneously.
Step S213: and acquiring header file information according to the option information.
When the compiling environment information includes the option information, the header information may be further acquired according to the option information. Specifically, the header information may be acquired according to specific option information. For example, the header file may be obtained according to a directory option.
In some embodiments, the header information may include a Glibc standard file, a compiler standard file, an external library (e.g., OpenSSL) file, and a project header file. Where the Glibc and compiler header files are fixed in location and can be collected by examining the user system, while the external library and project header files can be obtained by analyzing the content of the source file.
In some embodiments, the compiler may set a system root option, if the compiler sets the system root option, the header information needs to be acquired at a position corresponding to the system root option, otherwise, the header information may be directly acquired from a default position of the system. Specifically, it may be determined whether a system root option exists, and if the system root option exists, header file information is collected in the root directory according to the option information, and if the system root option does not exist, header file information is collected in a default system directory according to the option information.
In this embodiment, by obtaining the compiling command of the source file, all compiling environment information of the source file, including option information, compiler information, system information, and header file information, can be obtained on a system level, and by judging whether the system root option exists, header file information is collected in a correct directory, so that the accuracy of header file information collection can be improved, and the accuracy of source file compiling can be improved.
Referring to fig. 3, fig. 3 is a flowchart illustrating a compiling method according to a third embodiment of the present application. In this embodiment, the execution subject of the compiling method may be the second compiling device.
Steps S34 and S35 may be further included before the above step S11:
step S34: compiling environment information of a plurality of remote compiling devices is acquired.
Step S35: and determining one of the plurality of remote compiling devices as a first compiling device according to the compiling environment information of the source file and the compiling environment information of the plurality of remote compiling devices.
Generally, the second compiling device may establish communication with a plurality of remote compiling devices, so that compiling environment information of the plurality of remote compiling devices may be acquired. It can be understood that the second compiling device obtains the compiling environment information of the plurality of remote compiling devices, and the remote compiling devices are not necessarily required to send the compiling environment information to the second compiling device. Alternatively, the second compiling device may display compiling environment information of a plurality of remote devices, and the user may compare the compiling environment information of the source file with the compiling environment information of the plurality of remote compiling devices and select one of the plurality of remote compiling devices as the first compiling device. The user may use a device with less resource usage as the first compiling device according to the current resource usage of the remote device, or may preliminarily determine, according to the compiler version information, the system information, and the resource usage, the remote compiling device that is the same as the version information of the second compiler and the system information of the second compiling device as the first compiling device, and further determine the first compiling device according to the resource usage, where the compiler on the first compiling device is the first compiler. In another embodiment, the determining one of the plurality of remote compiling devices as the first compiling device according to the compiling environment information of the source file and the compiling environment information of the plurality of remote compiling devices may also be performed automatically by the device.
In this embodiment, one of the plurality of remote compiling devices is determined as the first compiling device according to the compiling environment information of the source file and the compiling environment information of the plurality of remote compiling devices, and the remote compiling device with similar compiling environment information can be used as the first compiling device of the source file, so that only the different compiling environment information of the second compiling device and the first compiling device needs to be sent to the first compiling device, the content of sending the compiling environment information is reduced, and the flow steps of the first compiling device for creating the compiling environment according to the reduced compiling environment are also reduced.
Correspondingly, the above step S11 may further include sub-steps S311, S312, and S313:
step S311: when a compilation command based on a source file is acquired, compilation environment information of the source file is acquired.
For the description of this step, reference may be made to the description of step S11 in the above embodiment, and details are not described here.
Step S312: and comparing the compiling environment information of the first compiling device with the compiling environment information of the source file to obtain the different compiling environment information.
The different compiling environment information is compiling environment information different from the compiling environment information of the first compiling device in the compiling environment information of the source file. For example, the compilation environment information of the source file only includes header file information, where the header file information includes 10 different header files, the header file information in the compilation environment information of the first compilation device includes 10 different header files, and the 10 header files of the source file are compared with the 10 header files of the first compilation device to obtain the distinct compilation environment information in which 7 header files are the same and 3 header files are different, and then the 3 header files are the source file.
Step S313: and collecting the information of the different compiling environments as the compiling environment information of the source file.
In this embodiment, the compiling environment information of the first compiling device is compared with the compiling environment information of the source file to obtain the difference compiling environment information, and the difference compiling environment information is used as the compiling environment information of the source file to collect the information, so that the local and remote data transmission amount can be reduced, and the data transmission efficiency can be improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a compiling method according to a fourth embodiment of the present application.
In this embodiment, an execution subject of the compiling method is a first compiling device, and the method may include the following steps:
step S41: and receiving a source file sent by the second compiling device, and a compiling command and compiling environment information based on the source file.
Step S42: and creating a compiling environment of the source file according to the compiling environment information.
Step S43: and compiling the source file according to the compiling command in a compiling environment, and obtaining a compiling result.
Step S44: and returning the compiling result to the second compiling device.
Specifically, the first compiling device communicates with the second compiling device to receive the source file sent by the second compiling device, the compiling command and the compiling environment information based on the source file, create a compiling environment of the source file according to the compiling environment information, compile the source file according to the compiling command in the compiling environment, obtain a compiling result, and return the compiling result to the second compiling device.
Alternatively, the first compiling device may store the compiling result of the source file locally after obtaining the compiling result, or send the compiling result to the server to be stored by the server in a unified manner.
In this embodiment, the first compiling device creates a compiling environment of the source file according to the compiling environment information, so that an environment in which the source file is compiled in the first compiling device is the same as an environment in which the source file is compiled in the second compiling device, so that the source file can be compiled on the first compiling device to obtain a target file which is the same as that compiled by the second compiling device, the compiling accuracy can be improved, remote compiling of the source file can be achieved without preprocessing the source file, and remote compiling of the source file by copying an equivalent operating system is avoided.
Referring to fig. 5 to 6, fig. 5 is a flowchart illustrating a fifth embodiment of the compiling method of the present application, and fig. 6 is a flowchart illustrating step S52 in fig. 5 of the present application in another embodiment.
In this embodiment, the execution subject of the compiling method is the first compiling device. Unlike the fourth embodiment of the compiling method, the above step S41 may be preceded by steps S55 and S56, and specifically, the method may include the steps of:
step S51: and receiving a source file sent by the second compiling device, and a compiling command and compiling environment information based on the source file.
The second compiling device may be a second compiling device in the remote compiling system, and for the description of the step and the steps S52, S53, and S54, reference may be made to the description of the corresponding position in the above embodiment, which is not described again in this embodiment.
Step S55: and calculating the target hash value of the corresponding target file according to the source file and the compiling environment information.
The source file and the compiling environment information can uniquely determine the target file, so that the target hash value of the corresponding target file can be calculated according to the source file and the compiling environment information, and whether the target file exists or not can be judged according to the target hash value.
Specifically, the first compiling device calculates the source file and the compiling environment information through a hash algorithm to obtain a target hash value of the corresponding target file. The hash algorithm may convert a data into a flag that is closely related to each byte of the source data. The source data is a source file and compiling environment information, and the mark is a hash value. Hash functions commonly used in hash algorithms include MD4, MD5, SHA-1, and so on.
Alternatively, when header information is included in the compilation environment information, a target hash value may be calculated from the header digest, i.e., the hash value of the header file, with the source file and other compilation environment information.
Step S56: and judging whether the target file exists according to the target hash value.
If the target file does not exist, step S52 is executed.
If the target file exists, step S54 is executed.
The first compiling device judges whether a target file exists according to the target hash value, specifically, the first compiling device can search whether the target file corresponding to the target hash value exists at a preset position according to the target hash value, if the target file is not found, the source file is not compiled in the compiling environment, compiling is required, if the target file is found, the source file is compiled in the compiling environment, the corresponding target file can be directly obtained according to the target hash value and returned to the second compiling device, and therefore repeated compiling of the source file can be avoided, system resources can be saved, and development efficiency is improved. The preset location may be any storage space, such as a local storage space of the server or the target storage device.
Optionally, the target file may be stored in a preset location according to the source file, the compiling environment information based on the source file, and the compiling result obtained by compiling, that is, the target file, so that the target file may be found subsequently according to the source file and the compiling environment information, thereby updating the target file library.
In some embodiments, steps S55 and S56 may also be performed by the second compiling device.
Step S52: and creating a compiling environment of the source file according to the compiling environment information.
In some embodiments, as shown in fig. 6, step S52 may further include sub-steps S521, S522, S523:
step S521: and selecting a system root path according to the compiling environment information.
Step S522: path information and header information of the source file are generated.
Step S523: and adding or updating a system root option and directing the path information to a system root path.
Specifically, the first compiling device may select a system root path according to compiler information in the compiling environment information, and then generate path information and a header file of the source file according to option information and header file information in the compiling environment information. The path information of the source file may be storage path information of the source file. The header file information includes all data required for generating the header file, so that the header file can be directly generated according to the header file information.
When a system root option is set in a second compiler corresponding to the source file, the system root option of the first compiler needs to be added or updated, and the path information of the source file is pointed to the system root path. If the first compiler does not have the system root option in the compiling environment information corresponding to the source file, the corresponding system root option needs to be added, and further, if the system root option of the first compiler is different from the system root option corresponding to the source file, the system root option needs to be updated so that the system root options of the first compiler and the second compiler corresponding to the source file are consistent. When the second compiler corresponding to the source file does not set the system root option, the system root option existing in the first compiler may be deleted. It is understood that when neither the first compiler nor the second compiler sets the system root option, step S523 may be omitted, and the path information of the source file is directly directed to the default path of the system.
Step S53: and compiling the source file according to the compiling command in a compiling environment, and obtaining a compiling result.
Step S54: and returning the compiling result to the second compiling device.
In some embodiments, multiple compiling devices may be deployed into a unified compiling environment, for example, a compiler, a header file, a dependency library, and the like are unified, so that compiling environment information of a source file can be found in a first compiling device, and the source file can be directly sent to the first compiling device for compiling.
In the embodiment, the target file can be compiled to achieve multi-user sharing through remote compiling, meanwhile, the CPU cost caused by repeated compiling is greatly reduced, and then, the local compiling process is transferred to the remote compiling without increasing more cost, such as reconstructing a unified compiling environment, preprocessing a source file and the like, so that the cost can be saved.
Referring to fig. 7 to 8, fig. 7 is a flowchart illustrating a sixth embodiment of a compiling method of the present application, and fig. 8 is an interaction diagram illustrating a first compiling device and a second compiling device of the present application. In this embodiment, the method may include the steps of:
step S61: the second compiling apparatus acquires the source file, and a compiling command and compiling environment information based on the source file.
Step S62: the second compiling device sends the source file, the compiling command and the compiling environment information to the first compiling device.
Step S63: the first compiling device receives a source file sent by the second compiling device, and a compiling command and compiling environment information based on the source file.
Step S64: and the first compiling device calculates the target hash value of the target file corresponding to the compiling environment information according to the compiling environment information.
Step S65: and the first compiling device judges whether the target file exists according to the target hash value.
Step S66: the first compiling device creates a compiling environment of the source file based on the compiling environment information.
Step S67: and compiling the source file according to the compiling command by the first compiling device under the compiling environment, and obtaining a compiling result.
Step S68: and the first compiling device returns the compiling result to the second compiling device.
Step S69: and the second compiling device receives the compiling result returned by the first compiling device.
In this embodiment, the compiling method of the present application is entirely explained from a multi-end perspective, and for the explanation of the above steps, reference is made to the explanation in the foregoing embodiment, and details are not described here again.
Referring to fig. 9, fig. 9 is a schematic diagram of a frame of an embodiment of an electronic device according to the present application. The electronic device 100 includes: the electronic device comprises a processor and a memory connected to the processor, the memory being adapted to store program data, the processor being adapted to execute the program data to implement the steps of any of the above-described method embodiments.
In particular, the processor 110 is configured to control itself and the memory 120 to implement the steps in any of the above-described embodiments of the blood flow parameter detection method. Processor 110 may also be referred to as a CPU (Central Processing Unit). The processor 110 may be an integrated circuit chip having signal processing capabilities. The Processor 110 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, processor 110 may be commonly implemented by multiple integrated circuit chips.
Referring to fig. 10, fig. 10 is a block diagram of a computer storage medium according to an embodiment of the present invention. The computer readable storage medium 200 stores program data 210, and the program data 210 is used for implementing the steps of any of the above method embodiments when executed by a processor.
The computer-readable storage medium 200 may be a medium that can store a computer program, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the computer program, and the server can send the stored computer program to another device for running or can run the stored computer program by itself.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present application.

Claims (12)

1. A method of compiling, the method comprising:
acquiring a source file, and a compiling command and compiling environment information based on the source file;
sending the source file, the compiling command and the compiling environment information to first compiling equipment so that the first compiling equipment compiles the source file based on the compiling command and the compiling environment information and obtains a compiling result;
and receiving the compiling result returned by the first compiling device.
2. The method of claim 1,
the compiling environment information comprises at least one of option information, header information, compiler information and system information.
3. The method of claim 2,
the obtaining of the source file, and the compiling command and the compiling environment information based on the source file include:
acquiring a compiling command of the source file;
acquiring option information, compiler information and system information according to the compiling command;
and acquiring header file information according to the option information.
4. The method of claim 3,
the collecting header file information according to the option information includes:
judging whether a system root option exists;
if the system root option exists, header file information is collected under the root directory.
5. The method of claim 1,
before sending the source file, the compiling command and the compiling environment information to the first compiling device, the method further includes:
acquiring compiling environment information of a plurality of remote compiling devices;
determining one of the plurality of remote compiling devices as the first compiling device according to the compiling environment information of the source file and the compiling environment information of the plurality of remote compiling devices.
6. The method of claim 5,
the obtaining of the source file, and the compiling command and the compiling environment information based on the source file include:
when a compiling command based on a source file is acquired, acquiring compiling environment information of the source file;
comparing the compiling environment information of the first compiling device with the compiling environment information of the source file to obtain different compiling environment information;
and collecting the different compiling environment information as the compiling environment information of the source file.
7. The method of claim 1,
after receiving the compiling result returned by the first compiling device, the method further includes:
and storing the compiling result.
8. A method of compiling, the method comprising:
receiving a source file sent by a second compiling device, and a compiling command and compiling environment information based on the source file;
creating a compiling environment of the source file according to the compiling environment information;
compiling the source file according to the compiling command in the compiling environment to obtain a compiling result;
and returning the compiling result to the second compiling device.
9. The method of claim 8,
the creating of the compilation environment of the source file according to the compilation environment information includes:
selecting a system root path according to the compiling environment information;
generating path information and header information of the source file;
adding or updating a system root option and directing the path information to the system root path.
10. The method according to any one of claims 8 or 9,
before the creating the compilation environment of the source file according to the compilation environment information, the method further includes:
calculating a target hash value of a target file corresponding to the compiling environment information according to the source file and the compiling environment information;
judging whether the target file exists according to the target hash value;
and if the target file does not exist, executing the compiling environment for creating the source file according to the compiling environment information.
11. An electronic device, comprising a processor and a memory coupled to the processor,
the memory is for storing program data, and the processor is for executing the program data to implement the remote compilation method of any of claims 1-10.
12. A computer-readable storage medium, in which program data are stored, which program data, when executed by a processor, are adapted to implement a remote compilation method according to any one of claims 1 to 10.
CN202010636997.5A 2020-07-03 2020-07-03 Compiling method, electronic equipment and computer readable storage medium Withdrawn CN111880802A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010636997.5A CN111880802A (en) 2020-07-03 2020-07-03 Compiling method, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010636997.5A CN111880802A (en) 2020-07-03 2020-07-03 Compiling method, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111880802A true CN111880802A (en) 2020-11-03

Family

ID=73149870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010636997.5A Withdrawn CN111880802A (en) 2020-07-03 2020-07-03 Compiling method, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111880802A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721916A (en) * 2021-07-29 2021-11-30 苏州浪潮智能科技有限公司 Compiling method, device and equipment of operating system and readable storage medium
CN115314536A (en) * 2022-08-03 2022-11-08 平安付科技服务有限公司 Method and device for remotely executing command, storage medium and computer equipment
CN115495093A (en) * 2022-11-07 2022-12-20 深圳鲲云信息科技有限公司 Hybrid compiling method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068855A (en) * 2015-08-19 2015-11-18 北京奇虎科技有限公司 Method, server and system for compiling android package development files
CN106095522A (en) * 2016-06-03 2016-11-09 北京奇虎科技有限公司 A kind of method realizing distributed compilation and distributed compilation system
CN107943486A (en) * 2017-12-19 2018-04-20 北京星河星云信息技术有限公司 A kind of multilingual code compiling method, distribution method, device and system
CN108121543A (en) * 2017-11-30 2018-06-05 北京奇安信科技有限公司 A kind of software code process of compilation method and device
CN109976748A (en) * 2019-02-28 2019-07-05 南京南瑞继保电气有限公司 A kind of program processing method, terminal, server and computer storage medium
US20190354271A1 (en) * 2018-05-18 2019-11-21 Nrg Holdings, Llc Transducer programmer
CN110955431A (en) * 2018-09-27 2020-04-03 北京国双科技有限公司 Processing method and device of compiling environment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068855A (en) * 2015-08-19 2015-11-18 北京奇虎科技有限公司 Method, server and system for compiling android package development files
CN106095522A (en) * 2016-06-03 2016-11-09 北京奇虎科技有限公司 A kind of method realizing distributed compilation and distributed compilation system
CN108121543A (en) * 2017-11-30 2018-06-05 北京奇安信科技有限公司 A kind of software code process of compilation method and device
CN107943486A (en) * 2017-12-19 2018-04-20 北京星河星云信息技术有限公司 A kind of multilingual code compiling method, distribution method, device and system
US20190354271A1 (en) * 2018-05-18 2019-11-21 Nrg Holdings, Llc Transducer programmer
CN110955431A (en) * 2018-09-27 2020-04-03 北京国双科技有限公司 Processing method and device of compiling environment
CN109976748A (en) * 2019-02-28 2019-07-05 南京南瑞继保电气有限公司 A kind of program processing method, terminal, server and computer storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113721916A (en) * 2021-07-29 2021-11-30 苏州浪潮智能科技有限公司 Compiling method, device and equipment of operating system and readable storage medium
CN113721916B (en) * 2021-07-29 2023-07-14 苏州浪潮智能科技有限公司 Compiling method, device and equipment of operating system and readable storage medium
CN115314536A (en) * 2022-08-03 2022-11-08 平安付科技服务有限公司 Method and device for remotely executing command, storage medium and computer equipment
CN115314536B (en) * 2022-08-03 2024-02-02 平安付科技服务有限公司 Remote command execution method and device, storage medium and computer equipment
CN115495093A (en) * 2022-11-07 2022-12-20 深圳鲲云信息科技有限公司 Hybrid compiling method and device, electronic equipment and storage medium
CN115495093B (en) * 2022-11-07 2023-07-21 深圳鲲云信息科技有限公司 Hybrid compiling method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111880802A (en) Compiling method, electronic equipment and computer readable storage medium
CN106325847B (en) Method and device for acquiring application program function based on iOS platform
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
CN111913741B (en) Object interception method, device, medium and electronic equipment
CN109492181B (en) Page jump method, device, computer equipment and storage medium
CN114398086B (en) Drive configuration management method, device, medium, equipment and system
US9753791B2 (en) Analytics data collection with low integration cost for dynamic message passing systems
CN106502717B (en) Application program running method and device
CN114610640B (en) Fuzzy test method and system for trusted execution environment of Internet of things
KR20050024827A (en) Apparatus and Method for Developing Application on Target System in Embedded Software Development Environment
CN112527386A (en) Application program issuing method and device
CN108845864B (en) Spring frame-based JVM garbage recycling method and device
CN112965721B (en) Project compiling method and device based on Android, computer equipment and storage medium
EP3396536A1 (en) Application program running method and apparatus
CN111552480B (en) Cross-platform compiling method, device, equipment and readable storage medium
CN113360156A (en) IOS compiling method and related equipment
CN113971019B (en) Data type creation method, device, server and medium
CN113590179B (en) Plug-in detection method and device, electronic equipment and storage medium
CN115705294B (en) Method, device, electronic equipment and medium for acquiring function call information
CN113391809A (en) Static resource file processing method and device, electronic equipment and storage medium
CN114116022A (en) Drive configuration management method, device, medium, equipment and system
CN112486497A (en) Compiling configuration file generation method and device, electronic equipment and storage medium
CN117492831B (en) Byte code instruction sequence analysis method, device, electronic equipment and storage medium
CN114625369B (en) Method, device, medium and electronic equipment for collecting C/S client software data
CN117707918B (en) Concurrent defect detection method, test equipment and storage medium

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20201103