A kind of method for managing resource and system based on embedded platform
Technical field
The present invention relates to the resource management in the embedded software developing process.
Background technology
Resource is exactly literal and the picture of product statement, is the medium that directly exchanges with the user.At first will put resource in order when exploitation embedded software UI, it not only is directly connected to the image appearance of product integral body, also can have influence on the performance of product.
The embedded software developing field is limited by cost, embedded OS to the intellectual analysis support of resource all seldom, to the integral body of character resource arrange, size of word space, the size of font etc. must define by resource file.So resource is organized in the some that is absolutely necessary in the embedded software developing process, each module, each function of the built-in end software UI such as mobile phone, fixed station, learning machine all need to explain with character resource.
The multilingual development process of built-in end is generally demand-translation-exploitation, present tripartite personnel write document arrangement related work separately separately can cause work mistake because error is understood in interchange unavoidably, and the finishing tool that existing embedded development platform provides is basic only for the developer, function is simple, only support that the wall scroll input is revised, therefore when newly built construction is set up or increase the newspeak version because the larger error that not only can't avoid work exchange of resource change, also reduce developer's work efficiency, wasted greatly cost of human resources.
The storage document of various built-in end software resources is varied, substantially be the various documents of developer oneself definition or the text document of convenient operation, and in actual development, by various classification resource is dispersed in a plurality of files, this type of document of direct control is easy to cause resource to repeat like this, increase developer's workload, the waste of manpower cost.
There is following shortcoming in prior art:
1) each built-in end resource file distributes too much, and a lot of resource contents are repeated, and not only waste of manpower when arrangement also reduces running efficiency of system.
2) auxiliary finishing tool function is simple, can't reach development requirement, and a lot of work all must manual be finished.
3) platform of resource arrangement is single and not general, easily causes the error in the understanding during tripartite work handover.
Summary of the invention
Technical matters to be solved by this invention provides a kind of method for managing resource based on embedded platform, with all kinds of resource information unification to a general management platform, so that all housekeeping operations all realize in this management platform.
For solving the problems of the technologies described above, the present invention is achieved by the following technical solutions:
A kind of method for managing resource based on embedded platform may further comprise the steps:
The resource document of A, analysis built-in end software also extracts the resource character string;
B, the resource of extracting is imported the Excel management platform;
C, the demand of pressing are put resource in order;
D, reverse generate the software development resource file.
Wherein, described steps A is further comprising the steps:
A1, in the mode of plain text the txt text is analyzed, according to category of language each resource is inserted in the corresponding tabulation of Excel;
A2, from Excel, extract corresponding resource and return and lead the txt text;
A3, analyze each * .brx file in the mode of plain text, and utilize self-defined grand extraction resource to be inserted among the Excel.
Wherein, in the described steps A 1, be stored in resource in the txt text take the resource of ID name and each language as a fritter, correspond to the delegation of Excel tabulation.
Wherein, in the described steps A 2, read after the resource to merge with its tabulation head by row from Excel table and be inserted in the txt text, the every delegation among the Excel is corresponding to each piece of txt text.
Wherein, described step B is further comprising the steps:
B1, definition Excel gauge outfit;
B2, the interface by the Excel class are inserted into concrete corresponding resource among the Excel.
Wherein, among the described step D, can reverse the * .brx file that generates binary runtime environment for wireless, also can generate resource file according to the actual demand autonomous Design of embedded software developing.
A kind of resource management system based on embedded platform comprises resource document analysis module, Excel platform sorting module, reverses the engineering module;
Described resource document analysis module is used for analyzing all source material documents, described Excel platform sorting module is for all housekeeping operations of finishing at the Excel platform resource, described reverse engineering module is used for seeking survival into as required the resource file of software development, offers built-in end software and does demonstration support.
Wherein, described resource document analysis module comprises three interfaces;
First interface is used in the mode of plain text the txt text being analyzed, and according to category of language each resource is inserted in the corresponding tabulation of Excel;
Second interface led the txt text for returning in the corresponding resource of Excel extraction;
The 3rd interface is used for analyzing each * .brx file in the mode of plain text, and utilizes self-defined grand extraction resource to be inserted among the Excel.
Wherein, described Excel platform sorting module comprise paging translation page or leaf standard interface, the overlength contrast page or leaf interface search the character string that exceeds length restriction be set, search the redundant page or leaf of the generation interface that has or not same asset under the same language column, search the lower filtration same-language interface that has or not same asset of different language row.
Wherein, described reverse engineering module can generate binary runtime environment for wireless resource file or self-defining software development resource file.
The beneficial effect that the present invention has is:
1, the unified resource management platform makes the developer raise the efficiency the unified contrast arrangement of resource that distributes everywhere to Excel.
2, finish a large amount of contrasts, search and the special operations such as translate requirements with the auxiliary management platform of instrument, save human resources.
3, the demand-exploitation-same document of translator's co-operate can link up rapidly, conveniently understand.
Description of drawings
Fig. 1 is general flow chart of the present invention;
Fig. 2 is resource document analysis process figure of the present invention;
Fig. 3 is Excel platform arrangement process flow diagram of the present invention;
Fig. 4 is the redundant arithmetic process flow diagram;
Fig. 5 is reverse mechanical flow diagram of the present invention.
Embodiment
The present invention is described in further detail below in conjunction with the drawings and specific embodiments:
As shown in Figure 1, method for managing resource of the present invention is:
101, analyze the resource document of built-in end software and extract the resource character string.In the BREW mobile phone development, the resource document that provides is self-defining * .brx and * .h file, wherein concrete character resource is stored in the * .brx file, * .brx is the XML form of standard under plain text format, resource is stored in<Text〉* * * * * *</Text 〉,<String Id=" * " Name=" * * * * * "〉in the middle of (* is for needing the resource of arrangement), so the present invention analyzes the resource that * .brx file extracts to be needed in the mode of plain text.
102, the resource of extracting is imported the Excel management platform.Define first the Excel gauge outfit, wherein " Note " is the remarks that demand-exploitation-translator exchanges, " Length Limit " is the restriction to character resource length, " English ", " Chinese ", " Vietnam " etc. are the resource row head of concrete syntax, " ID " is ID number of * .brx file resource, and " ID_NAME " is the ID name of * .brx file resource.Just can concrete corresponding resource be inserted in the tabulation by the interface of Tentative Study of Achievement of Manipulation on Excel class after defining according to demand the Excel gauge outfit.
103, by demand arrangement resource.The present invention substitutes manual sorting by finishing in the aid to the analysis of unit string length restriction, with the character string contrast of ID different language, by arrangement translate requirements such as the ID sequence realize that paging represents with robotization.
104, reverse generation software development resource file.Can reverse the * .brx file that generates BREW, also can generate resource file according to the actual demand autonomous Design of embedded software developing.
Said method is realized by the resource management system that resource document analysis module, Excel platform sorting module, reverse engineering module form.The effect of each functional module is as described below.
As shown in Figure 2, the resource document analysis module is used for analyzing all source material documents, and the arrangement of existing built-in end software is finished in the plain text txt file greatly, so the support of pair txt file is arranged.This module mainly is comprised of 3 interfaces.
First interface uses the fstream class to the analyzing of txt text in the mode of plain text, according to category of language each resource is inserted in the corresponding tabulation of Excel.Be stored in resource in the txt text take the resource of ID name and each language as a fritter, correspond to Excel and then be the delegation of tabulation.Therefore analyze line by line txt file, the stop bit take self-defined grand TXT_ID_END_FLAG as every fritter resource, then next fritter resource is analyzed in accent.Then, delegation of delegation is inserted among the Excel.
Second interface uses BasicExcel generic operation Excel to extract corresponding resource and returns and lead the txt text, reads after the resource to merge with the tabulation head by row to be inserted in the txt text each piece of the corresponding txt text of every delegation among the Excel from the Excel table.Read each provisional capital of Excel then can be inserted in the txt text with corresponding gauge outfit merging at every turn.
The 3rd interface analyzed each * .brx file in the mode of plain text equally, and utilizes self-defined grand extraction resource to be inserted among the Excel.The resource document of BREW is divided into a .brx file for each language, and corresponding ID is identical with ID_NAME, so can contrast when each document of concrete analysis during ID_NAME is inserted into the resource with the ID_NAME different language with delegation.
As shown in Figure 3, Excel platform sorting module is used for finishing all housekeeping operations to resource at the Excel platform, it comprise paging translation page or leaf standard interface, an overlength contrast page or leaf interface of searching the character string that exceeds length restriction be set, search the redundant page or leaf of the generation interface that has or not same asset under the same language column, search the lower filtration same-language interface that has or not same asset of different language row etc.Extract the BasicExcel class of Excel take analysis in the platform sorting module as the holistic approach of basis realization to resource, then come the analytical algorithm complete operation according to different arrangement demands.
For example redundant algorithm basic thought contrasts all row of same column for beginning from the first row to circulate, every provisional capital can contrast with all row below the one's own profession, as find that redundant is exactly that contrast line number and redundant line number are put into redundant pond, and reject the line number of putting into redundant pond in the contrast below, extract the Excel resource by the ordered series of numbers in the redundant pond at last and be inserted in the redundant page or leaf.Algorithm flow as shown in Figure 4.
This module realizes all Special Finishing demands by program, substitutes manually with robotization, thereby saves time raising development efficiency; And operating among demand-translation-developer unified to Excel, tripartite personnel only need to process an Excel table just can finish whole alternate current operation.
As shown in Figure 5, reversing the engineering module is used for generating the resource file of seeking survival into as required software development and offers built-in end software and do and show and support, can generate the * .brx file of BREW, also can generate resource file according to the actual demand autonomous Design of embedded software developing.Such as in the cluster mobile telephone GOTA of BREW development platform exploitation, support direct returning to lead generation * .brx file; In the fixed station WP of BREW development platform exploitation, then need self-defined software development resource file.According to the demand of fixed station WP, resource file need to represent in the UNICODE code value mode of 16 systems, and is generated in the resource array, is associated with low layer character pattern information realizing, and shows in UI.Must in the 0-255 scope, so in configuration file, increase the code value swap table, the UNICODE code outside 255 be changed in 255 according to inner demonstration code value in the WP exploitation is limited, at last the resource array that generates is input in the User Defined Resource file.
The present invention, has optimized software configuration and has improved system running speed when simplifying workflow, reducing the wasting of resources with the resource document of the mode method treatments B REW embedded development needs of unified resource management platform.
The above only is preferred embodiment of the present invention, not in order to limiting the present invention, all any modifications of doing within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.