CN110737438A - data processing method and device - Google Patents

data processing method and device Download PDF

Info

Publication number
CN110737438A
CN110737438A CN201910228754.5A CN201910228754A CN110737438A CN 110737438 A CN110737438 A CN 110737438A CN 201910228754 A CN201910228754 A CN 201910228754A CN 110737438 A CN110737438 A CN 110737438A
Authority
CN
China
Prior art keywords
file
module
target
development
modules
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
CN201910228754.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.)
Beijing Ingenic Semiconductor Co Ltd
Original Assignee
Beijing Ingenic Semiconductor 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 Beijing Ingenic Semiconductor Co Ltd filed Critical Beijing Ingenic Semiconductor Co Ltd
Publication of CN110737438A publication Critical patent/CN110737438A/en
Pending 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
    • G06F8/43Checking; Contextual analysis
    • G06F8/433Dependency analysis; Data or control flow analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Abstract

The invention provides data processing methods and devices, wherein the method comprises the steps of traversing development files of all modules of a target project, analyzing a target file of each module from the development files, generating a rule of the target file and compiling files depended by the modules, using the target files of all modules as a file set depended by the target project, determining whether a file required by current compiling exists in the file set when the target project is compiled, and if not, generating the file.

Description

data processing method and device
Technical Field
The invention relates to the technical field of computers, in particular to data processing methods and devices.
Background
In order to achieve the correct and orderly compilation of code, the generally requires Makefile organization compilation, wherein Makefile defines series of rules to specify which files need to be compiled first, which files need to be compiled later, which files need to be recompiled, or other more complex operations.
These two dependencies are explained below:
1) dependence on running:
for example, the A module is compiled to generate an a program, the B module is compiled to generate a B program, and the compiling processes of the A module and the B module are not dependent on each other, but the a program runs by requiring the B program to create certain environments in advance, and if the B program does not create the environments in advance, the a program can be mistaken or cannot be executed in the running process.
2) Dependencies in compilation:
this dependency condition mostly occurs in the dependency between the running program and the library, and two modules A, B are still taken as an example: some functions in the module a are implemented in the module B, that is, the module a needs to link the target file compiled by the module B when compiling and linking, so as to find the implementation of all functions.
However, in the actual implementation, because some projects are huge and often use libraries or programs of third parties, the programs of the third parties often have dependency relationship of , in order to solve the dependency problem in the compilation, two sets of systems are often needed to be used simultaneously, the dependency problem between modules is solved through a system similar to menuconfig, and the problem of the compilation is solved through Makefile.
Aiming at the problem that two sets of systems are needed, an effective solution is not provided at present.
Disclosure of Invention
The embodiment of the invention provides data processing methods, so as to achieve the purpose of simply and efficiently solving the dependency problem among modules, and the method comprises the following steps:
traversing development files of all modules of the target project;
analyzing the target file of each module, generating the rule of the target file and compiling the file on which the module depends from the development file;
taking the target files of all modules as a file set on which the target project depends;
when the target engineering compilation is executed, whether a file required by the current compilation exists in the file set is determined, and if the file does not exist, the file is generated.
In embodiments, generating the file includes generating the file according to a pre-stored generation rule corresponding to the file.
In embodiments, the module and development file are corresponding relationships.
In embodiments, the development file carries identification information for identifying the corresponding module.
In embodiments, the development file is a.mk suffixed file.
The embodiment of the present invention further provides data processing apparatuses, so as to achieve the purpose of simply and efficiently solving the problem of dependency between modules, where the apparatus includes:
the traversal module is used for traversing the development files of all modules of the target project;
the analysis module is used for analyzing the target file of each module from the development file, generating the rule of the target file and compiling the file depended by the module;
the collection module is used for taking the target files of all the modules as a file collection which is depended by the target project;
and the generating module is used for determining whether a file required by current compilation exists in the file set when the target project compilation is executed, and generating the file if the file does not exist.
In embodiments, the generating module is specifically configured to generate the file according to a pre-stored generation rule corresponding to the file.
In embodiments, the module and development file are corresponding relationships.
In embodiments, the development file carries identification information for identifying the corresponding module.
In embodiments, the development file is a.mk suffixed file.
In the embodiment of the invention, the target file of each module is obtained by traversing the development files of all modules of the target project to form a file set which is depended by the target project, so that when the target project is compiled, if the files required by the current compilation are found not in the file set, the files are generated according to rules. The technical problem that two systems are required to participate in the operation to cause too complex operation in order to solve the dependency problem in the compiling process in the prior art is solved through the mode, and the technical effect that the dependency problem among the modules can be simply and efficiently solved is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and constitute a part of this application and not limiting of the invention, are illustrated in the accompanying drawings, in which:
FIG. 1 is a method flow diagram of a data processing method according to an embodiment of the invention;
fig. 2 is a block diagram of a data processing apparatus according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further with reference to the following embodiments and accompanying drawings.
Aiming at the dependency problem in the existing compiling process, the method can be realized by the following steps:
1) dependence on running:
for this case, describes the dependency relationship in Kconfig to ensure that when Makefile is used to compile and generate a program, B program will be generated.
The method comprises the steps that a Kconfig file is a configuration interface presented by Menuconfig, and is presented by reading the Kconfig file, the Kconfig can describe and express the dependency relationship among modules through syntax description, so that the Menuconfig presents the dependency relationship among the modules when the interface is presented, the Menuconfig is menu type configuration, and when a plurality of modules exist in projects, the Menuconfig can select which files are compiled and which files are not compiled in cooperation with Makefile configuration.
2) Dependencies in compilation:
in order to solve the dependency relationship, a config.in (similar to Kconfig in function) is introduced into the buildrop, and the dependency relationship is clarified in the interface description, so that the dependent module is compiled preferentially in the compiling process, that is, the B module in the above example is compiled preferentially, and when the a module is compiled, the content of the dependent B module is completely ready and can be compiled normally.
Therefore, in order to solve the dependency problem in the compiling, two sets of systems need to be used at the same time, that is, the dependency problem between the modules needs to be solved through a system similar to menuconfig, and the compiling problem needs to be solved through Makefile.
To this end, in this example, data processing methods are provided.
Where the context permits, reference to element or component or step(s), etc. should not be construed as limited to only of the elements, components, or steps, but may be or more of the elements, components, or steps, etc.
Although the flow described below includes operations that occur in a particular order, it should be appreciated that the processes may include more or less operations that are performed sequentially or in parallel (e.g., using parallel processors or a multi-threaded environment). As shown in FIG. 1, the method includes:
step 101: traversing development files of all modules of the target project;
step 102: analyzing the target file of each module, generating the rule of the target file and compiling the file on which the module depends from the development file;
step 103: taking the target files of all modules as a file set on which the target project depends;
step 104: when the target engineering compilation is executed, whether a file required by the current compilation exists in the file set is determined, and if the file does not exist, the file is generated.
For example, when the Makefile system executes target engineering compilation, the Makefile system may search a file and/or a module that is depended on by the current compilation from a total set of dependency relationships (including a set of files and a set of modules); determining whether the dependent file and/or the dependent module exist; if not, the file and/or the module which are depended on are compiled preferentially; and triggering to compile under the condition that the dependent file and the dependent module exist.
In the above example, the target file of each module is obtained by traversing the development files of all modules of the target project to form a file set on which the target project depends, so that when the target project compilation is executed, if no file required for the current compilation is found in the file set, the file is generated according to the rule. The technical problem that two systems are required to participate in the operation to cause too complex operation in order to solve the dependency problem in the compiling process in the prior art is solved through the mode, and the technical effect that the dependency problem among the modules can be simply and efficiently solved is achieved.
For example, when Makefile executes compilation of the general object, it may first find a dependent file, that is, an object file compiled by all modules, and if the total object-dependent file does not exist or some files do not exist, Makefile may automatically generate the lacking file according to a generation rule (command) of previously collecting the lacking file, in this way, all modules may be efficiently compiled.
The compiling dependency information of the modules carried in the development file may include, but is not limited to: a file generated after compilation, a method of generating a file, a file on which compilation depends, and a module on which compilation depends. The development file may exist in a file format of.
Compiling the dependent file can include: and compiling to obtain the dependent file according to a preset generation rule corresponding to the dependent file. The dependency rules among the modules in the dependency relationship collection can be arranged according to the compiling rule of Makefile.
The module and the development file may be in a corresponding relationship of , the development file may carry identification information for identifying the corresponding module, and the development file may be a file having mk as a suffix.
In the embodiments, the method can be applied to embedded Linux development.
The above method is described below with reference to specific examples, however, it should be noted that the specific examples are only for better describing the present application and should not be construed as limiting the present application.
In this example, ways are provided, and the compiling dependency and compiling problem between modules can be solved at the same time only by sets of Makefile systems.
Specifically, the Makefile compiling rule is described as follows:
Target......:prerequisites......
command
wherein, Target represents the Target file, prerequisites represents the Target or file on which the Target needs to be generated, and Command represents the Command to be executed to generate the Target.
The code indicates the dependency relationship of files or modules, that is, or more target files of target depend on files in prequiries, the generation rule is defined in command, Makefile judges whether prequiries exist before compiling target, if no target exists in prequiries, the generation rule of the target which does not exist in prequiries is preferably searched for so as to generate the target which depends on the target first, moreover, if more than files in prequiries are newer than the target file, the command defined by command is executed, which is the rule of Makefile and is the core content of Makefile.
In this example, it is considered that the rule of Makefile itself can be used to perform systematic and ordered processing on a plurality of modules, and all modules are compiled one by using the dependency rule of Makefile.
However, there are two problems to be solved by the above solution: 1) relationships between all modules; 2) the problem of coupling among a plurality of modules is specifically:
1) the relationship between all modules is mainly divided into two directions: and (3) the collection of module information, how to promote the compiling of all modules.
For this purpose, files with mk as a suffix name can be defined in each module in the project as a development file of Makefile, so as to be subsequently defined as a build.mk file by . information of a name for only identification, a target file generated after compiling, a method of compiling and the like is defined in the file.
In this way, when Makefile executes compilation of the total target, it may first find a dependent file, that is, a target file compiled by all modules, and if the file on which the total target depends does not exist, or some files do not exist, Makefile may automatically generate the deleted file according to a generation rule (command) previously collected for the deleted file, and according to this way, all modules may be effectively compiled.
2) There is a problem of coupling between the plurality of modules.
That is, if modules depend on other modules or a plurality of modules in the compiling process, the dependency needs to be declared in the build.mk of the modules, so that the dependency between the modules can be analyzed in the information collection stage of all the modules.
In this example, the dependency and compilation problem between modules in the engineering can be completed only by using the Makefile method for processing the dependency relationship, so that the method is very convenient when a third-party module is assembled in engineering use.
Based on the same concept of , data processing apparatuses are further provided in the embodiments of the present invention, as described in the following embodiments, since the principle of the data processing apparatus for solving the problem is similar to the data processing method, the implementation of the data processing apparatus can refer to the implementation of the data processing method, and the repeated description is omitted, as used below, the term "unit" or "module" can implement a combination of software and/or hardware with a predetermined function, although the apparatus described in the following embodiments is preferably implemented by software, the implementation of hardware, or a combination of software and hardware is also possible and contemplated, fig. 2 is a block diagram of structures of the data processing apparatus in the embodiments of the present invention, and as shown in fig. 2, the structure may include a traversal module 201, an analysis module 202, an aggregation module 203, and a generation module 204, which are explained below.
The traversing module 201 is used for traversing development files of all modules of the target project;
the analysis module 202 is used for analyzing the target file of each module from the development file, generating the rule of the target file and compiling the file depended by the module;
the collection module 203 is used for taking the target files of all modules as a file collection depended by the target project;
the generating module 204 is configured to determine whether a file required for current compilation exists in the file set when the target project compilation is executed, and generate the file if the file does not exist.
In embodiments, the generating module 204 may be specifically configured to generate the file according to a pre-stored generation rule corresponding to the file.
In embodiments, the module and development file are corresponding relationships.
In embodiments, the development file carries identification information for identifying the corresponding module.
In embodiments, the development file may be a.mk suffixed file.
In embodiments, the device can be applied to embedded Linux development.
In another embodiments, software is provided, which is used to implement the technical solutions described in the above embodiments and preferred embodiments.
In another embodiments, storage media are provided, which store the above software, including but not limited to optical disks, floppy disks, hard disks, removable memory, and the like.
From the above description, it can be seen that the embodiments of the present invention achieve the following technical effects: and analyzing the development files of all modules of the target project to obtain the target file of each module so as to form a file set which is depended by the target project, so that when the target project is compiled, if the files required by current compilation are found not in the file set, the files are generated according to rules. The technical problem that two systems are required to participate in the operation to cause too complex operation in order to solve the dependency problem in the compiling process in the prior art is solved through the mode, and the technical effect that the dependency problem among the modules can be simply and efficiently solved is achieved.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the embodiment of the present invention by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1, A data processing method, comprising:
traversing development files of all modules of the target project;
analyzing the target file of each module, generating the rule of the target file and compiling the file on which the module depends from the development file;
taking the target files of all modules as a file set on which the target project depends;
when the target engineering compilation is executed, whether a file required by the current compilation exists in the file set is determined, and if the file does not exist, the file is generated.
2. The method of claim 1, wherein generating the file comprises: and generating the file according to a pre-stored generation rule corresponding to the file.
3. The method of claim 1, wherein the module and development file are correspondences.
4. The method of claim 1, wherein the development file carries identification information for identifying the corresponding module.
5. The method of claim 1, wherein the development file is a.mk suffixed file.
A data processing apparatus of the type , comprising:
the traversal module is used for traversing the development files of all modules of the target project;
the analysis module is used for analyzing the target file of each module from the development file, generating the rule of the target file and compiling the file depended by the module;
the collection module is used for taking the target files of all the modules as a file collection which is depended by the target project;
and the generating module is used for determining whether a file required by current compilation exists in the file set when the target project compilation is executed, and generating the file if the file does not exist.
7. The apparatus of claim 6, wherein the generating module is specifically configured to generate the file according to a pre-stored generation rule corresponding to the file.
8. The apparatus of claim 6, wherein the module and the development file are .
9. The apparatus according to claim 6, wherein the development file carries identification information for identifying the corresponding module.
10. The apparatus of claim 6, wherein the development file is a.mk suffixed file.
CN201910228754.5A 2018-07-20 2019-03-25 data processing method and device Pending CN110737438A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2018108032140 2018-07-20
CN201810803214 2018-07-20

Publications (1)

Publication Number Publication Date
CN110737438A true CN110737438A (en) 2020-01-31

Family

ID=69236645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910228754.5A Pending CN110737438A (en) 2018-07-20 2019-03-25 data processing method and device

Country Status (1)

Country Link
CN (1) CN110737438A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112214221A (en) * 2020-10-10 2021-01-12 上海上讯信息技术股份有限公司 Method and equipment for constructing Linux system
CN112527306A (en) * 2020-10-27 2021-03-19 百果园技术(新加坡)有限公司 Method, device, equipment and medium for realizing independence of modules in project development

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870310A (en) * 2014-02-18 2014-06-18 小米科技有限责任公司 Program compilation method and relevant device
WO2015150342A1 (en) * 2014-03-30 2015-10-08 Universiteit Gent Program execution on heterogeneous platform
CN106293756A (en) * 2016-08-16 2017-01-04 汉柏科技有限公司 A kind of for quick-replaceable self-defined linux kernel system
CN106843995A (en) * 2017-01-25 2017-06-13 杭州迪普科技股份有限公司 A kind of file compiling method and device
CN107562429A (en) * 2017-08-25 2018-01-09 中国科学院软件研究所 A kind of android system static division method based on compiling rule
CN107608677A (en) * 2017-09-05 2018-01-19 腾讯科技(深圳)有限公司 A kind of process of compilation method, apparatus and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870310A (en) * 2014-02-18 2014-06-18 小米科技有限责任公司 Program compilation method and relevant device
WO2015150342A1 (en) * 2014-03-30 2015-10-08 Universiteit Gent Program execution on heterogeneous platform
CN106293756A (en) * 2016-08-16 2017-01-04 汉柏科技有限公司 A kind of for quick-replaceable self-defined linux kernel system
CN106843995A (en) * 2017-01-25 2017-06-13 杭州迪普科技股份有限公司 A kind of file compiling method and device
CN107562429A (en) * 2017-08-25 2018-01-09 中国科学院软件研究所 A kind of android system static division method based on compiling rule
CN107608677A (en) * 2017-09-05 2018-01-19 腾讯科技(深圳)有限公司 A kind of process of compilation method, apparatus and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112214221A (en) * 2020-10-10 2021-01-12 上海上讯信息技术股份有限公司 Method and equipment for constructing Linux system
CN112214221B (en) * 2020-10-10 2023-04-28 上海上讯信息技术股份有限公司 Method and equipment for constructing Linux system
CN112527306A (en) * 2020-10-27 2021-03-19 百果园技术(新加坡)有限公司 Method, device, equipment and medium for realizing independence of modules in project development

Similar Documents

Publication Publication Date Title
US20240045850A1 (en) Systems and methods for database orientation transformation
US11481200B1 (en) Checking source code validity at time of code update
CN110737437A (en) compiling method and device based on code integration
CN106325970A (en) Compiling method and compiling system
CN111144839B (en) Project construction method, continuous integration system and terminal equipment
CN111967017A (en) Method and device for generating dependency relationship, terminal equipment and storage medium
CN111309335A (en) Plug-in application compiling method and device and computer readable storage medium
US10013242B2 (en) Distributed compilation of statically typed languages
US20150254309A1 (en) Operation search method and operation search apparatus
CN114138281A (en) Compiling method, device, equipment and medium of software engineering
US9116714B2 (en) Methods and systems for file processing
CN111124872A (en) Branch detection method and device based on difference code analysis and storage medium
WO2015003452A1 (en) Methods and systems for file processing
CN110737438A (en) data processing method and device
US10747514B2 (en) Reduced save and restore instructions for call-clobbered registers
CN105550575A (en) Method and device for obtaining un-exported function address and data structure offset
US9396239B2 (en) Compiling method, storage medium and compiling apparatus
CN116578282A (en) Code generation method, device, electronic equipment and medium
CN113821486B (en) Method and device for determining dependency relationship between pod libraries and electronic equipment
CN110737429A (en) modular compiling method and device utilizing Makefile self-dependent relationship
US11947966B2 (en) Identifying computer instructions enclosed by macros and conflicting macros at build time
CN116069650A (en) Method and device for generating test cases
CN114174983B (en) Method and system for optimized automatic verification of advanced constructs
CN115098158A (en) SDK packaging method and device, computer equipment and storage medium
US10671397B2 (en) Reduced save and restore instructions for call-clobbered registers

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200131

RJ01 Rejection of invention patent application after publication