CN106843842A - The update method and device of a kind of application profiles - Google Patents
The update method and device of a kind of application profiles Download PDFInfo
- Publication number
- CN106843842A CN106843842A CN201611208520.7A CN201611208520A CN106843842A CN 106843842 A CN106843842 A CN 106843842A CN 201611208520 A CN201611208520 A CN 201611208520A CN 106843842 A CN106843842 A CN 106843842A
- Authority
- CN
- China
- Prior art keywords
- text
- application profiles
- intermediate data
- data
- array
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses the update method and device of a kind of application profiles, it is related to field of computer technology, is capable of the configuration file of quick more new application, saves system operation time.Methods described includes:When the more new command to application profiles is received, parse the application profiles, obtain the intermediate data of preset data structure, according to the tab indexes carried in the more new command, update the property value of the tab indexes correspondence intermediate data, intermediate data after renewal is serialized, the application profiles after being updated.Present invention is mainly used for the renewal of application profiles.
Description
Technical field
The present invention relates to field of computer technology, the update method and dress of more particularly to a kind of application profiles
Put.
Background technology
AndroidManifest.xml is the global configuration file of Android program, and being must in each Android program
The file of palpus.It is located under the root of development and application program, describes the global data in program installation kit, including installation kit
In component and various can be processed and start the important informations such as position.
Configuration information containing substantial amounts of Android program in AndroidManifest.xml, by updating configuration information
The result of application behavior, such as System Privileges setting, volume adjusting can be realized updating.Due in Android application programs
AndroidManifest.xml configuration files are generally stored using binary mode, if directly from program installation kit
Middle solution extrudes configuration file and mess code situation occurs so that system developer directly cannot be updated to configuration file.
Machine readable text is generally decompiled into AndroidManifest.xml configuration files using compilation tool in the prior art
The configuration file of this form, then again by renewal after the configuration file of readable textual form be compiled into binary file so that
Realize the renewal to configuration file.However, during configuration file renewal is carried out, being required for every time to the anti-volume of compilation tool
Configuration file after translating such as is recompiled, compressed and is signed the operation, takes system operation time.
The content of the invention
In view of this, the embodiment of the present invention provides the update method and device of a kind of application profiles, can be fast
The configuration file of fast more new application, saves system operation time.
To reach above-mentioned purpose, present invention generally provides following technical scheme:
On the one hand, a kind of update method of application profiles is the embodiment of the invention provides, the method includes:
When the more new command to application profiles is received, the application profiles are parsed, obtained
The intermediate data of preset data structure;
According to the tab indexes carried in the more new command, the category of the tab indexes correspondence intermediate data is updated
Property value;
Intermediate data after renewal is serialized, the application profiles after being updated.
On the other hand, the embodiment of the present invention additionally provides a kind of updating device of application profiles, the device bag
Include:
Resolution unit, for when the more new command to application profiles is received, parsing the application program
Configuration file, obtains the intermediate data of preset data structure;
Updating block, for the tab indexes carried in the more new command according to, updates the tab indexes correspondence institute
State the property value of intermediate data;
Serializing processing unit, for being serialized to the intermediate data after renewal, the application program after being updated
Configuration file.
The update method and device of a kind of application profiles provided in an embodiment of the present invention, with existing using volume
Translate instrument to compare the mode that application profiles are updated, the embodiment of the present invention ought be received and configure application program
During the more new command of file, by parsing application profiles, the intermediate data of preset data structure is obtained, so that basis
The tab indexes carried in more new command, update the property value of tab indexes correspondence intermediate data, without to the anti-volume of translation tool
Configuration file after translating such as is recompiled, compressed and is signed the operation, and then is realized to application profiles more
Newly, the intermediate data after to renewal is serialized, and application profiles quickly can be reduced into binary system shape
Formula, saves system operation time.
Described above is only the general introduction of technical solution of the present invention, in order to better understand technological means of the invention,
And can be practiced according to the content of specification, and in order to allow the above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by specific embodiment of the invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit is common for this area
Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention
Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows a kind of update method flow chart of application profiles provided in an embodiment of the present invention;
Fig. 2 shows the update method flow chart of another application profiles provided in an embodiment of the present invention;
Fig. 3 shows a kind of updating device structural representation of application profiles provided in an embodiment of the present invention;
Fig. 4 shows the updating device structural representation of another application profiles provided in an embodiment of the present invention
Figure.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.Conversely, there is provided these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
The embodiment of the present invention provides a kind of update method of application profiles, as shown in figure 1, methods described bag
Include:
101st, when the more new command to application profiles is received, the application profiles are parsed,
Obtain the intermediate data of preset data structure.
Due to the configuration information of a large amount of Android applications that are stored with application profiles, normal conditions, in application journey
In the case that sequence needs to issue or upgrade, when the more new command to application program is received, research staff is matched somebody with somebody by renewal
Putting file can realize new application behavior, so as to realize using issue or application upgrade.
The intermediate data for here presetting at data structure can include text array, resource array and the part number of tag tree three
According to composition, wherein, text array for proprietary data structure data, each text for depositing label in configuration file,
Each label index of text array points to text, and resource array is used to deposit all resources of application profiles,
Usually empty, tag tree is the tree structure consistent with structure in application profiles text, is tree-like knot with label
The node of structure.
Under normal circumstances, application profiles are stored in binary form, it is impossible to directly use text
Mode be updated, for the embodiment of the present invention by parsing application profiles, in obtaining preset data structure
Between data so that application profiles can be converted to the intermediate data of the preset data structure that can be updated.
102nd, the tab indexes carried in the more new command according to, update the tab indexes correspondence intermediate data
Property value.
Wherein, due to including substantial amounts of configuration information in application profiles, tab indexes are used to show to update
The corresponding position of configuration file, carries the label rope of renewal configuration file in need in the more new command of application profiles
Draw, the position of configuration file to be updated can be searched out by tab indexes.
For the embodiment of the present invention, the attribute information for updating tab indexes correspondence intermediate data can be including but not limited to
Following implementations, find the position of tab indexes correspondence intermediate data, here intermediate data by tab indexes first
Position be usually corresponding position in text array or tag tree, for different tag types correspondence intermediate data position have
Institute is different, for example, when tag types are for numeral, property value that can be directly to label in tag tree is modified, so that
The property value of correspondence position intermediate data is updated, when tag types are text, can be by searching correspondence text in tag tree
The text index of array, so that the property value of text index correspondence text array is updated, while correspondence updates the text of tag tree
Index.
It should be noted that here can be by the interpolation data at the attribute information of correspondence position intermediate data, modification
The mode of data or deletion data is operated to realize updating, and the embodiment of the present invention is to updating application programs configuration file
Particular content is not defined.
103rd, the intermediate data after renewal is serialized, the application profiles after being updated.
Here the process for being serialized to the intermediate data after renewal mainly include text array is serialized, it is right
Resource array is serialized and tag tree is serialized, because resource array is in preset data structure is converted to
Between do not change in data procedures, therefore the process serialized to the intermediate data after renewal mainly includes to text
Array is serialized and tag tree is serialized.
Here it is that the intermediate data after renewal is reduced into two to enter to the purpose that the intermediate data after renewal is serialized
The application profiles of form processed, text array, untreated resource array and the serializing that will further serialize
Tag tree be written in file destination together, the application profiles after being updated.
Explanation is needed exist for, during file destination is write, in order to further discriminate between different file types,
The overall size of the application profiles after also needing to write the magic numeral of file destination and updating.
The update method of a kind of application profiles provided in an embodiment of the present invention, with existing use compilation tool
The mode that application profiles are updated is compared, the embodiment of the present invention ought be received to application profiles
During more new command, by parsing application profiles, the intermediate data of preset data structure is obtained, so as to refer to according to renewal
The tab indexes carried in order, update the property value of tab indexes correspondence intermediate data, after to translation tool decompiling
Configuration file such as is recompiled, compressed and is signed the operation, and then realizes the renewal to application profiles, is passed through
Intermediate data after renewal is serialized, application profiles quickly can be reduced into binary form, saved
System operation time.
Further, the embodiment of the present invention provides the update method of another application profiles, as shown in Fig. 2
Methods described includes:
201st, the binary data in the application profiles is loaded.
In Android system, application profiles are typically the XML file of standard, and each XML tag has difference
Implication, most configuration parameter is all placed in the attribute of label.XML file is case sensitive when marking with attribute, it
Can be to change on demand, research staff can change setting using configuration file, without application program to be recompiled.
For the embodiment of the present invention, the binary data in loading application programs configuration file can be using using following realities
Existing mode, the magic numeral first according to application profiles reads the file type of application profiles, here
Magic numeral for identifying different file types, be specified file most start several be uniquely different from alternative document type
Byte, have these magics numeral, can very easily distinguish different file types, thus further loading application programs match somebody with somebody
The binary data in file is put, for example, a file for JPEG types, some bytes that it starts are probably of this sort
" 0047....JFIF...G of 0010 4a46 of ffd8 ffe0 4,946 0,001 0101 ", " ffd8 " here has meant that this
Individual file is a file for JPEG types, and what " ffe0 " was represented is JFIF type structures.Need exist for explanation when, if matched somebody with somebody
Put file type it is corresponding be not binary data, then do not loaded.
Exemplary, the binary format for Android application program configuration file in the embodiment of the present invention is as shown in table 1,
Table 1 is main to that should be made up of three partial datas, the text data of binary data format, resource data and label data.
The Android binary formats of table 1
Wherein, text dictionary type, text dictionary size, text number, number of modes, section break, text dictionary starting
Position, pattern original position, the original position of each text, text area, alignment bit position correspondence Binary Text data, text
Each text formatting is as shown in table 2 in area, resource-area type, resource-area size, resource-area part correspondence Binary Resources data,
Content regions part correspondence binary label data, label construction is as shown in table 3 in content regions.
Each text formatting in the text area of table 2
Title | Size | Description |
Length | 2B | Text size n |
Content of text | n*2B | Every 2 byte representations, one character |
End mark | 2B | Content is 0x0000 |
Wherein, each text formatting can include length, content of text and end mark in text.
Label construction in the content regions of table 3
Wherein, in content regions label construction can include tag types, label substance size, source code be expert at, cover,
Prefix, title, attribute area mark, attribute number, attribute source code line number and attribute list, tag types as shown in table 4, belong to
Property list is as shown in table 6.
The tag types of table 4
Mark | Description |
0x00100100 | NameSpace starts |
0x00100101 | NameSpace terminates |
0x00100102 | Label starts |
0x00100103 | Label terminates |
0x00100104 | Text |
Wherein, tag types generally include two kinds, and one kind is NameSpace, and another kind is label, in XML file, is
Avoid the label of XML of the same name, XML also possesses NameSpace, label can be placed among NameSpace, different NameSpaces
In same names label be different labels.
The attribute list of table 5
Wherein, attribute list can include attribute namespace, Property Name, attribute textual value, attribute type and category
Property value.
The 202nd, the binary data is converted to the intermediate data of preset data structure.
Because binary data directly cannot be realized updating by textual form, the embodiment of the present invention turns binary data
The intermediate data of preset data structure is turned to, so as to realize the renewal of application profiles, wherein, preset data structure
Intermediate data includes text array, resource array and tag tree.
Exemplary, the data structure of the intermediate data Chinese version array of preset data structure is as shown in table 6, preset data knot
The data structure of resource array is as shown in table 7 in the intermediate data of structure, the number of tag tree in the intermediate data of preset data structure
It is as shown in table 8 according to structure, wherein, tag tree attribute data structures are as shown in table 9.
The data structure of the text array of table 6
The data structure of the resource array of table 7
Title | Type | Description |
Type | Numerical value | |
Size | Numerical value | |
Content array | Numerical value array |
The data structure of the tag tree of table 8
The tag tree attribute data structures of table 9
Title | Type | Description |
NameSpace | Numerical value | |
Title | Numerical value | Text index |
Attribute textual value | Numerical value | Text index |
Attribute type | Numerical value | Text or numerical value |
Property value | Numerical value |
203rd, the tag tree is traveled through, tab indexes corresponding attribute type in the tag tree is searched.
Because tag tree is the tree structure consistent with structure in application profiles text, with label as tree-like
The node of structure, in order to realize to the renewal of application profiles, it is necessary to according to the tab indexes carried in more new command
The position of correspondence renewal is found from tag tree, tab indexes here can specifically include tag name, attribute-name, source text number
According to this and attribute-name to be updated distinguishes corresponding index value, then by traveling through tag tree, tab indexes are searched in tag tree
In corresponding attribute type, attribute type here can include value type and text type.
204th, according to the attribute type, the property value of the tab indexes correspondence intermediate data is updated.
It should be noted that the update mode that the embodiment of the present invention is used for the tab indexes of different attribute type is not
Together, the embodiment of the present invention passes through to obtain the Attribute class of tab indexes by searching the attribute type in tag tree attribute list first
Type, attribute type here mainly includes text and numerical value two types, further to the tab indexes pair of different attribute type
The property value answered is updated.
For the embodiment of the present invention, if attribute type is text type, the tab indexes correspondence intermediate data is updated
Property value can include but is not limited to following implementations, because each text index points to respective labels, first basis
Tab indexes search corresponding text index in tag tree, the property value of text array are then updated by text index, here
Usually increase by a data in text array, so as to the property value to text array is updated, to text array
While property value updates, because the property value of text array there occurs change, therefore updated according to the property value of text array
The text index of tag tree.
For the embodiment of the present invention, if attribute type is value type, the tab indexes correspondence intermediate data is updated
Property value can include but is not limited to following implementations, because tag tree is the tree structure consistent with text structure,
Label is the node of tag tree, can directly by updating the property value in tag attributes list, so as to update tab indexes pair
Answer the property value of tag tree.
205th, the text array, the resource array and the tag tree are serialized respectively, obtains sequence
Binary data after change.
For the embodiment of the present invention, carrying out serializing to text array can include but is not limited to following implementations,
The quantity of character string carries out Memory Allocation according to shared by text array Chinese version first, obtains text committed memory, such as internal memory
Size can be (character string number+7 shared by text) * 4, then respectively according to the size of text array, text number, pattern
Text in text array is write internal memory by number, the order of separator, often writes a text, first calculates write-in length, then
Write-in particular content, is ultimately written 0X0000, as end mark.In order to ensure to write the neat of data in EMS memory, text is calculated
Text side-play amount in array, polishing is carried out according to text side-play amount to the text in write-in internal memory, here can be according to text
A upper text side-play amount and a upper text size in array, calculate each text side-play amount in text array, such as each text
This side-play amount is the length * 2+4 of a side-play amount+upper text of a upper text, and first side-play amount of text of acquiescence is 0,
The side-play amount of last text is taken the logarithm plus last text committed memory sum to 4, by the word that remainder value is 0
Section write-in internal memory, as alignment, if remainder is exactly 0, directly writes 4 the 0 of byte and enters internal memory.
It should be noted that due to resource array during the intermediate data for being converted to preset data structure hardly
Change, therefore only need as former state to be written to the data in resource array in internal memory for the serializing of resource array.
For the embodiment of the present invention, serializing is carried out to tag tree can include but is not limited to following implementations, first
First the type according to label in tag tree calculates label committed memory, and here if tag types, then committed memory size is
4* (9+ attribute numbers * 5), if NameSpace type, then committed memory size is 4*6, will be marked according to label committed memory
Sign tree in label write-in internal memory, if tag types, by tag types, size, source code line number, separator, prefix with
And title one-time write internal memory, if NameSpace type, by the NameSpace of each attribute, title, attribute textual value,
Attribute type and property value one-time write internal memory.
For the embodiment of the present invention, during after being serialized to tag tree, due to that may be deposited in tag tree
In multiple subtabs, in addition it is also necessary to judge that the label whether there is subtab;If in the presence of the type according to subtab calculates son
Label committed memory, further writes internal memory according to subtab committed memory by subtab.This step passes through respectively to the text
This array, the resource array and the tag tree are serialized, the binary data after being serialized, the serializing
Binary data afterwards equally includes text data, resource data and the part of label data three composition.
206th, the binary data after the serializing is write to file destination, the application program configuration after being updated
File.
For the binary data after serializing is reduced into application profiles, in addition it is also necessary to by the text after serializing
Notebook data, resource data and label data are write to file destination in the lump, the application program configuration after being updated
File, also needs in the lump write magic numeral and file entirety size during write-in.
The update method of another application profiles of the embodiment of the present invention, without by Android software development work
The compilation process of tool, application profiles are directly parsed, updated and serialized, can be to binary form
Application profiles realize quick renewal and reduction, improve the speed of service of system.
In order to realize above method embodiment, the present embodiment provides a kind of device corresponding with above method embodiment to be implemented
Example, as shown in figure 3, it illustrates a kind of updating device of application profiles, the device can include:
Resolution unit 31, can be used for when the more new command to application profiles is received, and parsing is described should
Program configuration file is used, the intermediate data of preset data structure is obtained, the resolution unit 31 is a kind of application profiles
Updating device in for parsing the main functional modules of application profiles so that application profiles
Be converted to the intermediate data that can be updated data structure;
Wherein, the intermediate data of preset data structure can include text array, resource array and the part of tag tree three
Data are constituted.
Updating block 32, can be used for the tab indexes carried in the more new command according to, update the tab indexes
The property value of the correspondence intermediate data, the updating block 32 is for more in a kind of updating device of application profiles
The main functional modules of the property value of new tab indexes correspondence intermediate data, specifically can find the label by tab indexes
The position of index correspondence intermediate data, updates the attribute of correspondence position intermediate data;
Serializing processing unit 33, can be used for serializing the intermediate data after renewal, answering after being updated
Use program configuration file, the serializing processing unit 33 be a kind of updating device of application profiles in be used for update
The main functional modules that intermediate data is serialized afterwards, so as to the intermediate data after renewal is reduced into answering for binary form
Use program configuration file.
The updating device of a kind of application profiles provided in an embodiment of the present invention, with existing use compilation tool
The mode that application profiles are updated is compared, the embodiment of the present invention ought be received to application profiles
During more new command, by parsing application profiles, the intermediate data of preset data structure is obtained, so as to refer to according to renewal
The tab indexes carried in order, update the property value of tab indexes correspondence intermediate data, after to translation tool decompiling
Configuration file such as is recompiled, compressed and is signed the operation, and then realizes the renewal to application profiles, is passed through
Intermediate data after renewal is serialized, application profiles quickly can be reduced into binary form, saved
System operation time.
Further, as shown in figure 4, the embodiment of the invention provides the more new clothes of another application profiles
Put,
Because binary data directly cannot be realized updating by textual form, the embodiment of the present invention is for further by two
Binary data is converted into the intermediate data of the preset data structure that can be updated, and the resolution unit 31 includes:
Load-on module 311, can be used for loading the binary data in the application profiles, with specific reference to should
The file type of application profiles is read with the magic numeral of program configuration file, if the type correspondence of configuration file
Be not binary data, then do not loaded;
Modular converter 312, can be used for being converted to the binary data intermediate data of preset data structure, so that
Realize the renewal of application profiles, wherein, the intermediate data of preset data structure include text array, resource array with
And tag tree.
The load-on module 311, can be also used for reading application according to the magic numeral of the application profiles
The file type of program configuration file;
The load-on module 311, can be also used for loading the application program according to the file type of the configuration file
Binary data in configuration file.
For the embodiment of the present invention, because the corresponding attribute type of tab indexes in more new command is different, enter one
Walk and the corresponding property value of tab indexes of different attribute type is updated, the updating block 32 includes:
Searching modul 321, can be used for traveling through the tag tree, search tab indexes correspondence in the tag tree
Attribute type, attribute type here can include value type and text type;
Update module 322, can be used for according to the attribute type, update the tab indexes correspondence intermediate data
Property value.
If the attribute type is text type, the updating block 32 specifically can be used for according to the label rope
Draw corresponding text index in the lookup tag tree, the property value of the text array, root are updated according to the text index
The text index of the tag tree is updated according to the property value of the text array.
If the attribute type is value type, the updating block 32 specifically can be also used for updating the label
The property value of the index correspondence tag tree.
For the embodiment of the present invention, due to the intermediate data of preset data structure include text array, resource array and
The partial data of tag tree three is constituted, and the serializing processing unit 33 includes:
Serializing processing module 331, can be used for respectively to the text array, the resource array and the label
Tree is serialized, the binary data after being serialized;
Writing module 332, can be used for writing the binary data after the serializing to file destination, be updated
Application profiles afterwards.
For the serializing of text array, the serializing processing module 331 specifically can be used for according to the textual data
The quantity of character string carries out Memory Allocation shared by group Chinese version, obtains text committed memory;
The serializing processing module 331, specifically can be also used for the textual data according to the text committed memory
Text write-in internal memory in group;
The serializing processing module 331, specifically can be also used for calculating the text side-play amount in the text array, root
Polishing is carried out to the text in write-in internal memory according to the text side-play amount.
The serializing processing module 331, specifically can be also used for according to a upper text side-play amount in text array and
A upper text size, calculates each text side-play amount in text array;
The serializing processing module 331, specifically can be also used for text side-play amount in the text array and
The text committed memory, polishing is carried out to the text in write-in internal memory.
For the serializing of tag tree, the serializing processing module 331 specifically can be also used for being got the bid according to tag tree
The type of label calculates label committed memory;
The serializing processing module 331, specifically can be also used for the tag tree according to the label committed memory
In label write-in internal memory.
The serialization module 331, specifically can be also used for judging that the label whether there is subtab;
The serialization module 331, if specifically can be also used for the label has subtab, according to the subtab
Type calculate subtab committed memory;
The serialization module 331, specifically can be also used for being write the subtab according to the subtab committed memory
Enter internal memory.
The updating device of another application profiles of the embodiment of the present invention, without by Android software development work
The compilation process of tool, application profiles are directly parsed, updated and serialized, can be to binary form
Application profiles realize quick renewal and reduction, improve the speed of service of system.
The invention discloses A1, a kind of update method of application profiles, including:
When the more new command to application profiles is received, the application profiles are parsed, obtained
The intermediate data of preset data structure;
According to the tab indexes carried in the more new command, the category of the tab indexes correspondence intermediate data is updated
Property value;
Intermediate data after renewal is serialized, the application profiles after being updated.
A2, the method as described in A1, the parsing application profiles, obtain the centre of preset data structure
Data include:
Load the binary data in the application profiles;
The binary data is converted to the intermediate data of preset data structure.
A3, the method as described in A2, the binary data in the loading application profiles include:
Magic numeral according to the application profiles reads the file type of application profiles;
File type according to the configuration file loads the binary data in the application profiles.
A4, the method as any one of A1-A3, the intermediate data of the preset data structure include text array,
Resource array and tag tree.
A5, the method as described in A4, the tab indexes carried in more new command described in the basis update the label rope
The property value for drawing the correspondence intermediate data includes:
The tag tree is traveled through, tab indexes corresponding attribute type in the tag tree is searched;
According to the attribute type, the property value of the tab indexes correspondence intermediate data is updated.
A6, the method as described in A5, if the attribute type is text type, the renewal tab indexes correspondence
The property value of the intermediate data includes:
According to corresponding text index in the tab indexes lookup tag tree;
The property value of the text array is updated according to the text index;
Property value according to the text array updates the text index of the tag tree.
A7, the method as described in A5, if the attribute type is value type, the renewal tab indexes correspondence
The property value of the intermediate data includes:
Update the property value of the tab indexes correspondence tag tree.
A8, the method as described in A4, the intermediate data after described pair of renewal are serialized, the application journey after being updated
Sequence configuration file includes:
The text array, the resource array and the tag tree are serialized respectively, after being serialized
Binary data;
Binary data after the serializing is write to file destination, the application program configuration text after being updated
Part.
A9, the method as described in A8, it is described serializing is carried out to the text array to include:
The quantity of character string carries out Memory Allocation according to shared by the text array Chinese version, obtains text committed memory;
Text in the text array is write by internal memory according to the text committed memory;
The text side-play amount in the text array is calculated, the text in write-in internal memory is entered according to the text side-play amount
Row polishing.
A10, the method as described in A9, the text side-play amount in the calculating text array, according to the text side-play amount
Carrying out polishing to the text in write-in internal memory includes:
According to a upper text side-play amount in text array and a upper text size, each text in text array is calculated
Side-play amount;
Text side-play amount and the text committed memory in the text array, enter to the text in write-in internal memory
Row polishing.
A11, the method as described in A8, it is described serializing is carried out to the tag tree to include:
Type according to label in tag tree calculates label committed memory;
Label in the tag tree is write by internal memory according to the label committed memory.
A12, the method as described in 11, write the label in the tag tree according to the label committed memory described
After internal memory, also include:
Judge that the label whether there is subtab;
If in the presence of the type according to the subtab calculates subtab committed memory;
The subtab is write by internal memory according to the subtab committed memory.
B13, a kind of updating device of application profiles, including:
Resolution unit, for when the more new command to application profiles is received, parsing the application program
Configuration file, obtains the intermediate data of preset data structure;
Updating block, for the tab indexes carried in the more new command according to, updates the tab indexes correspondence institute
State the property value of intermediate data;
Serializing processing unit, for being serialized to the intermediate data after renewal, the application program after being updated
Configuration file.
B14, the device as described in B13, the resolution unit include:
Load-on module, for loading the binary data in the application profiles;
Modular converter, the intermediate data for the binary data to be converted to preset data structure.
B15, the device as described in B14, it is characterised in that
The load-on module, is additionally operable to read application program configuration according to the magic numeral of the application profiles
The file type of file;
The load-on module, is additionally operable to load the application profiles according to the file type of the configuration file
In binary data.
B16, the device as any one of B13-B15, the intermediate data of the preset data structure include textual data
Group, resource array and tag tree.
B17, the device as described in B16, the updating block include:
Searching modul, for traveling through the tag tree, searches tab indexes corresponding attribute in the tag tree
Type;
Update module, for according to the attribute type, updating the attribute of the tab indexes correspondence intermediate data
Value.
B18, the device as described in B17, if the attribute type is text type,
The updating block, specifically for according to corresponding text index in the tab indexes lookup tag tree;
The updating block, is specifically additionally operable to be updated according to the text index property value of the text array;
The updating block, is specifically additionally operable to be updated according to the property value of the text array text rope of the tag tree
Draw.
B19, the device as described in B17, if the attribute type is value type,
The updating block, is specifically additionally operable to update the property value of the tab indexes correspondence tag tree.
B20, the device as described in B16, the serializing processing unit include:
Serializing processing module, for being carried out to the text array, the resource array and the tag tree respectively
Serializing, the binary data after being serialized;
Writing module, for the binary data after the serializing to be write to file destination, answering after being updated
Use program configuration file.
B21, the device as described in B20,
The serializing processing module, the quantity specifically for the character string according to shared by the text array Chinese version is carried out
Memory Allocation, obtains text committed memory;
The serializing processing module, is specifically additionally operable to the text in the text array according to the text committed memory
This write-in internal memory;
The serializing processing module, is specifically additionally operable to calculate the text side-play amount in the text array, according to described
Text side-play amount carries out polishing to the text in write-in internal memory.
B22, the device as described in B21,
The serializing processing module, is specifically additionally operable to according to a upper text side-play amount in text array and a upper text
This length, calculates each text side-play amount in text array;
The serializing processing module, the text side-play amount being specifically additionally operable in the text array and the text
Committed memory, polishing is carried out to the text in write-in internal memory.
B23, the device as described in B20, it is characterised in that
The serializing processing module, is specifically additionally operable to calculate label committed memory according to the type of label in tag tree;
The serializing processing module, is specifically additionally operable to the label in the tag tree according to the label committed memory
Write-in internal memory.
B24, the device as described in B23, it is characterised in that
The serialization module, is specifically additionally operable to judge that the label whether there is subtab;
The serialization module, if being specifically additionally operable to the label has subtab, according to the type of the subtab
Calculate subtab committed memory;
The serialization module, is specifically additionally operable to that the subtab is write into internal memory according to the subtab committed memory.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion described in detail in certain embodiment
Point, may refer to the associated description of other embodiment.
It is understood that the correlated characteristic in the above method and device can be referred to mutually.In addition, in above-described embodiment
" first ", " second " etc. be, for distinguishing each embodiment, and not represent the quality of each embodiment.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, may be referred to the corresponding process in preceding method embodiment, will not be repeated here.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system
Structure be obvious.Additionally, the present invention is not also directed to any certain programmed language.It is understood that, it is possible to use it is various
Programming language realizes the content of invention described herein, and the description done to language-specific above is to disclose this hair
Bright preferred forms.
In specification mentioned herein, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention
Example can be put into practice in the case of without these details.In some instances, known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify one or more that the disclosure and helping understands in each inventive aspect, exist
Above to the description of exemplary embodiment of the invention in, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor
The application claims of shield features more more than the feature being expressly recited in each claim.More precisely, such as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, and wherein each claim is in itself
All as separate embodiments of the invention.
Those skilled in the art are appreciated that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment
Unit or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit exclude each other, can use any
Combine to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit is required, summary and accompanying drawing) disclosed in each feature can the alternative features of or similar purpose identical, equivalent by offer carry out generation
Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment required for protection is appointed
One of meaning mode can be used in any combination.
All parts embodiment of the invention can be realized with hardware, or be run with one or more processor
Software module realize, or with combinations thereof realize.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) realize the method and dress of a kind of data storage according to embodiments of the present invention
The some or all functions of some or all parts in putting.The present invention is also implemented as described here for performing
Method some or all equipment or program of device (for example, computer program and computer program product).This
Sample realizes that program of the invention can be stored on a computer-readable medium, or can have one or more signal
Form.Such signal can be downloaded from internet website and obtained, or be provided on carrier signal, or with any other
Form is provided.
It should be noted that above-described embodiment the present invention will be described rather than limiting the invention, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol being located between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not
Element listed in the claims or step.Word "a" or "an" before element is not excluded the presence of as multiple
Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer
It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame
Claim.
Claims (10)
1. a kind of update method of application profiles, it is characterised in that including:
When the more new command to application profiles is received, the application profiles are parsed, preset
The intermediate data of data structure;
According to the tab indexes carried in the more new command, the attribute of the tab indexes correspondence intermediate data is updated
Value;
Intermediate data after renewal is serialized, the application profiles after being updated.
2. method according to claim 1, it is characterised in that the parsing application profiles, obtains pre-
If the intermediate data of data structure includes:
Load the binary data in the application profiles;
The binary data is converted to the intermediate data of preset data structure.
3. the method according to any one of claim 1-2, it is characterised in that the loading application program configuration text
Binary data in part includes:
Magic numeral according to the application profiles reads the file type of application profiles;
File type according to the configuration file loads the binary data in the application profiles.
4. the method according to any one of claim 1-3, it is characterised in that the intermediate data of the preset data structure
Including text array, resource array and tag tree.
5. the method according to any one of claim 1-4, it is characterised in that carried in more new command described in the basis
Tab indexes, the property value for updating the tab indexes correspondence intermediate data includes:
The tag tree is traveled through, tab indexes corresponding attribute type in the tag tree is searched;
According to the attribute type, the property value of the tab indexes correspondence intermediate data is updated.
6. the method according to any one of claim 1-5, it is characterised in that if the attribute type is text type
When, the property value of the renewal tab indexes correspondence intermediate data includes:
According to corresponding text index in the tab indexes lookup tag tree;
The property value of the text array is updated according to the text index;
Property value according to the text array updates the text index of the tag tree.
7. the method according to any one of claim 1-6, it is characterised in that if the attribute type is value type
When, the property value of the renewal tab indexes correspondence intermediate data includes:
Update the property value of the tab indexes correspondence tag tree.
8. the method according to any one of claim 1-7, it is characterised in that described pair update after intermediate data carry out
Serializing, the application profiles after being updated include:
The text array, the resource array and the tag tree are serialized respectively, after being serialized two
Binary data;
Binary data after the serializing is write to file destination, the application profiles after being updated.
9. the method according to any one of claim 1-8, it is characterised in that described that sequence is carried out to the text array
Change includes:
The quantity of character string carries out Memory Allocation according to shared by the text array Chinese version, obtains text committed memory;
Text in the text array is write by internal memory according to the text committed memory;
The text side-play amount in the text array is calculated, the text in write-in internal memory is mended according to the text side-play amount
Together.
10. a kind of updating device of application profiles, it is characterised in that including:
Resolution unit, for when the more new command to application profiles is received, parsing the application program configuration
File, obtains the intermediate data of preset data structure;
Updating block, for the tab indexes carried in the more new command according to, during the renewal tab indexes correspondence is described
Between data property value;
Serializing processing unit, for being serialized to the intermediate data after renewal, the application program configuration after being updated
File.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611208520.7A CN106843842B (en) | 2016-12-23 | 2016-12-23 | Method and device for updating application program configuration file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611208520.7A CN106843842B (en) | 2016-12-23 | 2016-12-23 | Method and device for updating application program configuration file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106843842A true CN106843842A (en) | 2017-06-13 |
CN106843842B CN106843842B (en) | 2020-06-12 |
Family
ID=59136622
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611208520.7A Active CN106843842B (en) | 2016-12-23 | 2016-12-23 | Method and device for updating application program configuration file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106843842B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109408078A (en) * | 2018-11-01 | 2019-03-01 | 西北工业大学 | A kind of update method and device of machine |
CN109582390A (en) * | 2018-11-29 | 2019-04-05 | 上海哔哩哔哩科技有限公司 | Game data generation method, device and storage medium based on exploitation allocation list |
CN110058915A (en) * | 2019-04-19 | 2019-07-26 | 努比亚技术有限公司 | Interface adaptation adaptation method, device, wearable device and storage medium |
CN111045748A (en) * | 2019-12-04 | 2020-04-21 | 方正株式(武汉)科技开发有限公司 | Method and system for rapidly reading configuration file, server and medium |
CN111142965A (en) * | 2019-12-16 | 2020-05-12 | 深圳市优必选科技股份有限公司 | Language configuration method and device, electronic equipment and storage medium |
CN111813436A (en) * | 2020-06-17 | 2020-10-23 | 中车株洲电力机车研究所有限公司 | Method and system for updating configuration files in batch |
CN112099824A (en) * | 2020-08-31 | 2020-12-18 | 通号城市轨道交通技术有限公司 | Ground ATP system software upgrading method and device |
CN112099933A (en) * | 2020-09-21 | 2020-12-18 | 北京百度网讯科技有限公司 | Task operation and query method and device, electronic equipment and storage medium |
CN113157276A (en) * | 2021-04-09 | 2021-07-23 | 北京沃东天骏信息技术有限公司 | Layout file conversion method, device, electronic equipment and computer readable medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103186391A (en) * | 2011-12-29 | 2013-07-03 | 腾讯科技(深圳)有限公司 | Browser upgrading method and system and upgrading server |
CN104077142A (en) * | 2014-07-04 | 2014-10-01 | 用友软件股份有限公司 | Module integration method and device of Web system |
WO2015080556A1 (en) * | 2013-11-27 | 2015-06-04 | Mimos Berhad | Method for booting an embedded device from an external usb device |
CN104756076A (en) * | 2012-10-28 | 2015-07-01 | 谷歌股份有限公司 | Configuration file updater |
-
2016
- 2016-12-23 CN CN201611208520.7A patent/CN106843842B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103186391A (en) * | 2011-12-29 | 2013-07-03 | 腾讯科技(深圳)有限公司 | Browser upgrading method and system and upgrading server |
CN104756076A (en) * | 2012-10-28 | 2015-07-01 | 谷歌股份有限公司 | Configuration file updater |
WO2015080556A1 (en) * | 2013-11-27 | 2015-06-04 | Mimos Berhad | Method for booting an embedded device from an external usb device |
CN104077142A (en) * | 2014-07-04 | 2014-10-01 | 用友软件股份有限公司 | Module integration method and device of Web system |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109408078A (en) * | 2018-11-01 | 2019-03-01 | 西北工业大学 | A kind of update method and device of machine |
CN109408078B (en) * | 2018-11-01 | 2022-03-08 | 西北工业大学 | Machine updating method and device |
CN109582390A (en) * | 2018-11-29 | 2019-04-05 | 上海哔哩哔哩科技有限公司 | Game data generation method, device and storage medium based on exploitation allocation list |
CN110058915A (en) * | 2019-04-19 | 2019-07-26 | 努比亚技术有限公司 | Interface adaptation adaptation method, device, wearable device and storage medium |
CN111045748A (en) * | 2019-12-04 | 2020-04-21 | 方正株式(武汉)科技开发有限公司 | Method and system for rapidly reading configuration file, server and medium |
CN111142965A (en) * | 2019-12-16 | 2020-05-12 | 深圳市优必选科技股份有限公司 | Language configuration method and device, electronic equipment and storage medium |
CN111813436A (en) * | 2020-06-17 | 2020-10-23 | 中车株洲电力机车研究所有限公司 | Method and system for updating configuration files in batch |
CN112099824A (en) * | 2020-08-31 | 2020-12-18 | 通号城市轨道交通技术有限公司 | Ground ATP system software upgrading method and device |
CN112099933A (en) * | 2020-09-21 | 2020-12-18 | 北京百度网讯科技有限公司 | Task operation and query method and device, electronic equipment and storage medium |
CN112099933B (en) * | 2020-09-21 | 2023-11-07 | 北京百度网讯科技有限公司 | Task operation and query method and device, electronic equipment and storage medium |
CN113157276A (en) * | 2021-04-09 | 2021-07-23 | 北京沃东天骏信息技术有限公司 | Layout file conversion method, device, electronic equipment and computer readable medium |
Also Published As
Publication number | Publication date |
---|---|
CN106843842B (en) | 2020-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106843842A (en) | The update method and device of a kind of application profiles | |
Buckley | PySLHA: a pythonic interface to SUSY Les Houches accord data | |
CN106951228B (en) | Method and device for processing differences in version iteration | |
CN104133772B (en) | Automatic test data generation method | |
CN102279749B (en) | Method and equipment for merging codes | |
US7676479B2 (en) | Method and system for updating versions of content stored in a storage device | |
US20050005239A1 (en) | System and method for automatic insertion of cross references in a document | |
US20120174061A1 (en) | Code suggestion in a software development tool | |
CN108628751A (en) | A kind of useless dependence item detection method and device | |
US7631004B2 (en) | Systems and methods for creating a template from an existing file | |
CN107797823B (en) | Business rule management method and device, storage medium and computer equipment | |
CN106844772A (en) | The update method and device of application database | |
CN106681720A (en) | Compression method and device and decompression method and device for installation packages | |
EP1085412A2 (en) | A relocation format for linking | |
CN106843984A (en) | The update method and device of application database | |
CN101882094A (en) | Method and system for making patch by embedded system | |
KR20120127204A (en) | Method and apparatus for stabilized binary differencing | |
CN109241515B (en) | Method and device for generating report file | |
CN112889026A (en) | User interface resource file optimization | |
Le Zou et al. | On synchronizing with web service evolution | |
CN107577476A (en) | A kind of Android system source code difference analysis method, server and medium based on Module Division | |
CN109460255A (en) | The querying method and device of memory address | |
CN115167862A (en) | Patch method and related equipment | |
CN113811849A (en) | System and method for computer-aided computer programming | |
Warnes et al. | Package ‘gdata’ |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |