CN102508660A - Generation method and device of executable file - Google Patents
Generation method and device of executable file Download PDFInfo
- Publication number
- CN102508660A CN102508660A CN2011103294198A CN201110329419A CN102508660A CN 102508660 A CN102508660 A CN 102508660A CN 2011103294198 A CN2011103294198 A CN 2011103294198A CN 201110329419 A CN201110329419 A CN 201110329419A CN 102508660 A CN102508660 A CN 102508660A
- Authority
- CN
- China
- Prior art keywords
- executable file
- former
- data
- new
- 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.)
- Pending
Links
Images
Abstract
The invention discloses a generation method and device of an executable file. The generation method comprises the following steps: loading the original executable file and parsing out an original code part and an original data from the original executable file according to the creation rules of the original executable file; reading new parameter data which is required for the executable file to be generated and substituting the new parameter data for the original data part; and merging the original code part with the new parameter data and generating the new executable file. According to the method disclosed by the invention, data parameters can be modified on the basis of not modifying program codes, then the new executable file can be obtained, the participation of design staff of a source program is not required during the whole process, codes are less prone to being modified mistakenly, and the whole product production scheduling can be improved.
Description
Technical field
The present invention relates to the renewal of program file, specifically, relate to the generation method and the generating apparatus of executable file.
Background technology
Development along with chip integration; Now a lot of products all are based on same hardware platform, same design framework, same interface etc. and design; So just develop and a lot of derivatives; These derivatives are basic identical in the software and hardware architecture of function, performance and realization, only aspect parameter information, disagree.With the optical-electric module product is example, and numerous products-hardware circuit are just the same, and product function also all meets the industry standard requirement, but its performance index are slightly different.Because of the characteristic of semiconductor devices in the optical-electric module, electric property can change along with variation of temperature again, and therefore, optical-electric module all need be calibrated, and will offset along with the optical-electric module changes of properties that temperature variation causes.
For realizing above-mentioned functions; The deviser is often when design bottom program; The FLASH space of chip is divided into the program space and data space two parts, and the program space is deposited the code section of source program, and data space is deposited the data division of source program; Be product parameters information, these product parameters information are used for the photoelectric properties of calibration module.If the identical homogeneity of product of hardware is relatively good; Parameter information does not just need every batch of module to revise to some extent; But when homogeneity of product was bad, information parameter that maybe every batch of product all need carry out suitable adjustment and could satisfy its performance requirement, to reach the purpose of calibration.Because parameter information belongs to the part of source program; If the product parameters informational needs is arranged to be revised; The method that prior art is general is that the source program designer revises data in source program; Then amended source program is recompilated and generate executable file, and executable file is issued to the workshop, to realize the batch process of product on production line.
Above-mentioned modification supplemental characteristic obtains method more complicated in the entire product technological process of new executable file, needs the designer of source program to participate, if the designer leaves office or asks for leave, will incur loss through delay the production progress.On the other hand, even revised by the source program designer, if the compiling condition setting is inaccurate, the executable file of acquisition still can not meet the demands.The most important thing is that the generation method of this executable file exists huge hidden danger in security,, will cause the function of entire product and performance not to meet design requirement in case the deviser has revised the code section in the source program because of maloperation.Missing the example of revising the source program code part because of the modification parameter in the actual product technological process emerges in an endless stream; The mistake that code revision caused can be described as catastrophic mistake; Need great amount of manpower and material resources to test, investigate and verify; Have a strong impact on product development speed, greatly reduced work efficiency.
Summary of the invention
The present invention is directed in the prior art because of revising the problem that the maloperation property that exists when parameter obtains executable file is big, the former designer of needs participates in delaying process speed; A kind of generation method and generating apparatus of executable file are provided, can have effectively avoided the problems of the prior art.
The invention provides a kind of generation method of executable file, this method part that when generating executable file, only Updates Information, and can not relate to the change of code section, can guarantee the security of program code.
For realizing the foregoing invention purpose, the present invention adopts following technical proposals to be achieved:
A kind of generation method of executable file, said method comprises the steps:
A, load former executable file, go out former code section and former data division in the former executable file according to the establishment rule parsing of this former executable file, and preserve respectively;
B, read the new argument data that the executable file that will generate needs, replace former data division with the new argument data;
C, former code section and new argument data are merged, generate new executable file.
The generation method of aforesaid executable file in said step b, adopts new argument copying data to address that former data division is preserved, the mode that covers former data division with the new argument data is realized replacing former data division with the new argument data.
The generation method of aforesaid executable file in said step c, combines both according to the address of former code section and new argument data, generates new executable file.
The generation method of aforesaid executable file, said executable file can be executable bin file of single-chip microcomputer or hex file.
The present invention also provides a kind of generating apparatus of executable file, can not relate to the change of code section when utilizing this device to generate executable file, has guaranteed the security of program code.
For realizing the foregoing invention purpose, the present invention adopts following technical proposals to realize:
A kind of generating apparatus of executable file, said device comprises:
Loading module is used for the former executable file of device;
Parsing module is used for going out according to the establishment rule parsing of former executable file the former code section and the former data division of former executable file;
Data read module is used to read the new argument data of the executable file needs that will generate;
Data replacement module is used for the new argument data are replaced former data division;
File merges module, is used for former code section and new argument data are merged, and generates new executable file;
Memory module is used to store former code section, former data division and new executable file.
The generating apparatus of aforesaid executable file, to the address that said former data division is preserved, the mode that covers former data division with the new argument data realizes replacing former data division with the new argument data said data replacement module with said new argument copying data.
The generating apparatus of aforesaid executable file, said file merge module and according to said former code section and the address of said new argument data in said memory module former code section and new argument data are combined, and generate new executable file.
The generation method of aforesaid executable file, said executable file are executable bin file of single-chip microcomputer or hex file.
Compared with prior art; Advantage of the present invention and good effect are: when utilizing method of the present invention and device to generate only to be the executable file that supplemental characteristic changes; Need partly not make amendment to program code; Also do not need professional composing software, can bring the advantage of two aspects: not relying on the programmer can generate new executable file on the one hand, has improved the production progress; Can avoid the mistake that produces in the compilation process on the other hand, guarantee the security of program, the extensive use when being particluarly suitable for the derived class product program upgrade of the frequent change of data message on the production line.
After advantages embodiment of the present invention, other characteristics of the present invention and advantage will become clearer.
Description of drawings
Fig. 1 is the process flow diagram of an embodiment of generation method of executable file of the present invention;
Fig. 2 is the theory diagram of an embodiment of generating apparatus of executable file of the present invention.
Embodiment
Below in conjunction with accompanying drawing and embodiment technical scheme of the present invention is done further detailed explanation.
The present invention is directed to most of derived class product different batches product program codes identical, the difference only be the characteristics that data parameters changes, the generation method and the generating apparatus of executable file proposed.Adopt method of the present invention and device when generating executable file; Can utilize existing executable file; On the basis of update routine code not, revise data parameters and obtain new executable file, thereby utilize new executable file on production line, to produce corresponding product, whole process need not source program designer participation; The mistake that is not prone to code is revised, and can improve the entire product manufacturing schedule.
Fig. 1 shows the process flow diagram of an embodiment of generation method of executable file of the present invention.This embodiment is an example with the optical module product; Executable file in its single-chip microcomputer is hex file or bin file; New generation product is compared with existing procucts; Variation has just taken place in executable file on individual parameters, utilize the method flow of the needed executable file of executable file acquisition new generation product in the existing procucts following:
S11: flow process begins.
S12: load the former hex file of carrying out in the existing procucts, parse wherein former code section and former data division, and preserve respectively.
When resolving former executable file, resolve according to the establishment rule of this document.Creating the type that rule depends on compiler, is the disclosed technical information of compiler manufacturer, as long as know the compiler type that former executable file adopts, just can know it and create rule.According to creating the rule parsing program code, can parse former code section and former data division in the executable file then, this process need not the source program designer and participates in.After parsing former code section and former data division, preserve respectively.
S13: read the new argument data, replace former data division with the new argument data.
Reading the needed new argument data of the new executable file that will generate, also is the supplemental characteristic of new generation product.These new argument data can be the parameters that directly from debugging software, reads when debugging new generation product in the laboratory, also can be the parameters that from the new product sample that disposes the new argument data, reads out.Replacing former data division with the new argument data can adopt following method to realize: the new argument data directly are copied to the address that former data division is preserved, cover former data division with the new argument data.For the derived class product, the raw parameter part is consistent with the shared address space of new argument data basically, can cover fully.If there be the situation of new argument data, then can delete former data division, and the start address of new argument data from the raw parameter part write successively less than the raw parameter part.
S14: former code section and new argument data are merged, generate new executable file.
Address according to former code section and new argument data directly combines both, generates new executable file.
S15: flow process finishes.
New executable file just can be transferred the batch process of carrying out product to production line after generating.
In the generative process of above-mentioned executable file, the code section in the executable file is not done any change, can guarantee the security of program code.And the generation of new executable file does not need development environment thereby need not compile generation, need not programmer's participation, and simple operation is quick, has improved production efficient.
Shown in Figure 2 is the theory diagram of an embodiment of generating apparatus of executable file of the present invention.
As shown in Figure 2, the generating apparatus of this embodiment includes:
Loading module 21 is used for the former executable file of device, like the hex file or the bin file of single-chip microcomputer in the optical module product.
File merges module 25, is used for the former code section and the new argument data of memory module 26 storages are merged, and generates new executable file, and is saved in the memory module 26.
The course of work of the generating apparatus of above-mentioned executable file can be with reference to the flow process of above-mentioned Fig. 1 method embodiment.
Above embodiment is only in order to explaining technical scheme of the present invention, but not limits it; Although the present invention has been carried out detailed explanation with reference to previous embodiment, for the person of ordinary skill of the art, still can make amendment to the technical scheme that previous embodiment is put down in writing, perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of relevant art scheme break away from the spirit and the scope of the present invention's technical scheme required for protection.
Claims (10)
1. the generation method of an executable file is characterized in that, said method comprises the steps:
A, load former executable file, go out former code section and former data division in the former executable file according to the establishment rule parsing of this former executable file, and preserve respectively;
B, read the new argument data that the executable file that will generate needs, replace former data division with the new argument data;
C, former code section and new argument data are merged, generate new executable file.
2. the generation method of executable file according to claim 1; It is characterized in that; In said step b, adopt new argument copying data to address that former data division is preserved, the mode that covers former data division with the new argument data are realized replacing former data division with the new argument data.
3. the generation method of executable file according to claim 2 is characterized in that, in said step c, according to the address of former code section and new argument data both is combined, and generates new executable file.
4. according to the generation method of each described executable file in the claim 1 to 3, it is characterized in that said executable file is the executable bin file of single-chip microcomputer.
5. according to the generation method of each described executable file in the claim 1 to 3, it is characterized in that said executable file is the executable hex file of single-chip microcomputer.
6. the generating apparatus of an executable file is characterized in that, said device comprises:
Loading module is used for the former executable file of device;
Parsing module is used for going out according to the establishment rule parsing of former executable file the former code section and the former data division of former executable file;
Data read module is used to read the new argument data of the executable file needs that will generate;
Data replacement module is used for the new argument data are replaced former data division;
File merges module, is used for former code section and new argument data are merged, and generates new executable file;
Memory module is used to store former code section, former data division and new executable file.
7. the generating apparatus of executable file according to claim 6; It is characterized in that; To the address that said former data division is preserved, the mode that covers former data division with the new argument data realizes replacing former data division with the new argument data said data replacement module with said new argument copying data.
8. the generating apparatus of executable file according to claim 7; It is characterized in that; Said file merges module and according to said former code section and the address of said new argument data in said memory module former code section and new argument data is combined, and generates new executable file.
9. according to the generating apparatus of each described executable file in the claim 6 to 8, it is characterized in that said executable file is the executable bin file of single-chip microcomputer.
10. according to the generating apparatus of each described executable file in the claim 6 to 8, it is characterized in that said executable file is the executable hex file of single-chip microcomputer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011103294198A CN102508660A (en) | 2011-10-26 | 2011-10-26 | Generation method and device of executable file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011103294198A CN102508660A (en) | 2011-10-26 | 2011-10-26 | Generation method and device of executable file |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102508660A true CN102508660A (en) | 2012-06-20 |
Family
ID=46220752
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011103294198A Pending CN102508660A (en) | 2011-10-26 | 2011-10-26 | Generation method and device of executable file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102508660A (en) |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103729226A (en) * | 2014-01-26 | 2014-04-16 | 广州视源电子科技股份有限公司 | Method and tool for correctly configuring software |
CN104461557A (en) * | 2014-12-19 | 2015-03-25 | 北京奇虎科技有限公司 | Puppet configuration data processing method and device |
CN104657140A (en) * | 2015-02-10 | 2015-05-27 | 广州华多网络科技有限公司 | Code generating method and device |
CN104765593A (en) * | 2014-01-06 | 2015-07-08 | 北京深思数盾科技有限公司 | Firmware customizing method and hardware apparatus for customizing firmware |
CN105701429A (en) * | 2015-12-31 | 2016-06-22 | 宇龙计算机通信科技(深圳)有限公司 | User-defined adaptive method and system for RFID card |
CN105843662A (en) * | 2016-03-28 | 2016-08-10 | 乐视控股(北京)有限公司 | Software product compiling method and equipment |
CN105867953A (en) * | 2015-01-21 | 2016-08-17 | 中国移动通信集团云南有限公司 | Application upgrading package generation method, application upgrading method and corresponding apparatuses |
CN106095497A (en) * | 2016-06-07 | 2016-11-09 | 中国建设银行股份有限公司 | The parametrization collocation method of a kind of executable file and the system of execution thereof |
CN106156034A (en) * | 2015-03-26 | 2016-11-23 | 北京畅游天下网络技术有限公司 | The methods of exhibiting of a kind of executable file and device |
CN106843822A (en) * | 2015-12-07 | 2017-06-13 | 阿里巴巴集团控股有限公司 | One kind performs code generating method and equipment |
CN107479895A (en) * | 2017-08-22 | 2017-12-15 | 郑州云海信息技术有限公司 | A kind of method for parameter configuration and device of same platform project |
CN108052739A (en) * | 2017-12-13 | 2018-05-18 | 嘉兴倚韦电子科技有限公司 | Design express passway design method in integrated circuit semi-custom rear end |
CN108399084A (en) * | 2017-02-08 | 2018-08-14 | 中科创达软件股份有限公司 | A kind of operation method and system of application program |
CN109947417A (en) * | 2019-03-21 | 2019-06-28 | 上海龙旗科技股份有限公司 | For generating the method and apparatus of a key upgrade procedure |
CN112052046A (en) * | 2020-07-24 | 2020-12-08 | 乐歌人体工学科技股份有限公司 | Method for modifying motor control parameters of lifting device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101290571A (en) * | 2007-04-16 | 2008-10-22 | 阮建辉 | Method for creating file being dynamically loaded and performed |
CN101661277A (en) * | 2009-09-09 | 2010-03-03 | 北京数码大方科技有限公司 | Part processing method and device used for numerical control machine |
CN101668283A (en) * | 2008-09-01 | 2010-03-10 | 沃勤网络科技(上海)有限公司 | Method for dynamic loading in embedded system of mobile phone |
-
2011
- 2011-10-26 CN CN2011103294198A patent/CN102508660A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101290571A (en) * | 2007-04-16 | 2008-10-22 | 阮建辉 | Method for creating file being dynamically loaded and performed |
CN101668283A (en) * | 2008-09-01 | 2010-03-10 | 沃勤网络科技(上海)有限公司 | Method for dynamic loading in embedded system of mobile phone |
CN101661277A (en) * | 2009-09-09 | 2010-03-03 | 北京数码大方科技有限公司 | Part processing method and device used for numerical control machine |
Cited By (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104765593A (en) * | 2014-01-06 | 2015-07-08 | 北京深思数盾科技有限公司 | Firmware customizing method and hardware apparatus for customizing firmware |
CN103729226A (en) * | 2014-01-26 | 2014-04-16 | 广州视源电子科技股份有限公司 | Method and tool for correctly configuring software |
CN104461557A (en) * | 2014-12-19 | 2015-03-25 | 北京奇虎科技有限公司 | Puppet configuration data processing method and device |
CN105867953A (en) * | 2015-01-21 | 2016-08-17 | 中国移动通信集团云南有限公司 | Application upgrading package generation method, application upgrading method and corresponding apparatuses |
CN105867953B (en) * | 2015-01-21 | 2019-04-26 | 中国移动通信集团云南有限公司 | Application program updating packet generation method and application program updating method and corresponding intrument |
CN104657140A (en) * | 2015-02-10 | 2015-05-27 | 广州华多网络科技有限公司 | Code generating method and device |
CN104657140B (en) * | 2015-02-10 | 2018-01-09 | 广州华多网络科技有限公司 | Code generating method and device |
CN106156034A (en) * | 2015-03-26 | 2016-11-23 | 北京畅游天下网络技术有限公司 | The methods of exhibiting of a kind of executable file and device |
CN106843822B (en) * | 2015-12-07 | 2020-07-31 | 阿里巴巴集团控股有限公司 | Execution code generation method and equipment |
CN106843822A (en) * | 2015-12-07 | 2017-06-13 | 阿里巴巴集团控股有限公司 | One kind performs code generating method and equipment |
CN105701429B (en) * | 2015-12-31 | 2018-09-14 | 宇龙计算机通信科技(深圳)有限公司 | A kind of self-defined adaptation method and system of RFID radio-frequency cards |
CN105701429A (en) * | 2015-12-31 | 2016-06-22 | 宇龙计算机通信科技(深圳)有限公司 | User-defined adaptive method and system for RFID card |
CN105843662A (en) * | 2016-03-28 | 2016-08-10 | 乐视控股(北京)有限公司 | Software product compiling method and equipment |
CN106095497A (en) * | 2016-06-07 | 2016-11-09 | 中国建设银行股份有限公司 | The parametrization collocation method of a kind of executable file and the system of execution thereof |
CN108399084A (en) * | 2017-02-08 | 2018-08-14 | 中科创达软件股份有限公司 | A kind of operation method and system of application program |
CN108399084B (en) * | 2017-02-08 | 2021-02-12 | 中科创达软件股份有限公司 | Application program running method and system |
CN107479895A (en) * | 2017-08-22 | 2017-12-15 | 郑州云海信息技术有限公司 | A kind of method for parameter configuration and device of same platform project |
CN108052739A (en) * | 2017-12-13 | 2018-05-18 | 嘉兴倚韦电子科技有限公司 | Design express passway design method in integrated circuit semi-custom rear end |
CN108052739B (en) * | 2017-12-13 | 2021-07-20 | 嘉兴倚韦电子科技有限公司 | Method for designing quick channel of semi-custom back-end design of integrated circuit |
CN109947417A (en) * | 2019-03-21 | 2019-06-28 | 上海龙旗科技股份有限公司 | For generating the method and apparatus of a key upgrade procedure |
CN112052046A (en) * | 2020-07-24 | 2020-12-08 | 乐歌人体工学科技股份有限公司 | Method for modifying motor control parameters of lifting device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102508660A (en) | Generation method and device of executable file | |
CN104133772B (en) | Automatic test data generation method | |
CN102541521B (en) | Automatic operating instruction generating device based on structured query language and method | |
CN103927174A (en) | Service processing method and device | |
Singh et al. | Making numerical program analysis fast | |
CN102360331B (en) | Test program automatic generation method based on formal description | |
CN108874438A (en) | Patch generation method, device, electronic equipment and computer program product | |
CN104423953A (en) | Timing data processing script execution system and method of supervisory control and data acquisition (SCADA) system | |
CN102591777A (en) | Unit test code generation method and device | |
Sabetzadeh et al. | Using SysML for modeling of safety-critical software-hardware interfaces: Guidelines and industry experience | |
CN103744684A (en) | Heterogeneous hardware and software collaborative developing method and system | |
CN105591779A (en) | Method and device for inspecting network element | |
CN104391731B (en) | A kind of edit methods unrelated with data type based on C# | |
CN104572238A (en) | Method and system for generating executable software package efficiently | |
CN108052327A (en) | A kind of kernel module compiling, loading method and device | |
CN109934507A (en) | A kind of method and device of operation flow scheduling | |
CN111435312B (en) | Application program management method and device and electronic equipment | |
CN105446789A (en) | Method and apparatus for building application in android system | |
CN103645888A (en) | System and method for automatically building operation system | |
CN104991810A (en) | Method and processing system for automatically adding APK into Android system | |
JP7331716B2 (en) | Systems, methods, and computer implemented programs for operating field devices | |
CN105988792A (en) | Nuclear power software development automation system and method | |
CN109933325A (en) | A kind of dex file construction method, apparatus and system | |
JP2011515755A (en) | Development method and apparatus for reserved component container base software | |
CN108536585B (en) | Data change influence domain analysis method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20120620 |